diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2017-05-11 13:19:24 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2017-05-11 13:19:24 +0000 |
commit | c68ab69fbb44fccb8c454872d93883677b2a0cb5 (patch) | |
tree | 1fcc5360fbce8f4d69d6f3d0ca9e001427ecf290 | |
parent | 97bb85cddc537798fec107f86d041ebd34d76a48 (diff) |
Fix two-stage build on windows using DistributionExample cmake cache
Thanks to Matthew Larionov <matthewtff@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302795 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | cmake/caches/DistributionExample.cmake | 13 |
2 files changed, 20 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ca696b1ce7..9e43a103b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -579,10 +579,17 @@ if (CLANG_ENABLE_BOOTSTRAP) add_dependencies(clang-bootstrap-deps compiler-rt) endif() + set(C_COMPILER "clang") + set(CXX_COMPILER "clang++") + if(WIN32) + set(C_COMPILER "clang-cl.exe") + set(CXX_COMPILER "clang-cl.exe") + endif() + set(COMPILER_OPTIONS - -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++ - -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang - -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) + -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${CXX_COMPILER} + -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER} + -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER}) if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED) add_dependencies(clang-bootstrap-deps llvm-profdata) diff --git a/cmake/caches/DistributionExample.cmake b/cmake/caches/DistributionExample.cmake index 862f547c16..551f4ee07e 100644 --- a/cmake/caches/DistributionExample.cmake +++ b/cmake/caches/DistributionExample.cmake @@ -29,6 +29,13 @@ set(CLANG_BOOTSTRAP_TARGETS # Setup the bootstrap build. set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") -set(CLANG_BOOTSTRAP_CMAKE_ARGS - -C ${CMAKE_CURRENT_LIST_DIR}/DistributionExample-stage2.cmake - CACHE STRING "") + +if(STAGE2_CACHE_FILE) + set(CLANG_BOOTSTRAP_CMAKE_ARGS + -C ${STAGE2_CACHE_FILE} + CACHE STRING "") +else() + set(CLANG_BOOTSTRAP_CMAKE_ARGS + -C ${CMAKE_CURRENT_LIST_DIR}/DistributionExample-stage2.cmake + CACHE STRING "") +endif() |