diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-01 16:48:22 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-02 17:43:13 (GMT) |
commit | 9f7a25a2c7976bfbbfeb928a67626ba9f4d86832 (patch) | |
tree | 5121b208db4333e241c211b376e930f204784a70 /Source/cmTarget.cxx | |
parent | ab2b967ce601998ddc25971cd2e2345eff7196d9 (diff) | |
download | CMake-9f7a25a2c7976bfbbfeb928a67626ba9f4d86832.zip CMake-9f7a25a2c7976bfbbfeb928a67626ba9f4d86832.tar.gz CMake-9f7a25a2c7976bfbbfeb928a67626ba9f4d86832.tar.bz2 |
cmTarget: factor out non-executable normal target with artifact properties
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 39e80ac..344badc 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -297,6 +297,9 @@ struct TargetProperty // Needs to be a "normal" target with an artifact (no `INTERFACE` // libraries). TargetWithArtifact, + // Needs to be a "normal" target with an artifact that is not an + // executable. + NonExecutableWithArtifact, }; enum class Repetition @@ -430,6 +433,11 @@ TargetProperty const StaticTargetProperties[] = { { "LINK_LIBRARIES_ONLY_TARGETS"_s, IC::NormalNonImportedTarget }, { "LINK_SEARCH_START_STATIC"_s, IC::CanCompileSources }, { "LINK_SEARCH_END_STATIC"_s, IC::CanCompileSources }, + // Initialize per-configuration name postfix property from the variable only + // for non-executable targets. This preserves compatibility with previous + // CMake versions in which executables did not support this variable. + // Projects may still specify the property directly. + { "_POSTFIX"_s, IC::NonExecutableWithArtifact, R::PerConfigPrefix }, // -- Dependent library lookup { "MACOSX_RPATH"_s, IC::CanCompileSources }, // ---- Build @@ -934,18 +942,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); for (std::string const& configName : configNames) { std::string configUpper = cmSystemTools::UpperCase(configName); - // Initialize per-configuration name postfix property from the - // variable only for non-executable targets. This preserves - // compatibility with previous CMake versions in which executables - // did not support this variable. Projects may still specify the - // property directly. - if (this->impl->TargetType != cmStateEnums::EXECUTABLE && - this->impl->TargetType != cmStateEnums::INTERFACE_LIBRARY) { - std::string property = - cmStrCat(cmSystemTools::UpperCase(configName), "_POSTFIX"); - initProp(property); - } - if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY || this->impl->TargetType == cmStateEnums::STATIC_LIBRARY) { std::string property = cmStrCat("FRAMEWORK_MULTI_CONFIG_POSTFIX_", @@ -1035,6 +1031,10 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, } if (this->impl->TargetType != cmStateEnums::INTERFACE_LIBRARY) { metConditions.insert(TargetProperty::InitCondition::TargetWithArtifact); + if (this->impl->TargetType != cmStateEnums::EXECUTABLE) { + metConditions.insert( + TargetProperty::InitCondition::NonExecutableWithArtifact); + } } } |