Browse Source

FIX: fix for bug 1606

Bill Hoffman 21 years ago
parent
commit
761cbed509
1 changed files with 8 additions and 8 deletions
  1. 8 8
      Source/cmLocalVisualStudio7Generator.cxx

+ 8 - 8
Source/cmLocalVisualStudio7Generator.cxx

@@ -542,15 +542,14 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags(
   std::string replace;
   while(flagTable->IDEName)
     {
-    if(flags.find(flagTable->commandFlag) != flags.npos)
+    std::string regex = "((/|-)";
+    regex += flagTable->commandFlag;
+    regex += ")";
+    cmsys::RegularExpression reg(regex.c_str());
+    while(reg.find(flags))
       {
-      // replace -flag
-      replace = "-";
-      replace += flagTable->commandFlag;
-      cmSystemTools::ReplaceString(flags, replace.c_str(), "");
-      // now replace /flag
-      replace[0] = '/';
-      cmSystemTools::ReplaceString(flags, replace.c_str(), "");
+      // replace the flag 
+      cmSystemTools::ReplaceString(flags, reg.match(1).c_str(), "");
       // now put value into flag map
       flagMap[flagTable->IDEName] = flagTable->value;
       }
@@ -559,6 +558,7 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags(
 }
 
 
+
 void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
                                           const char* configName,
                                           const char *libName,