diff options
author | Petr Hosek <phosek@google.com> | 2022-03-30 12:07:41 -0700 |
---|---|---|
committer | Petr Hosek <phosek@google.com> | 2022-03-31 00:49:35 -0700 |
commit | d6623d72461b5a1ed3bd3ac966d14329e5b0f851 (patch) | |
tree | 0e37c641e1ba7930340995c62ca7257fd53653de /llvm/runtimes | |
parent | aaf6608441d7ec084e2c05447aeab8cb357cab9a (diff) | |
download | llvm-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.txt | 12 |
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}) |