MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015678 | CMake | CMake | public | 2015-08-03 17:08 | 2016-01-04 11:52 |
Reporter | Chris | ||||
Assigned To | |||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Platform | Apple Mac | OS | OS X | OS Version | 10.10.4 |
Product Version | CMake 3.3 | ||||
Target Version | Fixed in Version | ||||
Summary | 0015678: CMakeCache.txt can't be passed into cmake's -C flag | ||||
Description | I'm probably trying to be too clever, but I'm trying to setup a cmake build target for clang to do a "bootstrap" build where you build clang, then use the built clang to rebuild clang. I had this "genius" idea that I could try and pass through the CMake options used to configure the first clang using the CMakeCache.txt and the -C flag. It unfortunately doesn't work. I see the following errors: [2/5] Performing configure step for 'bootstrap' FAILED: cd /Users/cbieneman/dev/open-source/llvm-build-rel/tools/clang/bootstrap/src/bootstrap-build && /Users/cbieneman/dev/open-source/cmake-bins/bin/cmake -C /Users/cbieneman/dev/open-source/llvm-build-rel/CMakeCache.txt -DCMAKE_CXX_COMPILER=/Users/cbieneman/dev/open-source/llvm-build-rel/bin/clang++ -DCMAKE_CXX_COMPILER=/Users/cbieneman/dev/open-source/llvm-build-rel/bin/clang "-GSublime Text 2 - Ninja" /Users/cbieneman/dev/open-source/llvm && /Users/cbieneman/dev/open-source/cmake-bins/bin/cmake -E touch /Users/cbieneman/dev/open-source/llvm-build-rel/tools/clang/bootstrap/src/bootstrap-stamp/bootstrap-configure loading initial cache file /Users/cbieneman/dev/open-source/llvm-build-rel/CMakeCache.txt CMake Error: Error in cmake code at /Users/cbieneman/dev/open-source/llvm-build-rel/CMakeCache.txt:17: Parse error. Expected a command name, got unquoted argument with text "//Default". CMake Error: Error processing file: /Users/cbieneman/dev/open-source/llvm-build-rel/CMakeCache.txt | ||||
Steps To Reproduce | Apply the diffs below to clang, and configure with CMake setting -DCLANG_ENABLE_BOOTSTRAP=On, and run <buildtool> bootstrap. | ||||
Additional Information | diff --git a/CMakeLists.txt b/CMakeLists.txt index ab70f1d..6974b6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN "Set to ON to force using an old, unsupported host toolchain." OFF) + option(CLANG_ENABLE_BOOTSTRAP "Generate the clang bootstrap target" OFF) include(AddLLVM) include(TableGen) @@ -551,3 +552,31 @@ if (CLANG_BUILT_STANDALONE) ${CLANG_BINARY_DIR}/share/clang/cmake/ClangConfig.cmake COPYONLY) endif () + +if (CLANG_ENABLE_BOOTSTRAP) + include(ExternalProject) + + ExternalProject_Add(bootstrap + DEPENDS clang + PREFIX bootstrap + SOURCE_DIR ${CMAKE_SOURCE_DIR} + CMAKE_ARGS -C ${CMAKE_BINARY_DIR}/CMakeCache.txt + ${CLANG_BOOTSTRAP_CMAKE_ARGS} + -DCMAKE_CXX_COMPILER=${CMAKE_BINARY_DIR}/bin/clang++ + -DCMAKE_CXX_COMPILER=${CMAKE_BINARY_DIR}/bin/clang + STEP_TARGETS configure build + ) + + ExternalProject_Add_Step(bootstrap force-reconfigure + DEPENDERS configure + ALWAYS 1 + ) + + ExternalProject_Add_Step(bootstrap clobber + COMMAND ${CMAKE_COMMAND} -E remove_directory <BINARY_DIR> + COMMAND ${CMAKE_COMMAND} -E make_directory <BINARY_DIR> + COMMENT "Clobberring compiler-rt build directory..." + DEPENDERS configure + DEPENDS ${LLVM_RUNTIME_OUTPUT_INTDIR}/bootstrap + ) +endif() | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2015-08-03 17:08 | Chris | New Issue | |||
2015-08-04 08:50 | Brad King | Note Added: 0039225 | |||
2015-08-04 08:50 | Brad King | Status | new => resolved | ||
2015-08-04 08:50 | Brad King | Resolution | open => won't fix | ||
2015-08-04 12:11 | Chris | Note Added: 0039228 | |||
2015-08-04 12:56 | Brad King | Note Added: 0039229 | |||
2016-01-04 11:52 | Robert Maynard | Note Added: 0040105 | |||
2016-01-04 11:52 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|