summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-02-10 04:25:09 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-02-10 04:25:09 (GMT)
commitd8ed9ef12151ad36c7cc9bb1908e7866a1e61bd0 (patch)
tree7fd3e562a89475ab0fb2e3fc2c8596de8515c6b0 /Source
parentc840bbcaaf10a7bf30516d4c1f8c79888c5726da (diff)
downloadCMake-d8ed9ef12151ad36c7cc9bb1908e7866a1e61bd0.zip
CMake-d8ed9ef12151ad36c7cc9bb1908e7866a1e61bd0.tar.gz
CMake-d8ed9ef12151ad36c7cc9bb1908e7866a1e61bd0.tar.bz2
ENH: fix bug 1324
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx32
-rw-r--r--Source/cmLocalVisualStudio7Generator.h3
2 files changed, 26 insertions, 9 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 50e65f9..0578fe8 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -284,11 +284,16 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
{
// create a map of xml tags to the values they should have in the output
// for example, "BufferSecurityCheck" = "TRUE"
- // first fill this table with the values for the configuration Debug, Release, etc,
- // Then parse the command line flags specified in CMAKE_CXX_FLAGS and CMAKE_C_FLAGS
+ // first fill this table with the values for the configuration
+ // Debug, Release, etc,
+ // Then parse the command line flags specified in CMAKE_CXX_FLAGS
+ // and CMAKE_C_FLAGS
// and overwrite or add new values to this map
std::map<cmStdString, cmStdString> flagMap;
-
+ // since the default is on for this, but if /EHsc is found
+ // in the flags it will be turned on and we have /EHSC on by
+ // default in the CXX flags, then this is the only way to turn this off
+ flagMap["ExceptionHandling"] = "FALSE";
const char* mfcFlag = m_Makefile->GetDefinition("CMAKE_MFC_FLAG");
if(!mfcFlag)
{
@@ -431,7 +436,16 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
// now fill the flagMap from the command line flags, and
// if a flag is used, it will be removed from the flags string by
// this function call
- this->FillFlagMapFromCommandFlags(flagMap, &cmLocalVisualStudio7GeneratorFlagTable[0], flags);
+ this->FillFlagMapFromCommandFlags(flagMap,
+ &cmLocalVisualStudio7GeneratorFlagTable[0],
+ flags);
+ std::string defineFlags = m_Makefile->GetDefineFlags();
+ // now check the define flags for flags other than -D and
+ // put them in the map, the -D flags will be left in the defineFlags
+ // variable as -D is not in the flagMap
+ this->FillFlagMapFromCommandFlags(flagMap,
+ &cmLocalVisualStudio7GeneratorFlagTable[0],
+ defineFlags);
// output remaining flags that were not mapped to anything
fout << this->EscapeForXML(flags.c_str()).c_str();
fout << " -DCMAKE_INTDIR=\\&quot;" << configName << "\\&quot;"
@@ -478,7 +492,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
}
fout << "," << exportSymbol;
}
- this->OutputDefineFlags(fout);
+ this->OutputDefineFlags(defineFlags.c_str(), fout);
fout << "\"\n";
fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
fout << "\t\t\t\tObjectFile=\"" << configName << "\\\"\n";
@@ -500,9 +514,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
std::string ipath = this->ConvertToXMLOutputPath(i->c_str());
fout << ipath << ";";
}
+ // add the -D flags to the RC tool
fout << "\"\n"
<< "\t\t\t\tPreprocessorDefinitions=\"" << pre;
- this->OutputDefineFlags(fout);
+ this->OutputDefineFlags(defineFlags.c_str(), fout);
fout << "\" />\n";
fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n";
this->OutputTargetRules(fout, target, libName);
@@ -842,9 +857,10 @@ void cmLocalVisualStudio7Generator::OutputLibraries(std::ostream& fout,
}
}
-void cmLocalVisualStudio7Generator::OutputDefineFlags(std::ostream& fout)
+void cmLocalVisualStudio7Generator::OutputDefineFlags(const char* flags,
+ std::ostream& fout)
{
- std::string defs = m_Makefile->GetDefineFlags();
+ std::string defs = flags;
cmSystemTools::ReplaceString(defs, "/D","-D");
std::string::size_type pos = defs.find("-D");
bool done = pos == std::string::npos;
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 52d1624..a6608bc 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -89,7 +89,8 @@ private:
std::string EscapeForXML(const char* s);
std::string ConvertToXMLOutputPath(const char* path);
std::string ConvertToXMLOutputPathSingle(const char* path);
- void OutputDefineFlags(std::ostream& fout);
+ void OutputDefineFlags(const char* flags,
+ std::ostream& fout);
void OutputTargetRules(std::ostream& fout,
const cmTarget &target,
const char *libName);