summaryrefslogtreecommitdiff
path: root/runtimes
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2022-08-18 08:25:13 +0000
committerPetr Hosek <phosek@google.com>2022-10-12 08:01:19 +0000
commit2a66abb17ed373d08a2193a9f24820b07b459965 (patch)
tree603e31567c3a64dd01e516531baf17ac6f2e5ca8 /runtimes
parenta4ace22c05c423194da79e68b0852496fb9ff11e (diff)
downloadllvm-2a66abb17ed373d08a2193a9f24820b07b459965.tar.gz
[runtimes] Use a response file for runtimes test suites
We don't know which test suites are going to be included by runtimes builds so we cannot include those before running the sub-build, but that's not possible during the LLVM build configuration. We instead use a response file that's populated by the runtimes build as a level of indirection. This addresses the issue described in: https://discourse.llvm.org/t/cmake-regeneration-is-broken/62788 Differential Revision: https://reviews.llvm.org/D132438
Diffstat (limited to 'runtimes')
-rw-r--r--runtimes/CMakeLists.txt15
-rw-r--r--runtimes/Tests.cmake.in3
2 files changed, 6 insertions, 12 deletions
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 6f59ec661ed2..af1e3dbb8223 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -244,15 +244,12 @@ if(LLVM_INCLUDE_TESTS)
${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
endif()
- if(LLVM_RUNTIMES_TARGET)
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/Tests.cmake.in
- ${LLVM_BINARY_DIR}/runtimes/${LLVM_RUNTIMES_TARGET}/Tests.cmake)
- else()
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/Tests.cmake.in
- ${LLVM_BINARY_DIR}/runtimes/Tests.cmake)
- endif()
+ get_property(LLVM_RUNTIMES_LIT_TESTSUITES GLOBAL PROPERTY LLVM_RUNTIMES_LIT_TESTSUITES)
+ string(REPLACE ";" "\n" LLVM_RUNTIMES_LIT_TESTSUITES "${LLVM_RUNTIMES_LIT_TESTSUITES}")
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lit.tests ${LLVM_RUNTIMES_LIT_TESTSUITES})
+else()
+ # Create empty files so the parent build can use these unconditionally.
+ file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/lit.tests)
endif()
get_property(SUB_COMPONENTS GLOBAL PROPERTY SUB_COMPONENTS)
diff --git a/runtimes/Tests.cmake.in b/runtimes/Tests.cmake.in
deleted file mode 100644
index 8108349bec41..000000000000
--- a/runtimes/Tests.cmake.in
+++ /dev/null
@@ -1,3 +0,0 @@
-set(SUB_LIT_TESTSUITES @LLVM_RUNTIMES_LIT_TESTSUITES@)
-set(SUB_LIT_PARAMS @LLVM_RUNTIMES_LIT_PARAMS@)
-set(SUB_LIT_EXTRA_ARGS @LLVM_RUNTIMES_LIT_EXTRA_ARGS@)