aboutsummaryrefslogtreecommitdiff
path: root/llvm/runtimes
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2022-03-30 12:07:41 -0700
committerPetr Hosek <phosek@google.com>2022-03-31 00:49:35 -0700
commitd6623d72461b5a1ed3bd3ac966d14329e5b0f851 (patch)
tree0e37c641e1ba7930340995c62ca7257fd53653de /llvm/runtimes
parentaaf6608441d7ec084e2c05447aeab8cb357cab9a (diff)
downloadllvm-d6623d72461b5a1ed3bd3ac966d14329e5b0f851.zip
llvm-d6623d72461b5a1ed3bd3ac966d14329e5b0f851.tar.gz
llvm-d6623d72461b5a1ed3bd3ac966d14329e5b0f851.tar.bz2
[runtimes] Create Tests.cmake if it does not exist
This is necessary so that Tests.cmake is always included in the generated build file and any changes made by subbuilds are detected without needing to rerun CMake. This is equivalent to an earlier version of D121647. Differential Revision: https://reviews.llvm.org/D121647
Diffstat (limited to 'llvm/runtimes')
-rw-r--r--llvm/runtimes/CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 9ee124a..f4c4869 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -220,7 +220,11 @@ function(runtime_default_target)
endforeach()
if(LLVM_INCLUDE_TESTS)
- include(${LLVM_BINARY_DIR}/runtimes/Tests.cmake OPTIONAL)
+ if (NOT EXISTS ${LLVM_BINARY_DIR}/runtimes/Tests.cmake)
+ # This file will be later replaced by the runtimes subbuild.
+ file(TOUCH ${LLVM_BINARY_DIR}/runtimes/Tests.cmake)
+ endif()
+ include(${LLVM_BINARY_DIR}/runtimes/Tests.cmake)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/Tests.cmake)
set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${SUB_LIT_TESTSUITES})
set_property(GLOBAL APPEND PROPERTY LLVM_LIT_PARAMS ${SUB_LIT_PARAMS})
@@ -302,7 +306,11 @@ function(runtime_register_target name target)
endforeach()
if(LLVM_INCLUDE_TESTS)
- include(${LLVM_BINARY_DIR}/runtimes/${name}/Tests.cmake OPTIONAL)
+ if (NOT EXISTS ${LLVM_BINARY_DIR}/runtimes/Tests.cmake)
+ # This file will be later replaced by the runtimes subbuild.
+ file(TOUCH ${LLVM_BINARY_DIR}/runtimes/Tests.cmake)
+ endif()
+ include(${LLVM_BINARY_DIR}/runtimes/Tests.cmake)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${LLVM_BINARY_DIR}/runtimes/${name}/Tests.cmake)
set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${SUB_LIT_TESTSUITES})
set_property(GLOBAL APPEND PROPERTY LLVM_LIT_PARAMS ${SUB_LIT_PARAMS})