diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-01 16:49:12 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-02 17:43:13 (GMT) |
commit | f0ae00d7278f1f7757500bdc2800fb86d5477a29 (patch) | |
tree | 35337f879357c26502f24c0da61308e881768347 /Source/cmTarget.cxx | |
parent | 9f7a25a2c7976bfbbfeb928a67626ba9f4d86832 (diff) | |
download | CMake-f0ae00d7278f1f7757500bdc2800fb86d5477a29.zip CMake-f0ae00d7278f1f7757500bdc2800fb86d5477a29.tar.gz CMake-f0ae00d7278f1f7757500bdc2800fb86d5477a29.tar.bz2 |
cmTarget: factor out linkable normal library target properties
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 27 |
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 = |