[Build System] Replace IMPLICIT_DEPENDS with DEPFILE_Fixes #21203#21346
[Build System] Replace IMPLICIT_DEPENDS with DEPFILE_Fixes #21203#21346DhanashreePetare wants to merge 2 commits intoroot-project:masterfrom
Conversation
| # make the dictionary generation command depend on the C++ standard, ensuring that the | ||
| # dictionaries will be rebuilt if the C++ standard is changed in an incremental build. | ||
| -DR__DUMMY_CXX_STANDARD_${CMAKE_CXX_STANDARD} | ||
| IMPLICIT_DEPENDS ${_implicitdeps} |
There was a problem hiding this comment.
Consider also removing the creation of the _implicitdeps list.
Test Results 22 files 22 suites 3d 6h 12m 37s ⏱️ For more details on these failures, see this check. Results for commit 7da1877. |
|
That is pretty cool! By better tracking of the dictionary dependencies, we'll be able to also avoid some unnecessary rebuilds of the dictionaries later, so this is an important change. @DhanashreePetare, can you please look at the CI failures and fix the implementation also for Windows and Ninja? Thanks! |
cmake/modules/RootMacros.cmake
Outdated
| # NOTE: DEPFILE is used instead of IMPLICIT_DEPENDS because IMPLICIT_DEPENDS | ||
| # only works with Unix Makefiles and has issues with cross-directory dependencies. | ||
| # DEPFILE works with all generators (Ninja, Unix Makefiles, etc.) | ||
| set(depfile_path ${CMAKE_CURRENT_BINARY_DIR}/${dictionary}.d) |
There was a problem hiding this comment.
I wonder if the file ending in .d is leading to it being used 'also' in different context.
|
Were you able to run the test locally successfully? |
This Pull request:
Replaces the broken
IMPLICIT_DEPENDSwith modernDEPFILEsupport inROOT_GENERATE_DICTIONARYmacro to enable cross-generator compatibility and proper dependency tracking.Changes or fixes:
Modified
cmake/modules/RootMacros.cmake:IMPLICIT_DEPENDSusage (only works with Unix Makefiles, broken for cross-directory deps)DEPFILEparameter pointing to${CMAKE_CURRENT_BINARY_DIR}/${dictionary}.d-MF ${depfile_path}flag to rootclingModified
core/dictgen/src/rootcling_impl.cxx:-MFcommand-line option to rootclingImplementation flow:
build/dir/G__Dict.drootcling ... -MF build/dir/G__Dict.dG__Dict.cxx: header1.h header2.h ...Benefits:
References:
Checklist:
This PR fixes #21203