File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,9 @@ set(RUN_TESTS_ARGS -p "${CMAKE_CURRENT_SOURCE_DIR}/testfiles" -w "${CMAKE_CURREN
162162if (META_TEST_TARGET_IS_MANUAL)
163163 list (APPEND TEST_TARGET_OPTIONS MANUAL)
164164endif ()
165+ if (META_TEST_REQUIRE_MAIN_TARGET)
166+ list (APPEND TEST_TARGET_OPTIONS REQUIRES_MAIN_TARGET)
167+ endif ()
165168configure_test_target(
166169 TARGET_NAME
167170 "${META_TARGET_NAME} "
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ option(EXCLUDE_TESTS_FROM_ALL "specifies whether to exclude tests from the 'all'
1818
1919function (configure_test_target)
2020 # parse arguments
21- set (OPTIONAL_ARGS MANUAL)
21+ set (OPTIONAL_ARGS MANUAL REQUIRES_MAIN_TARGET )
2222 set (ONE_VALUE_ARGS TARGET_NAME TEST_NAME FULL_TEST_NAME_OUT_VAR)
2323 set (MULTI_VALUE_ARGS HEADER_FILES SRC_FILES LIBRARIES RUN_ARGS)
2424 cmake_parse_arguments (ARGS "${OPTIONAL_ARGS} " "${ONE_VALUE_ARGS} " "${MULTI_VALUE_ARGS} " ${ARGN} )
@@ -89,5 +89,8 @@ function (configure_test_target)
8989 # add the test executable to the dependencies of the check target
9090 if (NOT ARGS_MANUAL AND TARGET check)
9191 add_dependencies (check ${TEST_TARGET_NAME} )
92+ if (ARGS_REQUIRES_MAIN_TARGET)
93+ add_dependencies (check "${META_TARGET_NAME} " )
94+ endif ()
9295 endif ()
9396endfunction ()
You can’t perform that action at this time.
0 commit comments