summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2017-05-11 13:19:24 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2017-05-11 13:19:24 +0000
commit25f1a6ed16db75b5ba53cc42c23364c693ca4096 (patch)
tree102b402d67cdb160531dacf31b5ab04d930a10a2
parentf3d7904d20120fb6e4b33cd391b916ca6701e03e (diff)
downloadbcm5719-llvm-25f1a6ed16db75b5ba53cc42c23364c693ca4096.tar.gz
bcm5719-llvm-25f1a6ed16db75b5ba53cc42c23364c693ca4096.zip
Fix two-stage build on windows using DistributionExample cmake cache
Thanks to Matthew Larionov <matthewtff@gmail.com> llvm-svn: 302795
-rw-r--r--clang/CMakeLists.txt13
-rw-r--r--clang/cmake/caches/DistributionExample.cmake13
2 files changed, 20 insertions, 6 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index ca696b1ce79..9e43a103b2b 100644
--- a/clang/CMakeLists.txt
+++ b/clang/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/clang/cmake/caches/DistributionExample.cmake b/clang/cmake/caches/DistributionExample.cmake
index 862f547c165..551f4ee07ea 100644
--- a/clang/cmake/caches/DistributionExample.cmake
+++ b/clang/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()
OpenPOWER on IntegriCloud