BUG: fix crash with vs6
This commit is contained in:
parent
1ffbc81061
commit
e735351b3f
@ -342,7 +342,7 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
|
|||||||
}
|
}
|
||||||
const char* lang =
|
const char* lang =
|
||||||
m_GlobalGenerator->GetLanguageFromExtension((*sf)->GetSourceExtension().c_str());
|
m_GlobalGenerator->GetLanguageFromExtension((*sf)->GetSourceExtension().c_str());
|
||||||
if(strcmp(lang, "CXX") == 0)
|
if(lang && strcmp(lang, "CXX") == 0)
|
||||||
{
|
{
|
||||||
// force a C++ file type
|
// force a C++ file type
|
||||||
compileFlags += " /TP ";
|
compileFlags += " /TP ";
|
||||||
@ -1057,10 +1057,12 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
|
|||||||
std::string flagsMinSize = " ";
|
std::string flagsMinSize = " ";
|
||||||
std::string flagsDebug = " ";
|
std::string flagsDebug = " ";
|
||||||
std::string flagsDebugRel = " ";
|
std::string flagsDebugRel = " ";
|
||||||
|
if(target.GetType() >= cmTarget::EXECUTABLE &&
|
||||||
|
target.GetType() <= cmTarget::MODULE_LIBRARY)
|
||||||
|
{
|
||||||
|
const char* linkLanguage = target.GetLinkerLanguage(this->GetGlobalGenerator());
|
||||||
// if CXX is on and the target contains cxx code then add the cxx flags
|
// if CXX is on and the target contains cxx code then add the cxx flags
|
||||||
std::string baseFlagVar = "CMAKE_";
|
std::string baseFlagVar = "CMAKE_";
|
||||||
const char* linkLanguage = target.GetLinkerLanguage(this->GetGlobalGenerator());
|
|
||||||
baseFlagVar += "CMAKE_";
|
|
||||||
baseFlagVar += linkLanguage;
|
baseFlagVar += linkLanguage;
|
||||||
baseFlagVar += "_FLAGS";
|
baseFlagVar += "_FLAGS";
|
||||||
flags = m_Makefile->GetRequiredDefinition(baseFlagVar.c_str());
|
flags = m_Makefile->GetRequiredDefinition(baseFlagVar.c_str());
|
||||||
@ -1080,6 +1082,7 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
|
|||||||
flagVar = baseFlagVar + "_RELWITHDEBINFO";
|
flagVar = baseFlagVar + "_RELWITHDEBINFO";
|
||||||
flagsDebugRel = m_Makefile->GetRequiredDefinition(flagVar.c_str());
|
flagsDebugRel = m_Makefile->GetRequiredDefinition(flagVar.c_str());
|
||||||
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
|
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
|
||||||
|
}
|
||||||
|
|
||||||
// if unicode is not found, then add -D_MBCS
|
// if unicode is not found, then add -D_MBCS
|
||||||
std::string defs = m_Makefile->GetDefineFlags();
|
std::string defs = m_Makefile->GetDefineFlags();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user