From a674c2c05c9a16ce7ba40c898ab1e6ebf673b991 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 31 Aug 2026 17:57:07 +0200 Subject: [PATCH 1/7] [cmake] Make explicit that all dictionaries depends on Core.pcm By pcanal They depend on it implicitly and not expressing leads to missing rebuilds as seen at: root-project#23046 when no ARG_DEPENDENCIES are specified at all --- cmake/modules/RootMacros.cmake | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 858a0e550dbb2..0bdd43ed00d66 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -621,21 +621,20 @@ function(ROOT_GENERATE_DICTIONARY dictionary) endif() #---Get the library and module dependencies----------------- - if(ARG_DEPENDENCIES) - foreach(dep ${ARG_DEPENDENCIES}) - # Whether provides a dictionary/pcm is decided at generation time - # via $>, so the '-m' flag and the module-file - # dependency below are independent of configuration order and expand to - # nothing for a dictionary-less library. - set(dep_has_dict "$") - set(dependent_pcm ${libprefix}${dep}_rdict.pcm) - if (runtime_cxxmodules AND NOT dep IN_LIST local_no_cxxmodules) - set(dependent_pcm ${dep}.pcm) - list(APPEND pcm_dependencies "$<${dep_has_dict}:$>") - endif() - set(newargs ${newargs} "$<${dep_has_dict}:-m>" "$<${dep_has_dict}:${dependent_pcm}>") - endforeach() - endif() + + foreach(dep Core ${ARG_DEPENDENCIES}) + # Whether provides a dictionary/pcm is decided at generation time + # via $>, so the '-m' flag and the module-file + # dependency below are independent of configuration order and expand to + # nothing for a dictionary-less library. + set(dep_has_dict "$") + set(dependent_pcm ${libprefix}${dep}_rdict.pcm) + if (runtime_cxxmodules AND NOT dep IN_LIST local_no_cxxmodules) + set(dependent_pcm ${dep}.pcm) + list(APPEND pcm_dependencies "$<${dep_has_dict}:$>") + endif() + set(newargs ${newargs} "$<${dep_has_dict}:-m>" "$<${dep_has_dict}:${dependent_pcm}>") + endforeach() if(cpp_module_file) set(newargs -cxxmodule ${newargs}) From 501a7c6f696a366e090935bb8d705152d93cfe43 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 31 Aug 2026 17:58:02 +0200 Subject: [PATCH 2/7] [nfc] stray newline --- cmake/modules/RootMacros.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 0bdd43ed00d66..bd3d49760df01 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -621,7 +621,6 @@ function(ROOT_GENERATE_DICTIONARY dictionary) endif() #---Get the library and module dependencies----------------- - foreach(dep Core ${ARG_DEPENDENCIES}) # Whether provides a dictionary/pcm is decided at generation time # via $>, so the '-m' flag and the module-file From 8493d69eeb246add045e3ffed8006cd0b4e903d8 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 31 Aug 2026 19:02:55 +0200 Subject: [PATCH 3/7] [cmake] avoid circular dependency --- cmake/modules/RootMacros.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index bd3d49760df01..d7cfecd960d04 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -499,7 +499,11 @@ function(ROOT_GENERATE_DICTIONARY dictionary) list(APPEND incdirs ${CMAKE_CURRENT_SOURCE_DIR}/inc) endif() - foreach(dep ${ARG_DEPENDENCIES}) + set(ALL_DEPENDENCIES ${ARG_DEPENDENCIES}) + if(NOT dictionary STREQUAL "G__Core" AND NOT "Core" IN_LIST ALL_DEPENDENCIES) + set(ALL_DEPENDENCIES Core ${ARG_DEPENDENCIES}) + endif() + foreach(dep ${ALL_DEPENDENCIES}) if(TARGET ${dep}) get_target_property(dep_include_dirs ${dep} INTERFACE_INCLUDE_DIRECTORIES) if (NOT dep_include_dirs) From 58fc8beeb2ab56e3832b54718d2f61ebe075cc41 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 31 Aug 2026 19:04:29 +0200 Subject: [PATCH 4/7] [cmake] fix placement --- cmake/modules/RootMacros.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index d7cfecd960d04..89b54c7378db4 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -499,11 +499,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) list(APPEND incdirs ${CMAKE_CURRENT_SOURCE_DIR}/inc) endif() - set(ALL_DEPENDENCIES ${ARG_DEPENDENCIES}) - if(NOT dictionary STREQUAL "G__Core" AND NOT "Core" IN_LIST ALL_DEPENDENCIES) - set(ALL_DEPENDENCIES Core ${ARG_DEPENDENCIES}) - endif() - foreach(dep ${ALL_DEPENDENCIES}) + foreach(dep ${ARG_DEPENDENCIES}) if(TARGET ${dep}) get_target_property(dep_include_dirs ${dep} INTERFACE_INCLUDE_DIRECTORIES) if (NOT dep_include_dirs) @@ -625,7 +621,11 @@ function(ROOT_GENERATE_DICTIONARY dictionary) endif() #---Get the library and module dependencies----------------- - foreach(dep Core ${ARG_DEPENDENCIES}) + set(ALL_DEPENDENCIES ${ARG_DEPENDENCIES}) + if(NOT dictionary STREQUAL "G__Core" AND NOT "Core" IN_LIST ALL_DEPENDENCIES) + set(ALL_DEPENDENCIES Core ${ARG_DEPENDENCIES}) # Add extra implicit dependency on Core + endif() + foreach(dep Core ${ALL_DEPENDENCIES}) # Whether provides a dictionary/pcm is decided at generation time # via $>, so the '-m' flag and the module-file # dependency below are independent of configuration order and expand to From 0fbdad77fdb16b93085dff470e87e938569f6ea0 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 31 Aug 2026 19:12:25 +0200 Subject: [PATCH 5/7] remnant --- cmake/modules/RootMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 89b54c7378db4..2acca8fef343e 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -625,7 +625,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) if(NOT dictionary STREQUAL "G__Core" AND NOT "Core" IN_LIST ALL_DEPENDENCIES) set(ALL_DEPENDENCIES Core ${ARG_DEPENDENCIES}) # Add extra implicit dependency on Core endif() - foreach(dep Core ${ALL_DEPENDENCIES}) + foreach(dep ${ALL_DEPENDENCIES}) # Whether provides a dictionary/pcm is decided at generation time # via $>, so the '-m' flag and the module-file # dependency below are independent of configuration order and expand to From 46f9babcc623322fe7193ba4650ff20cc58d3074 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 31 Aug 2026 19:53:21 +0200 Subject: [PATCH 6/7] Update cmake/modules/RootMacros.cmake Co-authored-by: Philippe Canal --- cmake/modules/RootMacros.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 2acca8fef343e..59836eae200a5 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -621,9 +621,10 @@ function(ROOT_GENERATE_DICTIONARY dictionary) endif() #---Get the library and module dependencies----------------- - set(ALL_DEPENDENCIES ${ARG_DEPENDENCIES}) - if(NOT dictionary STREQUAL "G__Core" AND NOT "Core" IN_LIST ALL_DEPENDENCIES) - set(ALL_DEPENDENCIES Core ${ARG_DEPENDENCIES}) # Add extra implicit dependency on Core + # Every dictionary implicitly depends on Core's pcm, except the one for Core itself. + if(ARG_MODULE AND NOT ARG_MODULE STREQUAL "Core") + list(INSERT ARG_DEPENDENCIES 0 Core) + list(REMOVE_DUPLICATES ARG_DEPENDENCIES) endif() foreach(dep ${ALL_DEPENDENCIES}) # Whether provides a dictionary/pcm is decided at generation time From 9e39f7f14a48d4e34e76d03101f20ba888f96518 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 31 Aug 2026 19:53:52 +0200 Subject: [PATCH 7/7] Apply suggestion from @ferdymercury --- cmake/modules/RootMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 59836eae200a5..74c42bfd659de 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -626,7 +626,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) list(INSERT ARG_DEPENDENCIES 0 Core) list(REMOVE_DUPLICATES ARG_DEPENDENCIES) endif() - foreach(dep ${ALL_DEPENDENCIES}) + foreach(dep ${ARG_DEPENDENCIES}) # Whether provides a dictionary/pcm is decided at generation time # via $>, so the '-m' flag and the module-file # dependency below are independent of configuration order and expand to