diff options
author | Justin Goshi <jgoshi@microsoft.com> | 2020-07-02 18:26:20 (GMT) |
---|---|---|
committer | Justin Goshi <jgoshi@microsoft.com> | 2020-07-06 18:40:39 (GMT) |
commit | 2f383d852d8d946a61419fe5f4b5c8501216dae9 (patch) | |
tree | 26423c46641812fa92f29c418f03cf47d2bbc5ca /Source/cmGeneratorTarget.cxx | |
parent | cc96fb617b65ffa9db8dd3f242ee3b9319b4c4c4 (diff) | |
download | CMake-2f383d852d8d946a61419fe5f4b5c8501216dae9.zip CMake-2f383d852d8d946a61419fe5f4b5c8501216dae9.tar.gz CMake-2f383d852d8d946a61419fe5f4b5c8501216dae9.tar.bz2 |
fileapi: Support multiple backtraces for language standard
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]; } } |