diff options
author | Zachary Turner <zturner@google.com> | 2017-09-19 17:19:10 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-09-19 17:19:10 +0000 |
commit | 7a87049e4788a7967babdab30039aa41a8afd002 (patch) | |
tree | c54b3b16f7f1c1bf54e2c4750f0dcd473c462fc6 | |
parent | 81306615ac5058533f1dfa76acc5d88651688277 (diff) |
Resubmit "Fix llvm-lit script generation in libcxx."
After speaking with the libcxx owners, they agreed that this is
a bug in the bot that needs to be fixed by the bot owners, and
the CMake changes are correct.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313643 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | cmake/Modules/HandleOutOfTreeLLVM.cmake | 5 | ||||
-rw-r--r-- | test/CMakeLists.txt | 5 |
3 files changed, 17 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e402dae66..f2b7f83dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -653,6 +653,7 @@ endif() # # However, since some submission systems strip test/ subdirectories, check for # it before adding it. + if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test") add_subdirectory(test) endif() @@ -660,6 +661,15 @@ if (LIBCXX_INCLUDE_TESTS) add_subdirectory(lib/abi) endif() +if (LIBCXX_STANDALONE_BUILD AND EXISTS "${LLVM_MAIN_SRC_DIR}/utils/llvm-lit") + # Make sure the llvm-lit script is generated into the bin directory, and do + # it after adding all tests, since the generated script will only work + # correctly discovered tests against test locations from the source tree that + # have already been discovered. + add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit + ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit) +endif() + if (LIBCXX_INCLUDE_DOCS) add_subdirectory(docs) endif() diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake index 879882dcf..b724bf69f 100644 --- a/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -106,6 +106,11 @@ macro(configure_out_of_tree_llvm) set(LLVM_ENABLE_SPHINX OFF) endif() + # In a standalone build, we don't have llvm to automatically generate the + # llvm-lit script for us. So we need to provide an explicit directory that + # the configurator should write the script into. + set(LLVM_LIT_OUTPUT_DIR "${libcxx_BINARY_DIR}/bin") + # Required LIT Configuration ------------------------------------------------ # Define the default arguments to use with 'lit', and an option for the user # to override. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7b8a8322a..4c8ca8f6e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -49,10 +49,9 @@ set(LIBCXX_EXECUTOR "None" CACHE STRING set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!") -configure_file( +configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg - @ONLY) + ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) set(LIBCXX_TEST_DEPS "") |