瀏覽代碼

cmVisualStudioGeneratorOptions: Add PrependInerhitedString method

Brad King 8 年之前
父節點
當前提交
bd5ea6993c
共有 2 個文件被更改,包括 13 次插入0 次删除
  1. 11 0
      Source/cmVisualStudioGeneratorOptions.cxx
  2. 2 0
      Source/cmVisualStudioGeneratorOptions.h

+ 11 - 0
Source/cmVisualStudioGeneratorOptions.cxx

@@ -211,6 +211,17 @@ void cmVisualStudioGeneratorOptions::ParseFinish()
   }
 }
 
+void cmVisualStudioGeneratorOptions::PrependInheritedString(
+  std::string const& key)
+{
+  std::map<std::string, FlagValue>::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.

+ 2 - 0
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();