summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-28 12:11:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-07-28 12:11:18 (GMT)
commit75647fc53dace97d4dd03f8d5a1abfb995b4558d (patch)
treed65b243f9e5a9370808decae929d4af0a4f28722 /Source/cmGlobalGenerator.cxx
parent859f50a4ed8eedb0e0944e756ff807003cea43da (diff)
parent27fd172d8dcd42f5c9dc362cc3572f4f4d8132cd (diff)
downloadCMake-75647fc53dace97d4dd03f8d5a1abfb995b4558d.zip
CMake-75647fc53dace97d4dd03f8d5a1abfb995b4558d.tar.gz
CMake-75647fc53dace97d4dd03f8d5a1abfb995b4558d.tar.bz2
Merge topic 'verify-interface-header-sets-add-compile-definitions' into release-3.24
27fd172d8d VERIFY_INTERFACE_HEADER_SETS: Finalize compile info for verify targets 626e641a19 cmTarget: Factor out FinalizeTargetCompileInfo() Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7516
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx34
1 files changed, 5 insertions, 29 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ebb12f8..edc4118 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -14,6 +14,7 @@
#include <utility>
#include <cm/memory>
+#include <cm/optional>
#include <cmext/algorithm>
#include <cmext/string_view>
@@ -1823,39 +1824,14 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
// Construct per-target generator information.
for (const auto& mf : this->Makefiles) {
- const cmBTStringRange noconfig_compile_definitions =
+ const cmBTStringRange noConfigCompileDefinitions =
mf->GetCompileDefinitionsEntries();
+ cm::optional<std::map<std::string, cmValue>> perConfigCompileDefinitions;
for (auto& target : mf->GetTargets()) {
cmTarget* t = &target.second;
- if (t->GetType() == cmStateEnums::GLOBAL_TARGET) {
- continue;
- }
-
- t->AppendBuildInterfaceIncludes();
-
- if (t->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
- continue;
- }
-
- for (auto const& def : noconfig_compile_definitions) {
- t->InsertCompileDefinition(def);
- }
-
- cmPolicies::PolicyStatus polSt =
- mf->GetPolicyStatus(cmPolicies::CMP0043);
- if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) {
- std::vector<std::string> configs =
- mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
-
- for (std::string const& c : configs) {
- std::string defPropName =
- cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(c));
- if (cmValue val = mf->GetProperty(defPropName)) {
- t->AppendProperty(defPropName, *val);
- }
- }
- }
+ t->FinalizeTargetCompileInfo(noConfigCompileDefinitions,
+ perConfigCompileDefinitions);
}
// The standard include directories for each language