From 16fe0862672a81dd79513ffc89074d25041cc9b0 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 17 Oct 2003 16:19:37 -0400 Subject: BUG: make sure -M flags are not duplicated and are only set in the xml --- Source/cmLocalVisualStudio7Generator.cxx | 40 +++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index b740bb2..5d55adc 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -344,46 +344,58 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, << "\t\t\t\tAdditionalOptions=\""; cmSystemTools::ReplaceString(flags, "\"", """); - fout << flags; - - fout << " -DCMAKE_INTDIR=\\"" << configName << "\\"" - << "\"\n"; - - fout << "\t\t\t\tAdditionalIncludeDirectories=\""; - std::vector& includes = m_Makefile->GetIncludeDirectories(); - std::vector::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=\\"" << configName << "\\"" + << "\"\n"; + + fout << "\t\t\t\tAdditionalIncludeDirectories=\""; + std::vector& includes = m_Makefile->GetIncludeDirectories(); + std::vector::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" -- cgit v0.12