Author: zturner Date: Wed Sep 20 09:01:50 2017 New Revision: 313763 URL: http://llvm.org/viewvc/llvm-project?rev=313763&view=rev Log: Make libcxx tests work when llvm sources are not present.
Despite a strong CMake warning that this is an unsupported libcxx build configuration, some bots still rely on being able to check out lit and libcxx independently with no LLVM sources, and then run lit against libcxx. A previous patch broke that workflow, so this is making it work again. Unfortunately, it breaks generation of the llvm-lit script for libcxx, but we will just have to live with that until a solution is found that allows libcxx to make more use of llvm build pieces. libcxx can still run tests by using the ninja check target, or by running lit.py directly against the build tree or source tree. Differential Revision: https://reviews.llvm.org/D38057 Modified: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake Modified: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake?rev=313763&r1=313762&r2=313763&view=diff ============================================================================== --- libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake (original) +++ libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake Wed Sep 20 09:01:50 2017 @@ -111,14 +111,17 @@ macro(configure_out_of_tree_llvm) # 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. - set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported") - if (MSVC OR XCODE) - set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar") + if (LLVM_INCLUDE_TESTS) + # Required LIT Configuration ------------------------------------------------ + # Define the default arguments to use with 'lit', and an option for the user + # to override. + set(LLVM_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py") + set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported") + if (MSVC OR XCODE) + set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar") + endif() + set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") endif() - set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") # Required doc configuration if (LLVM_ENABLE_SPHINX) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits