@@ -24,6 +24,36 @@ o2physics_add_library(AnalysisCore
2424 FFitWeights.cxx
2525 PUBLIC_LINK_LIBRARIES O2::Framework O2::DataFormatsParameters ROOT::EG O2::CCDB ROOT::Physics O2::FT0Base O2::FV0Base O2::DataFormatsParamTOF )
2626
27+ # Precompiled header shared by DPL analysis workflows. Parsing the framework
28+ # headers dominates the cost of a workflow translation unit, and there are
29+ # ~1500 of them; o2physics_add_dpl_workflow reuses this by default.
30+ #
31+ # Skipped under recc, which caches compilations remotely instead -- the two do
32+ # not combine, as a PCH is a local artefact of one compiler invocation.
33+ #
34+ # The link libraries have to match what the reusing targets compile with, so
35+ # this carries only what every workflow already links.
36+ add_library (AnalysisPCH OBJECT analysisPCH.cxx )
37+ target_link_libraries (AnalysisPCH PUBLIC O2::Framework O2Physics::AnalysisCore )
38+ if (NOT DEFINED ENV{USE_RECC})
39+ target_precompile_headers (AnalysisPCH PRIVATE
40+ <Framework/ASoA.h>
41+ <Framework/AnalysisTask.h>
42+ <Framework/ConfigContext.h>
43+ <Framework/DataProcessorSpec.h>
44+ # NOT runDataProcessing.h. It states the contract itself: "we need to
45+ # declare the customize method before include this file". Precompiling it
46+ # makes it the first include in every workflow, so a source's customize() is
47+ # never seen, its options are never registered, and the binary aborts at
48+ # --dump-workflow with "missing option: ...". The link succeeds, so this
49+ # surfaces as a runtime failure with no hint that a PCH caused it.
50+
51+ <memory>
52+ <string>
53+ <vector>
54+ )
55+ endif ()
56+
2757o2physics_target_root_dictionary (AnalysisCore
2858 HEADERS TrackSelection.h
2959 TrackSelectionDefaults.h
0 commit comments