summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt46
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)