diff options
author | Alexander Shaposhnikov <shal1t712@gmail.com> | 2016-12-31 05:25:52 +0000 |
---|---|---|
committer | Alexander Shaposhnikov <shal1t712@gmail.com> | 2016-12-31 05:25:52 +0000 |
commit | 021fcf99fa531ede83709ea6efa6dcef9e9690de (patch) | |
tree | 8080a95194a655453ab0896e760305e8763929a6 /CMakeLists.txt | |
parent | ff65ccf9af58b5763922ba061dd9237b76904c42 (diff) |
[clang] Fix clean build of generate-order-file
This diff fixes the clean build of the target generate-order-file.
In llvm/tools/clang/CMakeLists.txt
add_subdirectory(utils/perf-training) should go after the block where
the value of the variable CLANG_ORDER_FILE is set - otherwise
(tested with cmake's version 3.6.2) the arguments of perf-helper.py gen-order-file
will be ill-formed (CLANG_ORDER_FILE will be empty).
Differential revision: https://reviews.llvm.org/D28153
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290781 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 509c7a428f..c09b75f990 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -421,6 +421,29 @@ else() endif() add_subdirectory(examples) +if(APPLE) + # this line is needed as a cleanup to ensure that any CMakeCaches with the old + # default value get updated to the new default. + if(CLANG_ORDER_FILE STREQUAL "") + unset(CLANG_ORDER_FILE CACHE) + unset(CLANG_ORDER_FILE) + endif() + + + set(CLANG_ORDER_FILE ${CMAKE_CURRENT_BINARY_DIR}/clang.order CACHE FILEPATH + "Order file to use when compiling clang in order to improve startup time (Darwin Only - requires ld64).") + + if(NOT EXISTS ${CLANG_ORDER_FILE}) + string(FIND "${CLANG_ORDER_FILE}" "${CMAKE_CURRENT_BINARY_DIR}" PATH_START) + if(PATH_START EQUAL 0) + file(WRITE ${CLANG_ORDER_FILE} "\n") + else() + message(FATAL_ERROR "Specified order file '${CLANG_ORDER_FILE}' does not exist.") + endif() + endif() +endif() + + if( CLANG_INCLUDE_TESTS ) if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h) add_subdirectory(unittests) @@ -455,29 +478,6 @@ if( CLANG_INCLUDE_DOCS ) add_subdirectory(docs) endif() - -if(APPLE) - # this line is needed as a cleanup to ensure that any CMakeCaches with the old - # default value get updated to the new default. - if(CLANG_ORDER_FILE STREQUAL "") - unset(CLANG_ORDER_FILE CACHE) - unset(CLANG_ORDER_FILE) - endif() - - - set(CLANG_ORDER_FILE ${CMAKE_CURRENT_BINARY_DIR}/clang.order CACHE FILEPATH - "Order file to use when compiling clang in order to improve startup time (Darwin Only - requires ld64).") - - if(CLANG_ORDER_FILE AND NOT EXISTS ${CLANG_ORDER_FILE}) - string(FIND "${CLANG_ORDER_FILE}" "${CMAKE_CURRENT_BINARY_DIR}" PATH_START) - if(PATH_START EQUAL 0) - file(WRITE ${CLANG_ORDER_FILE} "\n") - else() - message(FATAL_ERROR "Specified order file '${CLANG_ORDER_FILE}' does not exist.") - endif() - endif() -endif() - add_subdirectory(cmake/modules) if(CLANG_STAGE) |