llvm.org GIT mirror llvm / 04132a6
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 Rafael Espindola 6 years ago
1 changed file(s) with 17 addition(s) and 37 deletion(s). Raw diff Collapse all Expand all
11 #
22 # Input variables:
33 # FIRST_SOURCE_DIR - First source directory
4 # FIRST_NAME - The macro prefix for the first repository's info
5 # SECOND_SOURCE_DIR - Second source directory (opt)
6 # SECOND_NAME - The macro prefix for the second repository's info (opt)
4 # FIRST_REPOSITORY - The macro to define to the first revision number.
5 # SECOND_SOURCE_DIR - Second source directory
6 # SECOND_REPOSITORY - The macro to define to the second revision number.
77 # HEADER_FILE - The header file to write
8 #
9 # The output header will contain macros FIRST_REPOSITORY and FIRST_REVISION,
10 # and SECOND_REPOSITORY and SECOND_REVISION if requested, where "FIRST" and
11 # "SECOND" are substituted with the names specified in the input variables.
8 include(FindSubversion)
9 if (Subversion_FOUND AND EXISTS "${FIRST_SOURCE_DIR}/.svn")
10 # Repository information for the first repository.
11 Subversion_WC_INFO(${FIRST_SOURCE_DIR} MY)
12 file(WRITE ${HEADER_FILE}.txt "#define ${FIRST_REPOSITORY} \"${MY_WC_REVISION}\"\n")
1213
13 # Chop off cmake/modules/GetSVN.cmake
14 get_filename_component(LLVM_DIR "${CMAKE_SCRIPT_MODE_FILE}" PATH)
15 get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
16 get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
14 # Repository information for the second repository.
15 if (EXISTS "${SECOND_SOURCE_DIR}/.svn")
16 Subversion_WC_INFO(${SECOND_SOURCE_DIR} MY)
17 file(APPEND ${HEADER_FILE}.txt
18 "#define ${SECOND_REPOSITORY} \"${MY_WC_REVISION}\"\n")
19 endif ()
1720
18 # Handle strange terminals
19 set(ENV{TERM} "dumb")
20
21 function(append_info name path)
22 execute_process(COMMAND "${LLVM_DIR}/utils/GetSourceVersion" "${path}"
23 OUTPUT_VARIABLE revision)
24 string(STRIP "${revision}" revision)
25 execute_process(COMMAND "${LLVM_DIR}/utils/GetRepositoryPath" "${path}"
26 OUTPUT_VARIABLE repository
27 OUTPUT_STRIP_TRAILING_WHITESPACE)
28 string(STRIP "${repository}" repository)
29 file(APPEND "${HEADER_FILE}.txt"
30 "#define ${name}_REVISION \"${revision}\"\n")
31 file(APPEND "${HEADER_FILE}.txt"
32 "#define ${name}_REPOSITORY \"${repository}\"\n")
33 endfunction()
34
35 append_info(${FIRST_NAME} "${FIRST_SOURCE_DIR}")
36 if(DEFINED SECOND_SOURCE_DIR)
37 append_info(${SECOND_NAME} "${SECOND_SOURCE_DIR}")
21 # Copy the file only if it has changed.
22 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
23 ${HEADER_FILE}.txt ${HEADER_FILE})
3824 endif()
39
40 # Copy the file only if it has changed.
41 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
42 "${HEADER_FILE}.txt" "${HEADER_FILE}")
43 file(REMOVE "${HEADER_FILE}.txt")
44