Skip to content

Commit c6bfed1

Browse files
Teemperoramadio
authored andcommitted
Add BUILTINS arg to ROOT_GENERATE_DICTIONARY
Right now rootcling doesn't know if the headers depend on a target that is provided by a BUILTIN. This patch adds a new parameter that allows expressing if thie rootcling invocation depends on a certain BUILTIN in a way that is identical to the ROOT_LINKER_LIBRARY way of handling this.
1 parent 82ecb5f commit c6bfed1

File tree

12 files changed

+26
-17
lines changed

12 files changed

+26
-17
lines changed

cmake/modules/RootNewMacros.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,11 @@ endmacro()
207207

208208
#---------------------------------------------------------------------------------------------------
209209
#---ROOT_GENERATE_DICTIONARY( dictionary headerfiles MODULE module DEPENDENCIES dep1 dep2
210+
# BUILTINS dep1 dep2
210211
# STAGE1 LINKDEF linkdef OPTIONS opt1 opt2 ...)
211212
#---------------------------------------------------------------------------------------------------
212213
function(ROOT_GENERATE_DICTIONARY dictionary)
213-
CMAKE_PARSE_ARGUMENTS(ARG "STAGE1;MULTIDICT;NOINSTALL" "MODULE" "LINKDEF;OPTIONS;DEPENDENCIES" ${ARGN})
214+
CMAKE_PARSE_ARGUMENTS(ARG "STAGE1;MULTIDICT;NOINSTALL" "MODULE" "LINKDEF;OPTIONS;DEPENDENCIES;BUILTINS" ${ARGN})
214215

215216
# Check if OPTIONS start with a dash.
216217
if (ARG_OPTIONS)
@@ -404,6 +405,14 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
404405
DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
405406
endif()
406407
endif()
408+
409+
if(ARG_BUILTINS)
410+
foreach(arg1 ${ARG_BUILTINS})
411+
if(${arg1}_TARGET)
412+
add_dependencies(${dictname} ${${arg1}_TARGET})
413+
endif()
414+
endforeach()
415+
endif()
407416
# FIXME: Support mulptiple dictionaries. In some cases (libSMatrix and
408417
# libGenVector) we have to have two or more dictionaries (eg. for math,
409418
# we need the two for double vs Double32_t template specializations).

core/imt/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(sources base.cxx)
66

77
if (imt)
88
set(headers ROOT/TPoolManager.hxx ROOT/TThreadExecutor.hxx)
9-
ROOT_GENERATE_DICTIONARY(G__Imt ${headers} STAGE1 MODULE Imt LINKDEF LinkDef.h DEPENDENCIES Core Thread) # For auto{loading,parsing}
9+
ROOT_GENERATE_DICTIONARY(G__Imt ${headers} STAGE1 MODULE Imt LINKDEF LinkDef.h DEPENDENCIES Core Thread BUILTINS TBB) # For auto{loading,parsing}
1010
set(sources ${sources} TImplicitMT.cxx TThreadExecutor.cxx TPoolManager.cxx G__Imt.cxx)
1111
endif()
1212

graf2d/asimage/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endif()
1010
#---Build ASImage/ASImageGui libraries---------------------------------------
1111
include_directories(${FREETYPE_INCLUDE_DIRS} ${AFTERIMAGE_INCLUDE_DIR} ${X11_INCLUDE_DIR})
1212

13-
ROOT_GENERATE_DICTIONARY(G__ASImage TASImage.h TASImagePlugin.h TASPluginGS.h MODULE ASImage LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Graf)
13+
ROOT_GENERATE_DICTIONARY(G__ASImage TASImage.h TASImagePlugin.h TASPluginGS.h MODULE ASImage LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Graf BUILTINS AFTERIMAGE)
1414

