/src/CMake/Source/cmStatePrivate.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | |
4 | | #pragma once |
5 | | |
6 | | #include "cmConfigure.h" // IWYU pragma: keep |
7 | | |
8 | | #include <set> |
9 | | #include <string> |
10 | | #include <unordered_map> |
11 | | #include <vector> |
12 | | |
13 | | #include "cmDefinitions.h" |
14 | | #include "cmDiagnostics.h" |
15 | | #include "cmLinkedTree.h" |
16 | | #include "cmListFileCache.h" |
17 | | #include "cmPackageState.h" |
18 | | #include "cmPolicies.h" |
19 | | #include "cmPropertyMap.h" |
20 | | #include "cmStateSnapshot.h" |
21 | | #include "cmStateTypes.h" |
22 | | |
23 | | namespace cmStateDetail { |
24 | | struct BuildsystemDirectoryStateType; |
25 | | struct PolicyStackEntry; |
26 | | struct DiagnosticStackEntry; |
27 | | extern std::string const PropertySentinel; |
28 | | } // namespace cmStateDetail |
29 | | |
30 | | struct cmStateDetail::SnapshotDataType |
31 | | { |
32 | | cmStateDetail::PositionType ScopeParent; |
33 | | cmStateDetail::PositionType DirectoryParent; |
34 | | cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator Policies; |
35 | | cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator PolicyRoot; |
36 | | cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator PolicyScope; |
37 | | cmLinkedTree<cmStateDetail::DiagnosticStackEntry>::iterator Diagnostics; |
38 | | cmLinkedTree<cmStateDetail::DiagnosticStackEntry>::iterator DiagnosticRoot; |
39 | | cmLinkedTree<cmStateDetail::DiagnosticStackEntry>::iterator DiagnosticScope; |
40 | | cmStateEnums::SnapshotType SnapshotType; |
41 | | cmStateEnums::SnapshotUnwindType UnwindType = cmStateEnums::NO_UNWIND; |
42 | | cmStateEnums::SnapshotUnwindState UnwindState = cmStateEnums::NOT_UNWINDING; |
43 | | bool Keep; |
44 | | cmLinkedTree<std::string>::iterator ExecutionListFile; |
45 | | cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator |
46 | | BuildSystemDirectory; |
47 | | cmLinkedTree<cmDefinitions>::iterator Vars; |
48 | | cmLinkedTree<cmDefinitions>::iterator Root; |
49 | | cmLinkedTree<cmDefinitions>::iterator Parent; |
50 | | std::vector<std::string>::size_type IncludeDirectoryPosition; |
51 | | std::vector<std::string>::size_type CompileDefinitionsPosition; |
52 | | std::vector<std::string>::size_type CompileOptionsPosition; |
53 | | std::vector<std::string>::size_type LinkOptionsPosition; |
54 | | std::vector<std::string>::size_type LinkDirectoriesPosition; |
55 | | }; |
56 | | |
57 | | struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap |
58 | | { |
59 | | using derived = cmPolicies::PolicyMap; |
60 | | PolicyStackEntry(bool w = false) |
61 | | : Weak(w) |
62 | 0 | { |
63 | 0 | } |
64 | | PolicyStackEntry(derived const& d, bool w) |
65 | 1 | : derived(d) |
66 | 1 | , Weak(w) |
67 | 1 | { |
68 | 1 | } |
69 | | bool Weak; |
70 | | }; |
71 | | |
72 | | struct cmStateDetail::DiagnosticStackEntry |
73 | | : public cmDiagnostics::DiagnosticMap |
74 | | { |
75 | | using derived = cmDiagnostics::DiagnosticMap; |
76 | | DiagnosticStackEntry(bool w = false) |
77 | | : Weak(w) |
78 | 0 | { |
79 | 0 | } |
80 | | DiagnosticStackEntry(derived d, bool w) |
81 | 37 | : derived(d) |
82 | 37 | , Weak(w) |
83 | 37 | { |
84 | 37 | } |
85 | | bool Weak; |
86 | | }; |
87 | | |
88 | | struct cmStateDetail::BuildsystemDirectoryStateType |
89 | | { |
90 | | cmStateDetail::PositionType CurrentScope; |
91 | | |
92 | | std::string Location; |
93 | | std::string OutputLocation; |
94 | | |
95 | | std::vector<BT<std::string>> IncludeDirectories; |
96 | | |
97 | | std::vector<BT<std::string>> CompileDefinitions; |
98 | | |
99 | | std::vector<BT<std::string>> CompileOptions; |
100 | | |
101 | | std::vector<BT<std::string>> LinkOptions; |
102 | | |
103 | | std::vector<BT<std::string>> LinkDirectories; |
104 | | |
105 | | std::vector<std::string> NormalTargetNames; |
106 | | std::vector<std::string> ImportedTargetNames; |
107 | | |
108 | | std::set<std::string> Projects; |
109 | | |
110 | | std::string ProjectName; |
111 | | |
112 | | cmPropertyMap Properties; |
113 | | |
114 | | std::unordered_map<std::string, cmPackageState> Packages; |
115 | | |
116 | | std::vector<cmStateSnapshot> Children; |
117 | | }; |