[libcxx-commits] [libcxx] 240e06d - [bootstrap] Allow passing options to sub-builds for all targets

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 21 12:38:23 PDT 2022


Author: Louis Dionne
Date: 2022-03-21T15:38:14-04:00
New Revision: 240e06dfe77feabe38a03cbb1c94875639d0f9ff

URL: https://github.com/llvm/llvm-project/commit/240e06dfe77feabe38a03cbb1c94875639d0f9ff
DIFF: https://github.com/llvm/llvm-project/commit/240e06dfe77feabe38a03cbb1c94875639d0f9ff.diff

LOG: [bootstrap] Allow passing options to sub-builds for all targets

This patch makes it possible to pass a CMake option to one of the runtimes
for all targets being built. Basically, any option that starts with the
name of a runtime project being built will be forwarded as-is to the
sub-build. This is useful for customizing a sub-build for all targets.

Differential Revision: https://reviews.llvm.org/D121822

Added: 
    

Modified: 
    libcxx/utils/ci/run-buildbot
    llvm/runtimes/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index c58c1fa6c84e6..6ba1b149a4708 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -462,7 +462,7 @@ bootstrapping-build)
           -DLLVM_TARGETS_TO_BUILD="host" \
           -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
           -DLLVM_ENABLE_ASSERTIONS=ON \
-          -DRUNTIMES_LIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
+          -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
 
     echo "+++ Running the libc++ and libc++abi tests"
     ${NINJA} -C "${BUILD_DIR}" check-runtimes

diff  --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 9ee124a5616cc..ae2af14f26269 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -340,6 +340,17 @@ function(runtime_register_target name target)
     endforeach()
   endif()
 
+  # If we're passed any option like <project>_FOO, pass it through to the sub-builds.
+  foreach(runtime ${LLVM_ENABLE_RUNTIMES})
+    string(TOUPPER "${runtime}" runtime_upper)
+    foreach(variableName ${variableNames})
+      if (variableName MATCHES "^${runtime_upper}_.+")
+        string(REPLACE ";" "|" escaped_value "${${variableName}}")
+        list(APPEND ${name}_extra_args "-D${variableName}=${escaped_value}")
+      endif()
+    endforeach()
+  endforeach()
+
   if(NOT RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES AND NOT RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES)
     string(REPLACE ";" "|" LLVM_ENABLE_RUNTIMES_PASSTHROUGH "${LLVM_ENABLE_RUNTIMES}")
     list(APPEND ${name}_extra_args -DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES_PASSTHROUGH})


        


More information about the libcxx-commits mailing list