summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbc87510de..bddc25034b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -652,6 +652,36 @@ if (CLANG_ENABLE_BOOTSTRAP)
set(verbose -DCMAKE_VERBOSE_MAKEFILE=On)
endif()
+ set(BOOTSTRAP_DEFAULT_PASSTHROUGH
+ PACKAGE_VERSION
+ LLVM_VERSION_MAJOR
+ LLVM_VERSION_MINOR
+ LLVM_VERSION_PATCH
+ LLVM_VERSION_SUFFIX
+ CLANG_REPOSITORY_STRING
+ CMAKE_MAKE_PROGRAM)
+
+ # Find all variables that start with BOOTSTRAP_ and populate a variable with
+ # them.
+ get_cmake_property(variableNames VARIABLES)
+ foreach(varaibleName ${variableNames})
+ if(varaibleName MATCHES "^BOOTSTRAP_")
+ string(SUBSTRING ${varaibleName} 10 -1 varName)
+ string(REPLACE ";" "\;" value "${${varaibleName}}")
+ list(APPEND PASSTHROUGH_VARIABLES
+ -D${varName}=${value})
+ endif()
+ endforeach()
+
+ # Populate the passthrough variables
+ foreach(varaibleName ${CLANG_BOOTSTRAP_PASSTHROUGH} ${BOOTSTRAP_DEFAULT_PASSTHROUGH})
+ if(${varaibleName})
+ string(REPLACE ";" "\;" value ${${varaibleName}})
+ list(APPEND PASSTHROUGH_VARIABLES
+ -D${varaibleName}=${value})
+ endif()
+ endforeach()
+
ExternalProject_Add(bootstrap
DEPENDS clang ${LTO_DEP}
PREFIX bootstrap
@@ -664,6 +694,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
# seem to work, so instead I'm passing this through
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
${CLANG_BOOTSTRAP_CMAKE_ARGS}
+ ${PASSTHROUGH_VARIABLES}
-DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++
-DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
-DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang