summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorJustin Goshi <jgoshi@microsoft.com>2020-07-02 18:26:20 (GMT)
committerJustin Goshi <jgoshi@microsoft.com>2020-07-06 18:40:39 (GMT)
commit2f383d852d8d946a61419fe5f4b5c8501216dae9 (patch)
tree26423c46641812fa92f29c418f03cf47d2bbc5ca /Source/cmTarget.cxx
parentcc96fb617b65ffa9db8dd3f242ee3b9319b4c4c4 (diff)
downloadCMake-2f383d852d8d946a61419fe5f4b5c8501216dae9.zip
CMake-2f383d852d8d946a61419fe5f4b5c8501216dae9.tar.gz
CMake-2f383d852d8d946a61419fe5f4b5c8501216dae9.tar.bz2
fileapi: Support multiple backtraces for language standard
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 72c7600..a4f9083 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -186,7 +186,7 @@ public:
std::vector<cmInstallTargetGenerator*> InstallGenerators;
std::set<std::string> SystemIncludeDirectories;
cmTarget::LinkLibraryVectorType OriginalLinkLibraries;
- std::map<std::string, BT<std::string>> LanguageStandardProperties;
+ std::map<std::string, BTs<std::string>> LanguageStandardProperties;
std::vector<std::string> IncludeDirectoriesEntries;
std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces;
std::vector<std::string> CompileOptionsEntries;
@@ -600,7 +600,7 @@ cmGlobalGenerator* cmTarget::GetGlobalGenerator() const
return impl->Makefile->GetGlobalGenerator();
}
-BT<std::string> const* cmTarget::GetLanguageStandardProperty(
+BTs<std::string> const* cmTarget::GetLanguageStandardProperty(
const std::string& propertyName) const
{
auto entry = impl->LanguageStandardProperties.find(propertyName);
@@ -625,8 +625,13 @@ void cmTarget::SetLanguageStandardProperty(std::string const& lang,
}
}
- impl->LanguageStandardProperties[cmStrCat(lang, "_STANDARD")] =
- BT<std::string>(value, featureBacktrace);
+ BTs<std::string>& languageStandardProperty =
+ impl->LanguageStandardProperties[cmStrCat(lang, "_STANDARD")];
+ if (languageStandardProperty.Value != value) {
+ languageStandardProperty.Value = value;
+ languageStandardProperty.Backtraces.clear();
+ }
+ languageStandardProperty.Backtraces.emplace_back(featureBacktrace);
}
void cmTarget::AddUtility(std::string const& name, bool cross, cmMakefile* mf)
@@ -1357,7 +1362,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
prop == propOBJCXX_STANDARD) {
if (value) {
impl->LanguageStandardProperties[prop] =
- BT<std::string>(value, impl->Makefile->GetBacktrace());
+ BTs<std::string>(value, impl->Makefile->GetBacktrace());
} else {
impl->LanguageStandardProperties.erase(prop);
}