From aa58952ce3eb66489aeed73c1efd5b47b496b0a0 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 16 Dec 2013 16:03:21 +0000 Subject: [PATCH] [CMake] Introduce CLANG_RUNTIME_OUTPUT_INTDIR and CLANG_LIBRARY_OUTPUT_INTDIR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197395 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 3 +++ lib/Headers/CMakeLists.txt | 2 +- tools/driver/CMakeLists.txt | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d02bf05f8..8db8a9a005 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,9 @@ set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) +set(CLANG_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}) +set(CLANG_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}) + if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE ) message(FATAL_ERROR "In-source builds are not allowed. CMake would overwrite " "the makefiles distributed with LLVM. Please create a directory and run cmake " diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt index 2da1a28aca..9c27593988 100644 --- a/lib/Headers/CMakeLists.txt +++ b/lib/Headers/CMakeLists.txt @@ -47,7 +47,7 @@ set(files module.map ) -set(output_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/clang/${CLANG_VERSION}/include) +set(output_dir ${CLANG_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include) # If we are in an IDE that has a configuration directory, we need to # create a second copy of the headers so that 'clang' can find them if diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index 4a96d5f069..3526006bbb 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -61,11 +61,11 @@ if(UNIX) set(clang_binary "clang${CMAKE_EXECUTABLE_SUFFIX}") else() set(CLANGXX_LINK_OR_COPY copy) - set(clang_binary "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}") + set(clang_binary "${CLANG_RUNTIME_OUTPUT_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}") endif() # Create the clang++ symlink in the build directory. -set(clang_pp "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}") +set(clang_pp "${CLANG_RUNTIME_OUTPUT_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}") add_custom_command(TARGET clang POST_BUILD COMMAND ${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY} "${clang_binary}" "${clang_pp}") @@ -73,7 +73,7 @@ set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_pp}) # Create the clang-cl symlink in the build directory. -set(clang_cl "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/clang-cl${CMAKE_EXECUTABLE_SUFFIX}") +set(clang_cl "${CLANG_RUNTIME_OUTPUT_INTDIR}/clang-cl${CMAKE_EXECUTABLE_SUFFIX}") add_custom_command(TARGET clang POST_BUILD COMMAND ${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY} "${clang_binary}" "${clang_cl}") -- 2.40.0