File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,31 @@ 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+ <Framework/runDataProcessing.h>
45+
46+ <memory>
47+ <string>
48+ <vector>
49+ )
50+ endif ()
51+
2752o2physics_target_root_dictionary (AnalysisCore
2853 HEADERS TrackSelection.h
2954 TrackSelectionDefaults.h
Original file line number Diff line number Diff line change 1+ // Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+ // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+ // All rights not expressly granted are reserved.
4+ //
5+ // This software is distributed under the terms of the GNU General Public
6+ // License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+ //
8+ // In applying this license CERN does not waive the privileges and immunities
9+ // granted to it by virtue of its status as an Intergovernmental Organization
10+ // or submit itself to any jurisdiction.
11+
12+ // Carrier for the precompiled header shared by DPL analysis workflows; see
13+ // AnalysisPCH in this directory's CMakeLists.txt. It exists only to own the
14+ // PCH, so it has no code of its own.
Original file line number Diff line number Diff line change @@ -47,8 +47,24 @@ function(o2physics_add_dpl_workflow baseTargetName)
4747 set_property (TARGET ${targetExeName} PROPERTY JOB_POOL_COMPILE analysis)
4848 set_property (TARGET ${targetExeName} PROPERTY JOB_POOL_LINK analysis)
4949
50- if (A_REUSE_FROM AND NOT DEFINED ENV{USE_RECC})
51- target_precompile_headers (${targetExeName} REUSE_FROM ${A_REUSE_FROM} )
50+ # Reuse a precompiled header. Without an explicit REUSE_FROM, fall back to the
51+ # shared AnalysisPCH (Common/Core): a workflow translation unit spends most of
52+ # its time parsing the framework headers, and there are ~1500 of them, so the
53+ # default is worth more than the handful of targets that name their own.
54+ #
55+ # Set O2PHYSICS_DEFAULT_PCH to an empty string to opt out globally, e.g. when
56+ # bisecting a PCH-related build failure.
57+ if (NOT DEFINED O2PHYSICS_DEFAULT_PCH)
58+ set (O2PHYSICS_DEFAULT_PCH AnalysisPCH)
59+ endif ()
60+ set (_pch "${A_REUSE_FROM} " )
61+ if (NOT _pch)
62+ set (_pch "${O2PHYSICS_DEFAULT_PCH} " )
63+ endif ()
64+ # A target cannot reuse its own PCH, and the carrier is not built when recc
65+ # is caching compilations remotely instead.
66+ if (_pch AND NOT _pch STREQUAL targetExeName AND NOT DEFINED ENV{USE_RECC})
67+ target_precompile_headers (${targetExeName} REUSE_FROM ${_pch} )
5268 endif ()
5369
5470 set (jsonFile $<TARGET_FILE_BASE_NAME :${targetExeName} >.json)
You can’t perform that action at this time.
0 commit comments