From bd5ea6993c8376cd3612100019e15ee256a758d8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 15 Feb 2017 10:36:56 -0500 Subject: cmVisualStudioGeneratorOptions: Add PrependInerhitedString method --- Source/cmVisualStudioGeneratorOptions.cxx | 11 +++++++++++ Source/cmVisualStudioGeneratorOptions.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 6bacfa1..f8de3f8 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -211,6 +211,17 @@ void cmVisualStudioGeneratorOptions::ParseFinish() } } +void cmVisualStudioGeneratorOptions::PrependInheritedString( + std::string const& key) +{ + std::map::iterator i = this->FlagMap.find(key); + if (i == this->FlagMap.end() || i->second.size() != 1) { + return; + } + std::string& value = i->second[0]; + value = "%(" + key + ") " + value; +} + void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag) { // Look for Intel Fortran flags that do not map well in the flag table. diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h index 3a53ff5..ee9d0a5 100644 --- a/Source/cmVisualStudioGeneratorOptions.h +++ b/Source/cmVisualStudioGeneratorOptions.h @@ -47,6 +47,8 @@ public: void Parse(const char* flags); void ParseFinish(); + void PrependInheritedString(std::string const& key); + // Fix the ExceptionHandling option to default to off. void FixExceptionHandlingDefault(); -- cgit v0.12