From: Chris Bieneman Date: Fri, 5 Feb 2016 03:59:08 +0000 (+0000) Subject: [CMake] One more try to make CMake clean up after itself X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ba1f13b04e48bdc5a2eb4a505df923aa1ed3179;p=clang [CMake] One more try to make CMake clean up after itself Seriously... CMake... You're on my list... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259873 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ca2305e306..7542bb4616 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -586,6 +586,10 @@ if( CLANG_INCLUDE_DOCS ) add_subdirectory(docs) endif() +if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/clang.order") + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/clang.order") +endif() + if(CLANG_ORDER_FILE STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/clang.order") unset(CLANG_ORDER_FILE CACHE) unset(CLANG_ORDER_FILE) diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index ffcfbb505a..bb631db79c 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -87,7 +87,7 @@ if (APPLE) set(TOOL_INFO_BUILD_VERSION) endif() -if(CLANG_ORDER_FILE) +if(CLANG_ORDER_FILE AND EXISTS CLANG_ORDER_FILE) target_link_libraries(clang "-Wl,-order_file,${CLANG_ORDER_FILE}") endif()