summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-02-01 16:49:12 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-02-02 17:43:13 (GMT)
commitf0ae00d7278f1f7757500bdc2800fb86d5477a29 (patch)
tree35337f879357c26502f24c0da61308e881768347 /Source
parent9f7a25a2c7976bfbbfeb928a67626ba9f4d86832 (diff)
downloadCMake-f0ae00d7278f1f7757500bdc2800fb86d5477a29.zip
CMake-f0ae00d7278f1f7757500bdc2800fb86d5477a29.tar.gz
CMake-f0ae00d7278f1f7757500bdc2800fb86d5477a29.tar.bz2
cmTarget: factor out linkable normal library target properties
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx27
1 files changed, 10 insertions, 17 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 344badc..b299435 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -300,6 +300,9 @@ struct TargetProperty
// Needs to be a "normal" target with an artifact that is not an
// executable.
NonExecutableWithArtifact,
+ // Needs to be a linkable library target (no `OBJECT` or `MODULE`
+ // libraries).
+ LinkableLibraryTarget,
};
enum class Repetition
@@ -462,6 +465,8 @@ TargetProperty const StaticTargetProperties[] = {
{ "ANDROID_SECURE_PROPS_PATH"_s, IC::CanCompileSources },
// ---- iOS
{ "IOS_INSTALL_COMBINED"_s, IC::CanCompileSources },
+ // ---- macOS
+ { "FRAMEWORK_MULTI_CONFIG_POSTFIX_"_s, IC::LinkableLibraryTarget, R::PerConfig },
// ---- Windows
{ "GNUtoMS"_s, IC::CanCompileSources },
{ "WIN32_EXECUTABLE"_s, IC::CanCompileSources },
@@ -934,23 +939,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
}
};
- // Setup per-configuration property default values.
- if (this->GetType() != cmStateEnums::UTILITY &&
- this->GetType() != cmStateEnums::GLOBAL_TARGET) {
- // Collect the set of configuration types.
- std::vector<std::string> configNames =
- mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
- for (std::string const& configName : configNames) {
- std::string configUpper = cmSystemTools::UpperCase(configName);
- if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
- this->impl->TargetType == cmStateEnums::STATIC_LIBRARY) {
- std::string property = cmStrCat("FRAMEWORK_MULTI_CONFIG_POSTFIX_",
- cmSystemTools::UpperCase(configName));
- initProp(property);
- }
- }
- }
-
// Save the backtrace of target construction.
this->impl->Backtrace = this->impl->Makefile->GetBacktrace();
@@ -1036,6 +1024,11 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
TargetProperty::InitCondition::NonExecutableWithArtifact);
}
}
+ if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
+ this->impl->TargetType == cmStateEnums::STATIC_LIBRARY) {
+ metConditions.insert(
+ TargetProperty::InitCondition::LinkableLibraryTarget);
+ }
}
std::vector<std::string> configNames =