-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CMake] Don't wrap command in ROOTTEST_COMPILE_MACRO
in CMake target
#19780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Test Results 20 files 20 suites 3d 15h 7m 57s ⏱️ For more details on these failures, see this check. Results for commit c4ce0be. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 is only partially true, for Unix Makefiles
. With Ninja
, we don't use /fast
nor --always-make
AFAICT
The intention of the original macro is apparently to only build this one target that runs the command. The fact that this was not done correctly for Ninja doesn't mean that rebuilding all dependencies was the intended behavior. I suppose it was just not correctly implemented. |
94f401c
to
f215e1f
Compare
@@ -2340,36 +2340,18 @@ macro(ROOTTEST_COMPILE_MACRO filename) | |||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) | |||
|
|||
if(ARG_DEPENDS) | |||
set(deps ${ARG_DEPENDS}) | |||
message(WARNING "Specifying DEPENDS in ROOTTEST_COMPILE_MACRO has no effect.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this warning is never hit. Nowhere in the codebase to we specify DEPENDS
in a ROOTTEST_COMPILE_MACRO
. Together with the dependencies being ignored via the \fast
target when using Makefiles, that makes it clear to me that it was never the intention to have dependencies for these macro tests.
The problem is that even with no dependencies, a re-configuration will still be triggered if the CMake code was changed, which is the reason thy the RUN_SERIAL true
workaround was needed.
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.
f215e1f
to
c4ce0be
Compare
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
whenusing makefiles).
This fixes spurious project rebuilds when running the macro tests when
using ninja without forcing to run the test in serial mode.