[PATCH] D121822: [bootstrap] Allow passing options to sub-builds for all targets
Louis Dionne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 16 09:39:20 PDT 2022
ldionne created this revision.
ldionne added a reviewer: phosek.
Herald added a subscriber: mgorny.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch makes it possible to pass a CMake option to one of the runtimes
for all targets being built by using `RUNTIMES_<project>_<OPTION>`. For
example, one can pass `RUNTIMES_LIBCXX_TEST_CONFIG=<config>` to the
bootstrapping build, and `LIBCXX_TEST_CONFIG=<config>` will be passed
to the runtimes sub-build as a result.
This is useful for customizing a sub-build for all targets. Note that
we could also simply allow passing through options without prefixing
them with `RUNTIMES_` but this tries to be consistent with what already
exists for per-target passthroughs.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121822
Files:
llvm/runtimes/CMakeLists.txt
Index: llvm/runtimes/CMakeLists.txt
===================================================================
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -343,6 +343,19 @@
endforeach()
endif()
+ # If we're passed any option like RUNTIMES_<project>_FOO, pass it through as <project>_FOO.
+ # For example, RUNTIMES_LIBCXX_TEST_CONFIG will be passed down as LIBCXX_TEST_CONFIG.
+ foreach(runtime ${LLVM_ENABLE_RUNTIMES})
+ string(TOUPPER "${runtime}" runtime_upper)
+ foreach(variableName ${variableNames})
+ if (variableName MATCHES "RUNTIMES_${runtime_upper}_.+")
+ string(REPLACE "RUNTIMES_" "" new_name "${variableName}")
+ string(REPLACE ";" "|" new_value "${${variableName}}")
+ list(APPEND ${name}_extra_args "-D${new_name}=${new_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})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121822.415872.patch
Type: text/x-patch
Size: 1139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220316/98a4a4b2/attachment.bin>
More information about the llvm-commits
mailing list