Skip to content

Commit 94f401c

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, with "dirty" CMake code in the source directory.
1 parent bf0ebb6 commit 94f401c

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

cmake/modules/RootMacros.cmake

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,29 +2340,14 @@ 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()

0 commit comments

Comments
 (0)