diff options
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index cc6f817..ccd8e7e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -949,7 +949,7 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const return it != this->ExplicitObjectName.end(); } -BT<std::string> const* cmGeneratorTarget::GetLanguageStandardProperty( +BTs<std::string> const* cmGeneratorTarget::GetLanguageStandardProperty( std::string const& lang, std::string const& config) const { std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang); @@ -965,7 +965,7 @@ BT<std::string> const* cmGeneratorTarget::GetLanguageStandardProperty( cmProp cmGeneratorTarget::GetLanguageStandard(std::string const& lang, std::string const& config) const { - BT<std::string> const* languageStandard = + BTs<std::string> const* languageStandard = this->GetLanguageStandardProperty(lang, config); if (languageStandard) { @@ -4486,8 +4486,13 @@ bool cmGeneratorTarget::ComputeCompileFeatures(std::string const& config) const } if (!newRequiredStandard.empty()) { - this->LanguageStandardMap[key] = - BT<std::string>(newRequiredStandard, f.Backtrace); + BTs<std::string>& languageStandardProperty = + this->LanguageStandardMap[key]; + if (languageStandardProperty.Value != newRequiredStandard) { + languageStandardProperty.Value = newRequiredStandard; + languageStandardProperty.Backtraces.clear(); + } + languageStandardProperty.Backtraces.emplace_back(f.Backtrace); } } @@ -4498,14 +4503,14 @@ bool cmGeneratorTarget::ComputeCompileFeatures( std::string const& config, std::set<LanguagePair> const& languagePairs) const { for (const auto& language : languagePairs) { - BT<std::string> const* generatorTargetLanguageStandard = + BTs<std::string> const* generatorTargetLanguageStandard = this->GetLanguageStandardProperty(language.first, config); if (!generatorTargetLanguageStandard) { // If the standard isn't explicitly set we copy it over from the // specified paired language. std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', language.first); - BT<std::string> const* standardToCopy = + BTs<std::string> const* standardToCopy = this->GetLanguageStandardProperty(language.second, config); if (standardToCopy != nullptr) { this->LanguageStandardMap[key] = *standardToCopy; @@ -4514,7 +4519,7 @@ bool cmGeneratorTarget::ComputeCompileFeatures( cmProp defaultStandard = this->Makefile->GetDef( cmStrCat("CMAKE_", language.second, "_STANDARD_DEFAULT")); if (defaultStandard != nullptr) { - this->LanguageStandardMap[key] = BT<std::string>(*defaultStandard); + this->LanguageStandardMap[key] = BTs<std::string>(*defaultStandard); generatorTargetLanguageStandard = &this->LanguageStandardMap[key]; } } |