summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-01 17:40:47 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-01 17:40:47 +0000
commit04132a6c5cbf4089b1c705925afb70258341530e (patch)
treef0dc2b6529ed24ce40674570bda513d5e6f9a73c /cmake
parent8df451fc0b69a4680f2d2ae116b2978658581d98 (diff)
downloadexternal_llvm-04132a6c5cbf4089b1c705925afb70258341530e.zip
external_llvm-04132a6c5cbf4089b1c705925afb70258341530e.tar.gz
external_llvm-04132a6c5cbf4089b1c705925afb70258341530e.tar.bz2
Reverts commit r190808 and r190556.
The use of these features in clang has been reverted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/GetSVN.cmake54
1 files changed, 17 insertions, 37 deletions
diff --git a/cmake/modules/GetSVN.cmake b/cmake/modules/GetSVN.cmake
index 4e32c09..acccc12 100644
--- a/cmake/modules/GetSVN.cmake
+++ b/cmake/modules/GetSVN.cmake
@@ -2,44 +2,24 @@
#
# Input variables:
# FIRST_SOURCE_DIR - First source directory
-# FIRST_NAME - The macro prefix for the first repository's info
-# SECOND_SOURCE_DIR - Second source directory (opt)
-# SECOND_NAME - The macro prefix for the second repository's info (opt)
+# FIRST_REPOSITORY - The macro to define to the first revision number.
+# SECOND_SOURCE_DIR - Second source directory
+# SECOND_REPOSITORY - The macro to define to the second revision number.
# HEADER_FILE - The header file to write
-#
-# The output header will contain macros FIRST_REPOSITORY and FIRST_REVISION,
-# and SECOND_REPOSITORY and SECOND_REVISION if requested, where "FIRST" and
-# "SECOND" are substituted with the names specified in the input variables.
-
-# Chop off cmake/modules/GetSVN.cmake
-get_filename_component(LLVM_DIR "${CMAKE_SCRIPT_MODE_FILE}" PATH)
-get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
-get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
-
-# Handle strange terminals
-set(ENV{TERM} "dumb")
+include(FindSubversion)
+if (Subversion_FOUND AND EXISTS "${FIRST_SOURCE_DIR}/.svn")
+ # Repository information for the first repository.
+ Subversion_WC_INFO(${FIRST_SOURCE_DIR} MY)
+ file(WRITE ${HEADER_FILE}.txt "#define ${FIRST_REPOSITORY} \"${MY_WC_REVISION}\"\n")
-function(append_info name path)
- execute_process(COMMAND "${LLVM_DIR}/utils/GetSourceVersion" "${path}"
- OUTPUT_VARIABLE revision)
- string(STRIP "${revision}" revision)
- execute_process(COMMAND "${LLVM_DIR}/utils/GetRepositoryPath" "${path}"
- OUTPUT_VARIABLE repository
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(STRIP "${repository}" repository)
- file(APPEND "${HEADER_FILE}.txt"
- "#define ${name}_REVISION \"${revision}\"\n")
- file(APPEND "${HEADER_FILE}.txt"
- "#define ${name}_REPOSITORY \"${repository}\"\n")
-endfunction()
+ # Repository information for the second repository.
+ if (EXISTS "${SECOND_SOURCE_DIR}/.svn")
+ Subversion_WC_INFO(${SECOND_SOURCE_DIR} MY)
+ file(APPEND ${HEADER_FILE}.txt
+ "#define ${SECOND_REPOSITORY} \"${MY_WC_REVISION}\"\n")
+ endif ()
-append_info(${FIRST_NAME} "${FIRST_SOURCE_DIR}")
-if(DEFINED SECOND_SOURCE_DIR)
- append_info(${SECOND_NAME} "${SECOND_SOURCE_DIR}")
+ # Copy the file only if it has changed.
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${HEADER_FILE}.txt ${HEADER_FILE})
endif()
-
-# Copy the file only if it has changed.
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${HEADER_FILE}.txt" "${HEADER_FILE}")
-file(REMOVE "${HEADER_FILE}.txt")
-