Skip to content

Commit f215e1f

Browse files
committed
[CMake] Don't wrap command in ROOTTEST_COMPILE_MACRO in CMake target
Wrapping to command inside a Cmake target doesn't seem to be necessary, because in the test, the target is forced to be built without dependencies anyway (e.g. `cmake --build . --target my_macro_test/fast --always-make` when using makefiles). This fixes spurious project rebuilds when running the macro tests when using ninja without forcing to run the test in serial mode.
1 parent a3f6b68 commit f215e1f

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

cmake/modules/RootMacros.cmake

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,36 +2340,18 @@ macro(ROOTTEST_COMPILE_MACRO filename)
23402340
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
23412341
23422342
if(ARG_DEPENDS)
2343-
set(deps ${ARG_DEPENDS})
2343+
message(WARNING "Specifying DEPENDS in ROOTTEST_COMPILE_MACRO has no effect.")
23442344
endif()
23452345
23462346
ROOTTEST_TARGETNAME_FROM_FILE(COMPILE_MACRO_TEST ${filename})
23472347
2348-
set(compile_target ${COMPILE_MACRO_TEST}-compile-macro)
2349-
2350-
add_custom_target(${compile_target}
2351-
COMMAND ${compile_macro_command}
2352-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
2353-
VERBATIM)
2354-
2355-
if(ARG_DEPENDS)
2356-
add_dependencies(${compile_target} ${deps})
2357-
endif()
2358-
23592348
set(COMPILE_MACRO_TEST ${COMPILE_MACRO_TEST}-build)
23602349
2361-
add_test(NAME ${COMPILE_MACRO_TEST}
2362-
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}
2363-
${build_config}
2364-
--target ${compile_target}${fast}
2365-
-- ${always-make})
2350+
add_test(NAME ${COMPILE_MACRO_TEST} COMMAND ${compile_macro_command})
23662351
if(NOT MSVC OR win_broken_tests)
23672352
set_property(TEST ${COMPILE_MACRO_TEST} PROPERTY FAIL_REGULAR_EXPRESSION "Warning in")
23682353
endif()
23692354
set_property(TEST ${COMPILE_MACRO_TEST} PROPERTY ENVIRONMENT ${ROOTTEST_ENVIRONMENT})
2370-
if(CMAKE_GENERATOR MATCHES Ninja AND NOT MSVC)
2371-
set_property(TEST ${COMPILE_MACRO_TEST} PROPERTY RUN_SERIAL true)
2372-
endif()
23732355
if (ARG_FIXTURES_SETUP)
23742356
set_property(TEST ${COMPILE_MACRO_TEST} PROPERTY
23752357
FIXTURES_SETUP ${ARG_FIXTURES_SETUP})

0 commit comments

Comments
 (0)