Index: lld/CMakeLists.txt =================================================================== --- lld/CMakeLists.txt +++ lld/CMakeLists.txt @@ -130,39 +130,6 @@ string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" LLD_VERSION_MINOR ${LLD_VERSION}) -# Determine LLD revision and repository. -# TODO: Figure out a way to get the revision and the repository on windows. -if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" ) - execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLD_SOURCE_DIR} - OUTPUT_VARIABLE LLD_REVISION) - - execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLD_SOURCE_DIR} - OUTPUT_VARIABLE LLD_REPOSITORY) - if ( LLD_REPOSITORY ) - # Replace newline characters with spaces - string(REGEX REPLACE "(\r?\n)+" " " LLD_REPOSITORY ${LLD_REPOSITORY}) - # Remove leading spaces - STRING(REGEX REPLACE "^[ \t\r\n]+" "" LLD_REPOSITORY "${LLD_REPOSITORY}" ) - # Remove trailing spaces - string(REGEX REPLACE "(\ )+$" "" LLD_REPOSITORY ${LLD_REPOSITORY}) - endif() - - if ( LLD_REVISION ) - # Replace newline characters with spaces - string(REGEX REPLACE "(\r?\n)+" " " LLD_REVISION ${LLD_REVISION}) - # Remove leading spaces - STRING(REGEX REPLACE "^[ \t\r\n]+" "" LLD_REVISION "${LLD_REVISION}" ) - # Remove trailing spaces - string(REGEX REPLACE "(\ )+$" "" LLD_REVISION ${LLD_REVISION}) - endif() -endif () - -# Configure the Version.inc file. -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/include/lld/Common/Version.inc.in - ${CMAKE_CURRENT_BINARY_DIR}/include/lld/Common/Version.inc) - - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR "In-source builds are not allowed. CMake would overwrite " "the makefiles distributed with LLVM. Please create a directory and run cmake " Index: lld/include/lld/Common/Version.inc.in =================================================================== --- lld/include/lld/Common/Version.inc.in +++ lld/include/lld/Common/Version.inc.in @@ -1,6 +1 @@ -#define LLD_VERSION @LLD_VERSION@ #define LLD_VERSION_STRING "@LLD_VERSION@" -#define LLD_VERSION_MAJOR @LLD_VERSION_MAJOR@ -#define LLD_VERSION_MINOR @LLD_VERSION_MINOR@ -#define LLD_REVISION_STRING "@LLD_REVISION@" -#define LLD_REPOSITORY_STRING "@LLD_REPOSITORY@" Index: llvm/utils/GetRepositoryPath =================================================================== --- llvm/utils/GetRepositoryPath +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -usage() { - echo "usage: $0 " - echo " Prints the source control repository path of the given source" - echo " directory, the exact format of the revision string depends on the" - echo " source control system. If the source control system isn't known," - echo " the output is empty and the exit code is 1." - exit 1 -} - -if [ $# != 1 ] || [ ! -d $1 ]; then - usage; -fi - -cd $1 -if [ -d .svn ]; then - svn info | grep '^URL:' | cut -d: -f2- -elif [ -f .git/svn/.metadata ]; then - git svn info | grep 'URL:' | cut -d: -f2- -elif [ -d .git ]; then - git remote -v | grep 'fetch' | awk '{ print $2 }' | head -n1 -else - exit 1; -fi - -exit 0 Index: llvm/utils/gn/secondary/lld/include/lld/Common/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/lld/include/lld/Common/BUILD.gn +++ llvm/utils/gn/secondary/lld/include/lld/Common/BUILD.gn @@ -4,13 +4,5 @@ write_cmake_config("version") { input = "Version.inc.in" output = "$target_gen_dir/Version.inc" - values = [ - "LLD_VERSION=$llvm_version", - "LLD_VERSION_MAJOR=$llvm_version_major", - "LLD_VERSION_MINOR=$llvm_version_minor", - - # FIXME: Real values for these: - "LLD_REVISION=", - "LLD_REPOSITORY=", - ] + values = [ "LLD_VERSION=$llvm_version" ] }