Browse Source

BUG: make sure -M flags are not duplicated and are only set in the xml

Bill Hoffman 22 years ago
parent
commit
16fe086267
1 changed files with 26 additions and 14 deletions
  1. 26 14
      Source/cmLocalVisualStudio7Generator.cxx

+ 26 - 14
Source/cmLocalVisualStudio7Generator.cxx

@@ -344,46 +344,58 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
        << "\t\t\t\tAdditionalOptions=\"";
 
   cmSystemTools::ReplaceString(flags, "\"", "&quot;");
-  fout << flags;
-
-  fout << " -DCMAKE_INTDIR=\\&quot;" << configName << "\\&quot;" 
-       << "\"\n";
-
-  fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
-  std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories();
-  std::vector<std::string>::iterator i = includes.begin();
-  for(;i != includes.end(); ++i)
-    {
-    std::string ipath = this->ConvertToXMLOutputPath(i->c_str());
-    fout << ipath << ";";
-    }
-  fout << "\"\n";
   // check the flags for the run time library flag options
   // if there is a match set the run time flag
   if(flags.find("MTd") != flags.npos)
     {
+    cmSystemTools::ReplaceString(flags, "-MTd", "");
+    cmSystemTools::ReplaceString(flags, "/MTd", "");
     runtime = 1;
     }
   else if (flags.find("MDd") != flags.npos)
     {
+    cmSystemTools::ReplaceString(flags, "-MDd", "");
+    cmSystemTools::ReplaceString(flags, "/MDd", "");
     runtime = 3;
     }
   else if (flags.find("MLd") != flags.npos)
     {
+    cmSystemTools::ReplaceString(flags, "-MLd", "");
+    cmSystemTools::ReplaceString(flags, "/MLd", "");
     runtime = 5;
     }
   else if (flags.find("MT") != flags.npos)
     {
+    cmSystemTools::ReplaceString(flags, "-MT", "");
+    cmSystemTools::ReplaceString(flags, "/MT", "");
     runtime = 0;
     }
   else if (flags.find("MD") != flags.npos)
     {
+    cmSystemTools::ReplaceString(flags, "-MD", "");
+    cmSystemTools::ReplaceString(flags, "/MD", "");
     runtime = 2;
     }
   else if (flags.find("ML") != flags.npos)
     {
+    cmSystemTools::ReplaceString(flags, "-ML", "");
+    cmSystemTools::ReplaceString(flags, "/ML", "");
     runtime = 4;
     }
+  fout << flags;
+
+  fout << " -DCMAKE_INTDIR=\\&quot;" << configName << "\\&quot;" 
+       << "\"\n";
+
+  fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
+  std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories();
+  std::vector<std::string>::iterator i = includes.begin();
+  for(;i != includes.end(); ++i)
+    {
+    std::string ipath = this->ConvertToXMLOutputPath(i->c_str());
+    fout << ipath << ";";
+    }
+  fout << "\"\n";
 
   fout << "\t\t\t\tOptimization=\"" << optimized << "\"\n"
        << "\t\t\t\tRuntimeLibrary=\"" << runtime << "\"\n"