Skip to content
Snippets Groups Projects
Commit a9d16ccc authored by Raphael Isemann's avatar Raphael Isemann Committed by Guilherme Amadio
Browse files

Add ROOTCLING_ targets that allow more parallel rootcling invocations.

So far GENERATE_DICTIONARY depends on all the targets passed to its
DEPENDENCIES argument. However, this means for some targets not
only the generation of PCMs, rootmaps etc, but also the linking of
this target (as for example the target `Hist` generates Hist.pcm
and then also links libHist.so). We only care about the files
generated by rootcling when we specify the dependencies here,
so we can improve build performance here.

This patch creates a new target for each dictionary generation
command called ROOTCLING_{MODULE} which can be refernced by other
rootcling invocations to state that they depend on the
rootcling files (PCMs, rootmap, root-PCMs) of this module, but
not on a fully built module. We then start checking for each
dependency passed to GENERATE_DICTIONARY if there is a
ROOTCLING_MODULE target and depend on this if possible.

This should cause that all the rootcling invocations can be
started earlier and the linking of modules and rootcling
invocations of its dependencies now run in parallel.
parent c6bfed1a
Branches
Tags
No related merge requests found
......@@ -380,6 +380,16 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
if (cxxmodules)
set(genverbosity "-v2")
endif(cxxmodules)
set(module_dependencies "")
foreach(dep ${ARG_DEPENDENCIES})
if(TARGET ROOTCLING_${dep})
set(module_dependencies ${module_dependencies} ROOTCLING_${dep})
else()
set(module_dependencies ${module_dependencies} ${dep})
endif()
endforeach()
#---call rootcint------------------------------------------
add_custom_command(OUTPUT ${dictionary}.cxx ${pcm_name} ${rootmap_name}
COMMAND ${command} ${genverbosity} -f ${dictionary}.cxx ${newargs} ${excludepathsargs} ${rootmapargs}
......@@ -405,6 +415,20 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
endif()
endif()
# Create a target for this rootcling invocation based on the module name.
# We can use this in other ROOT_GENERATE_DICTIONARY that only care about
# the generation of PCMs without waiting on the whole module.
if(ARG_MODULE)
# If we have multiple modules with the same name, let's just attach the
# generation of this dictionary to the ROOTCLING_X target of the existing
# module. This happens for example with ROOTCLING_Smatrix which also comes
# in a "Smatrix32" version.
if (TARGET ROOTCLING_${ARG_MODULE})
add_dependencies(ROOTCLING_${ARG_MODULE} ${dictname})
else()
add_custom_target(ROOTCLING_${ARG_MODULE} DEPENDS ${dictname})
endif()
endif()
if(ARG_BUILTINS)
foreach(arg1 ${ARG_BUILTINS})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment