diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt index 641f71c114ae..b0320ef6483f 100644 --- a/lld/CMakeLists.txt +++ b/lld/CMakeLists.txt @@ -130,39 +130,6 @@ string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" LLD_VERSION_MAJOR 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 " diff --git a/lld/include/lld/Common/Version.inc.in b/lld/include/lld/Common/Version.inc.in index 2789a5c46089..5cb48a546e11 100644 --- a/lld/include/lld/Common/Version.inc.in +++ b/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@" diff --git a/llvm/utils/GetRepositoryPath b/llvm/utils/GetRepositoryPath deleted file mode 100755 index 2d1122e4bc4f..000000000000 --- a/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 diff --git a/llvm/utils/gn/secondary/lld/include/lld/Common/BUILD.gn b/llvm/utils/gn/secondary/lld/include/lld/Common/BUILD.gn index 82a0923e930f..f05f0bfed2e0 100644 --- a/llvm/utils/gn/secondary/lld/include/lld/Common/BUILD.gn +++ b/llvm/utils/gn/secondary/lld/include/lld/Common/BUILD.gn @@ -4,13 +4,5 @@ import("//llvm/version.gni") 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" ] }