With Athena now using Geant4 static/big libraries, optimization work has shifted to look at use of LTO/PGO. As these are relatively involved tasks, a first step is to use FullSimLight as a proof-of-principle for the flags and operations needed to support this. Though this work won't (at least at this stage) be integrated into GeoModel/FullSimLight, the need to hack at the build scripts has highlighted some modernizations/simplifications that can be made independently right now. These are not only useful to assist the LTO/PGO work, but for general efficiency and clarity of the build.
ALIAS
targets in subprojects. Only link to namespaced GeoModel targets in subprojects
ExternalProject
targets for JSON, Eigen, and Xerces-C dependencies of the internal imported targets
add_dependencies
on GeoModel targets that link to these. They simply link to the namespaced imported target, e.g. nlohmann_json::nlohmann_json
and don't need to worry if this is coming from the builtin on the system.FullSimLight
target as an INTERFACE
target so plugins just need to link to it.OBJECT
library.
CMAKE_CURRENT_SOURCE_DIR
instead of an artificial project
command.Geant4_USE_FILE
)These have been tested locally on macOS with as many combinations of build options as I can enable and appears fine. CI is more than likely to highlight issues, but let's see what it throws up.