CarlosAlbertoEnciso created this revision. CarlosAlbertoEnciso added reviewers: sylvestre.ledru, andrewng, russell.gallop, phosek, beanz. CarlosAlbertoEnciso added projects: All, LLVM, clang. Herald added a subscriber: mgorny. CarlosAlbertoEnciso requested review of this revision. Herald added a subscriber: cfe-commits.
The https://reviews.llvm.org/D53014 added CMAKE_BUILD_TYPE to the list of BOOTSTRAP_DEFAULT_PASSTHROUGH variables. The downside is that both stage-1 and stage-2 configurations are the same. So it is not possible to build different stage configurations. This patch allow explicit bootstrap options to override any passthrough ones. For instance, the following settings would build: stage-1 (Release) and stage-2 (Debug) Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D131755 Files: clang/CMakeLists.txt Index: clang/CMakeLists.txt =================================================================== --- clang/CMakeLists.txt +++ clang/CMakeLists.txt @@ -758,6 +758,19 @@ set(LTO_RANLIB) endif() + # Populate the passthrough variables + foreach(variableName ${CLANG_BOOTSTRAP_PASSTHROUGH} ${_BOOTSTRAP_DEFAULT_PASSTHROUGH}) + if(DEFINED ${variableName}) + if("${${variableName}}" STREQUAL "") + set(value "") + else() + string(REPLACE ";" "|" value "${${variableName}}") + endif() + list(APPEND PASSTHROUGH_VARIABLES + -D${variableName}=${value}) + endif() + endforeach() + # Find all variables that start with BOOTSTRAP_ and populate a variable with # them. get_cmake_property(variableNames VARIABLES) @@ -774,19 +787,6 @@ endif() endforeach() - # Populate the passthrough variables - foreach(variableName ${CLANG_BOOTSTRAP_PASSTHROUGH} ${_BOOTSTRAP_DEFAULT_PASSTHROUGH}) - if(DEFINED ${variableName}) - if("${${variableName}}" STREQUAL "") - set(value "") - else() - string(REPLACE ";" "|" value "${${variableName}}") - endif() - list(APPEND PASSTHROUGH_VARIABLES - -D${variableName}=${value}) - endif() - endforeach() - ExternalProject_Add(${NEXT_CLANG_STAGE} DEPENDS clang-bootstrap-deps PREFIX ${NEXT_CLANG_STAGE}
Index: clang/CMakeLists.txt =================================================================== --- clang/CMakeLists.txt +++ clang/CMakeLists.txt @@ -758,6 +758,19 @@ set(LTO_RANLIB) endif() + # Populate the passthrough variables + foreach(variableName ${CLANG_BOOTSTRAP_PASSTHROUGH} ${_BOOTSTRAP_DEFAULT_PASSTHROUGH}) + if(DEFINED ${variableName}) + if("${${variableName}}" STREQUAL "") + set(value "") + else() + string(REPLACE ";" "|" value "${${variableName}}") + endif() + list(APPEND PASSTHROUGH_VARIABLES + -D${variableName}=${value}) + endif() + endforeach() + # Find all variables that start with BOOTSTRAP_ and populate a variable with # them. get_cmake_property(variableNames VARIABLES) @@ -774,19 +787,6 @@ endif() endforeach() - # Populate the passthrough variables - foreach(variableName ${CLANG_BOOTSTRAP_PASSTHROUGH} ${_BOOTSTRAP_DEFAULT_PASSTHROUGH}) - if(DEFINED ${variableName}) - if("${${variableName}}" STREQUAL "") - set(value "") - else() - string(REPLACE ";" "|" value "${${variableName}}") - endif() - list(APPEND PASSTHROUGH_VARIABLES - -D${variableName}=${value}) - endif() - endforeach() - ExternalProject_Add(${NEXT_CLANG_STAGE} DEPENDS clang-bootstrap-deps PREFIX ${NEXT_CLANG_STAGE}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits