summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-02-01 16:42:46 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-02-02 17:43:13 (GMT)
commit7a34637c3d90a26511aedb8daa47ca348bffefca (patch)
treec8cbea71454aa749e4a90c9a76c1b78d107ba5db /Source
parent35d6a6b1860cae88ddab8bd1f6985a58409d9161 (diff)
downloadCMake-7a34637c3d90a26511aedb8daa47ca348bffefca.zip
CMake-7a34637c3d90a26511aedb8daa47ca348bffefca.tar.gz
CMake-7a34637c3d90a26511aedb8daa47ca348bffefca.tar.bz2
cmTarget: factor out properties for normal targets
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 339ba3e..dfab17b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -288,6 +288,8 @@ struct TargetProperty
NeedsXcode,
// Only apply to Xcode generators on targets that can compile sources.
NeedsXcodeAndCanCompileSources,
+ // Needs to be a "normal" target (any non-global, non-utility target).
+ NormalTarget,
};
enum class Repetition
@@ -521,6 +523,7 @@ TargetProperty const StaticTargetProperties[] = {
// Usage requirement properties
{ "LINK_INTERFACE_LIBRARIES"_s, IC::CanCompileSources },
+ { "MAP_IMPORTED_CONFIG_"_s, IC::NormalTarget, R::PerConfig },
// Metadata
{ "EXPORT_COMPILE_COMMANDS"_s, IC::CanCompileSources },
@@ -921,8 +924,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
/* clang-format needs this comment to break after the opening brace */
"ARCHIVE_OUTPUT_DIRECTORY_"_s, "LIBRARY_OUTPUT_DIRECTORY_"_s,
"RUNTIME_OUTPUT_DIRECTORY_"_s, "PDB_OUTPUT_DIRECTORY_"_s,
- "COMPILE_PDB_OUTPUT_DIRECTORY_"_s, "MAP_IMPORTED_CONFIG_"_s,
- "INTERPROCEDURAL_OPTIMIZATION_"_s
+ "COMPILE_PDB_OUTPUT_DIRECTORY_"_s, "INTERPROCEDURAL_OPTIMIZATION_"_s
};
// Collect the set of configuration types.
std::vector<std::string> configNames =
@@ -932,8 +934,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
for (auto const& prop : configProps) {
// Interface libraries have no output locations, so honor only
// the configuration map.
- if (this->impl->TargetType == cmStateEnums::INTERFACE_LIBRARY &&
- prop != "MAP_IMPORTED_CONFIG_") {
+ if (this->impl->TargetType == cmStateEnums::INTERFACE_LIBRARY) {
continue;
}
std::string property = cmStrCat(prop, configUpper);
@@ -1036,6 +1037,10 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
TargetProperty::InitCondition::NeedsXcodeAndCanCompileSources);
}
}
+ if (this->impl->TargetType != cmStateEnums::UTILITY &&
+ this->impl->TargetType != cmStateEnums::GLOBAL_TARGET) {
+ metConditions.insert(TargetProperty::InitCondition::NormalTarget);
+ }
std::vector<std::string> configNames =
mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);