diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index fce36ba2125..740523d6d70 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -1560,10 +1560,10 @@ endfunction() # A function to add a set of lit test suites to be driven through 'check-*' targets. function(add_lit_testsuite target comment) - cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN}) + cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "" "PARAMS;DEPENDS;ARGS" ${ARGN}) # EXCLUDE_FROM_ALL excludes the test ${target} out of check-all. - if(NOT EXCLUDE_FROM_ALL) + if(NOT ARG_EXCLUDE_FROM_CHECK_ALL) # Register the testsuites, params and depends for the global check rule. set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${ARG_UNPARSED_ARGUMENTS}) set_property(GLOBAL APPEND PROPERTY LLVM_LIT_PARAMS ${ARG_PARAMS}) @@ -1582,7 +1582,7 @@ endfunction() function(add_lit_testsuites project directory) if (NOT LLVM_ENABLE_IDE) - cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN}) + cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "" "PARAMS;DEPENDS;ARGS" ${ARGN}) # Search recursively for test directories by assuming anything not # in a directory called Inputs contains tests. @@ -1605,6 +1605,7 @@ function(add_lit_testsuites project directory) string(TOLOWER "${project}${name_dashes}" name_var) add_lit_target("check-${name_var}" "Running lit suite ${lit_suite}" ${lit_suite} + ${EXCLUDE_FROM_CHECK_ALL} PARAMS ${ARG_PARAMS} DEPENDS ${ARG_DEPENDS} ARGS ${ARG_ARGS} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 82d5783f95b..a20608d7fbc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -30,11 +30,6 @@ configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py ) -# Don't include check-llvm into check-all without LLVM_BUILD_TOOLS. -if(NOT LLVM_BUILD_TOOLS) - set(EXCLUDE_FROM_ALL ON) -endif() - # Set the depends list as a variable so that it can grow conditionally. # NOTE: Sync the substitutions in test/lit.cfg when adding to this list. set(LLVM_TEST_DEPENDS @@ -173,13 +168,21 @@ endif() add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS}) set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests") +if(LLVM_BUILD_TOOLS) + set(exclude_from_check_all "EXCLUDE_FROM_CHECK_ALL") +else() + set(exclude_from_check_all "") +endif() + add_lit_testsuite(check-llvm "Running the LLVM regression tests" ${CMAKE_CURRENT_BINARY_DIR} + ${exclude_from_check_all} DEPENDS ${LLVM_TEST_DEPENDS} ) set_target_properties(check-llvm PROPERTIES FOLDER "Tests") add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR} + ${exclude_from_check_all} DEPENDS ${LLVM_TEST_DEPENDS} )