Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[cxxmodules] Unify *32 dictionaries into one
With C++ modules we are supposed to have a unique module name where
each module contains different headers. But smatrix(32) or genvector(32)
currently have the same contents and also the same name. As we
anyway also have a combined LinkDef file for both cases, we just
unify those two dictionaries when using runtime_modules and have
only a single module in the end which has an unique name and
unique contents.
  • Loading branch information
Teemperor committed Sep 4, 2017
commit f2ba925347aa6494c12458621cf11528e65c9d93
18 changes: 14 additions & 4 deletions math/genvector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ set(headers Math/Vector2D.h Math/Point2D.h
Math/Transform3D.h Math/Translation3D.h Math/Plane3D.h
Math/VectorUtil.h)
set(headers32 Math/Vector2D.h Math/Point2D.h
Math/Vector3D.h Math/Point3D.h Math/Vector4D.h)
Math/VectorUtil.h Math/Vector2D.h Math/Point2D.h
Math/Vector3D.h Math/Point3D.h Math/Vector4D.h)

ROOT_GENERATE_DICTIONARY(G__${libname} ${headers} MODULE ${libname} LINKDEF Math/LinkDef_GenVector.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Core)
ROOT_GENERATE_DICTIONARY(G__${libname}32 ${headers32} MULTIDICT MODULE ${libname} LINKDEF Math/LinkDef_GenVector32.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Core)

ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx G__${libname}32.cxx LIBRARIES Core)
if (runtime_cxxmodules)
# With runtime_cxxmodules we have a hard time making two identical modules
# with the same files in them but different LinkDefs, so we just merge
# them into one.
ROOT_GENERATE_DICTIONARY(G__${libname} ${headers} MODULE ${libname} LINKDEF Math/LinkDef_GenVectorAll.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Core)
ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx LIBRARIES Core)
else()
ROOT_GENERATE_DICTIONARY(G__${libname} ${headers} MODULE ${libname} LINKDEF Math/LinkDef_GenVector.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Core)
ROOT_GENERATE_DICTIONARY(G__${libname}32 ${headers32} MULTIDICT MODULE ${libname} LINKDEF Math/LinkDef_GenVector32.h OPTIONS "-writeEmptyRootPCM" DEPENDENCIES Core)

ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx G__${libname}32.cxx LIBRARIES Core)
endif()
ROOT_INSTALL_HEADERS()

36 changes: 25 additions & 11 deletions math/smatrix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,32 @@

set(libname Smatrix)

ROOT_GENERATE_DICTIONARY(G__${libname} Math/SMatrix.h Math/SVector.h
Math/SMatrixDfwd.h Math/SMatrixFfwd.h
MODULE ${libname}
LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM"
DEPENDENCIES Core)
if (runtime_cxxmodules)
# With runtime_cxxmodules we have a hard time making two identical modules
# with the same files in them but different LinkDefs, so we just merge
# them into one.
ROOT_GENERATE_DICTIONARY(G__${libname} Math/SMatrix.h Math/SVector.h
Math/SMatrixDfwd.h Math/SMatrixFfwd.h
MODULE ${libname}
LINKDEF LinkDefAll.h OPTIONS "-writeEmptyRootPCM"
DEPENDENCIES Core)

ROOT_GENERATE_DICTIONARY(G__${libname}32 Math/SMatrix.h Math/SVector.h
Math/SMatrixDfwd.h Math/SMatrixFfwd.h
MULTIDICT MODULE ${libname}
LINKDEF LinkDefD32.h OPTIONS "-writeEmptyRootPCM"
DEPENDENCIES Core)
ROOT_LINKER_LIBRARY(${libname} G__${libname}.cxx LIBRARIES Core)
else()
ROOT_GENERATE_DICTIONARY(G__${libname} Math/SMatrix.h Math/SVector.h
Math/SMatrixDfwd.h Math/SMatrixFfwd.h
MODULE ${libname}
LINKDEF LinkDef.h OPTIONS "-writeEmptyRootPCM"
DEPENDENCIES Core)

ROOT_LINKER_LIBRARY(${libname} G__${libname}.cxx G__${libname}32.cxx LIBRARIES Core)
ROOT_GENERATE_DICTIONARY(G__${libname}32 Math/SMatrix.h Math/SVector.h
Math/SMatrixDfwd.h Math/SMatrixFfwd.h
MULTIDICT MODULE ${libname}
LINKDEF LinkDefD32.h OPTIONS "-writeEmptyRootPCM"
DEPENDENCIES Core)

ROOT_LINKER_LIBRARY(${libname} G__${libname}.cxx G__${libname}32.cxx LIBRARIES Core)
endif()
ROOT_INSTALL_HEADERS()