1515
ROOT_LINKER_LIBRARY(ASImage TASImage.cxx TASPluginGS.cxx G__ASImage.cxx
1616
LIBRARIES Core ${AFTERIMAGE_LIBRARIES} ${FREETYPE_LIBRARIES} ${ASEXTRA_LIBRARIES} ${X11_LIBRARIES}

graf2d/fitsio/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
include_directories(${CFITSIO_INCLUDE_DIR})
77

8-
ROOT_GENERATE_DICTIONARY(G__FITSIO *.h MODULE FITSIO LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Hist Gpad Graf)
8+
ROOT_GENERATE_DICTIONARY(G__FITSIO *.h MODULE FITSIO LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Hist Gpad Graf BUILTINS CFITSIO)
99

1010
ROOT_LINKER_LIBRARY(FITSIO *.cxx G__FITSIO.cxx LIBRARIES ${CFITSIO_LIBRARIES} DEPENDENCIES Hist Gpad Graf Matrix BUILTINS CFITSIO)
1111

graf2d/graf/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# @author Pere Mato, CERN
44
############################################################################
55

6-
ROOT_GENERATE_DICTIONARY(G__Graf MODULE Graf *.h LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Hist Matrix MathCore RIO)
6+
ROOT_GENERATE_DICTIONARY(G__Graf MODULE Graf *.h LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Hist Matrix MathCore RIO BUILTINS FREETYPE)
77

88

99
include_directories(${FREETYPE_INCLUDE_DIRS})

math/fftw/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
include_directories(${FFTW_INCLUDE_DIR})
77

8-
ROOT_GENERATE_DICTIONARY(G__FFTW *.h MODULE FFTW LINKDEF LinkDef.h DEPENDENCIES Core)
8+
ROOT_GENERATE_DICTIONARY(G__FFTW *.h MODULE FFTW LINKDEF LinkDef.h DEPENDENCIES Core BUILTINS FFTW3)
99

1010
ROOT_LINKER_LIBRARY(FFTW *.cxx G__FFTW.cxx LIBRARIES Core ${FFTW_LIBRARIES} BUILTINS FFTW3)
1111

math/mathcore/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ set(MATHCORE_HEADERS TRandom.h
1717
Math/MersenneTwisterEngine.h Math/MixMaxEngine.h TRandomGen.h Math/LCGEngine.h
1818
)
1919

20-
ROOT_GENERATE_DICTIONARY(G__MathCore TComplex.h TMath.h ${MATHCORE_HEADERS} Fit/*.h MODULE MathCore LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Core Imt)
20+
if(veccore)
21+
set(MATHCORE_LIBRARIES ${VecCore_LIBRARIES})
22+
set(MATHCORE_BUILTINS VECCORE)
23+
endif()
24+
25+
ROOT_GENERATE_DICTIONARY(G__MathCore TComplex.h TMath.h ${MATHCORE_HEADERS} Fit/*.h MODULE MathCore LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Core Imt BUILTINS ${MATHCORE_BUILTINS})
2126

2227
add_definitions(-DUSE_ROOT_ERROR)
2328
ROOT_ADD_C_FLAG(_flags -Wno-strict-overflow) # Avoid what it seems a compiler false positive warning
@@ -30,11 +35,6 @@ if(imt)
3035
set(MATHCORE_DEPENDENCIES Imt)
3136
endif()
3237

33-
if(veccore)
34-
set(MATHCORE_LIBRARIES ${VecCore_LIBRARIES})
35-
set(MATHCORE_BUILTINS VECCORE)
36-
endif()
37-
3838
ROOT_LINKER_LIBRARY(MathCore *.cxx *.c G__MathCore.cxx LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ${MATHCORE_LIBRARIES} DEPENDENCIES Core ${MATHCORE_DEPENDENCIES} BUILTINS ${MATHCORE_BUILTINS})
3939

4040
if(veccore)

math/mathmore/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set(headers Math/DistFuncMathMore.h Math/SpecFuncMathMore.h Math/PdfFuncMathMore
1919
Math/VavilovAccurateCdf.h Math/VavilovAccurateQuantile.h Math/VavilovFast.h )
2020
set(linkdefs Math/LinkDef.h Math/LinkDef_Func.h Math/LinkDef_RootFinding.h)
2121

22-
ROOT_GENERATE_DICTIONARY(G__MathMore ${headers} MODULE MathMore LINKDEF Math/LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES MathCore)
22+
ROOT_GENERATE_DICTIONARY(G__MathMore ${headers} MODULE MathMore LINKDEF Math/LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES MathCore BUILTINS GSL)
2323

2424
ROOT_LINKER_LIBRARY(MathMore *.cxx G__MathMore.cxx LIBRARIES ${GSL_LIBRARIES} DEPENDENCIES MathCore BUILTINS GSL)
2525

net/davix/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ROOT_ADD_CXX_FLAG(CMAKE_CXX_FLAGS -Wno-unused-parameter)
1111
ROOT_ADD_CXX_FLAG(CMAKE_CXX_FLAGS -Wno-deprecated-declarations) # Davix getAllReplicas
1212

1313

14-
ROOT_GENERATE_DICTIONARY(G__DAVIX *.h MODULE RDAVIX LINKDEF LinkDef.h DEPENDENCIES RIO Net)
14+
ROOT_GENERATE_DICTIONARY(G__DAVIX *.h MODULE RDAVIX LINKDEF LinkDef.h DEPENDENCIES RIO Net BUILTINS DAVIX)
1515

1616
ROOT_LINKER_LIBRARY(RDAVIX *.cxx G__DAVIX.cxx LIBRARIES ${DAVIX_LIBRARIES} ${OPENSSL_LIBRARIES} ${LIBXML2_LIBRARIES} ${SYSLIBS} DEPENDENCIES RIO Net BUILTINS DAVIX)
1717

net/net/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if(MACOSX_SSL_DEPRECATED)
2727
set_source_files_properties(src/TSSLSocket.cxx COMPILE_FLAGS "-Wno-deprecated-declarations" )
2828
endif()
2929

30-
ROOT_GENERATE_DICTIONARY(G__Net ${headers} MODULE Net LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES RIO)
30+
ROOT_GENERATE_DICTIONARY(G__Net ${headers} MODULE Net LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES RIO BUILTINS OPENSSL)
3131

3232
ROOT_LINKER_LIBRARY(Net ${sources} G__Net.cxx LIBRARIES ${ssllib} ${CRYPTLIBS} DEPENDENCIES RIO BUILTINS OPENSSL)
3333

0 commit comments

Comments
 (0)