use c flags with c and not cxx flags, also force c++ for c files
This commit is contained in:
parent
bd47afa2cd
commit
8f6b7e7bad
@ -895,22 +895,27 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
|
|||||||
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
|
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
|
||||||
flags = " ";
|
flags = " ";
|
||||||
flags = m_Makefile->GetDefinition("CMAKE_CXX_FLAGS");
|
flags = m_Makefile->GetDefinition("CMAKE_CXX_FLAGS");
|
||||||
flags += " ";
|
// force a C++ file type
|
||||||
|
flags += " /TP ";
|
||||||
}
|
}
|
||||||
// if C and the target is not CXX
|
// if C and the target is not CXX
|
||||||
else if(gen->GetLanguageEnabled("C") && !target.HasCxx())
|
else if(gen->GetLanguageEnabled("C") && !target.HasCxx())
|
||||||
{
|
{
|
||||||
flagsRelease += m_Makefile->GetDefinition("CMAKE_CXX_FLAGS_RELEASE");
|
flagsRelease += m_Makefile->GetDefinition("CMAKE_C_FLAGS_RELEASE");
|
||||||
flagsRelease += " -DCMAKE_INTDIR=\\\"Release\\\"";
|
flagsRelease += " -DCMAKE_INTDIR=\\\"Release\\\"";
|
||||||
flagsMinSize += m_Makefile->GetDefinition("CMAKE_CXX_FLAGS_MINSIZEREL");
|
flagsMinSize += m_Makefile->GetDefinition("CMAKE_C_FLAGS_MINSIZEREL");
|
||||||
flagsMinSize += " -DCMAKE_INTDIR=\\\"MinSizeRel\\\"";
|
flagsMinSize += " -DCMAKE_INTDIR=\\\"MinSizeRel\\\"";
|
||||||
flagsDebug += m_Makefile->GetDefinition("CMAKE_CXX_FLAGS_DEBUG");
|
flagsDebug += m_Makefile->GetDefinition("CMAKE_C_FLAGS_DEBUG");
|
||||||
flagsDebug += " -DCMAKE_INTDIR=\\\"Debug\\\"";
|
flagsDebug += " -DCMAKE_INTDIR=\\\"Debug\\\"";
|
||||||
flagsDebugRel += m_Makefile->GetDefinition("CMAKE_CXX_FLAGS_RELWITHDEBINFO");
|
flagsDebugRel += m_Makefile->GetDefinition("CMAKE_C_FLAGS_RELWITHDEBINFO");
|
||||||
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\"";
|
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\"";
|
||||||
flags = " ";
|
flags = " ";
|
||||||
flags = m_Makefile->GetDefinition("CMAKE_C_FLAGS");
|
flags = m_Makefile->GetDefinition("CMAKE_C_FLAGS");
|
||||||
}
|
}
|
||||||
|
// The template files have CXX FLAGS in them, that need to be replaced.
|
||||||
|
// There are not separate CXX and C template files, so we use the same
|
||||||
|
// variable names. The previous code sets up flags* variables to contain
|
||||||
|
// the correct C or CXX flags
|
||||||
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELEASE", flagsRelease.c_str());
|
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_RELEASE", flagsRelease.c_str());
|
||||||
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_MINSIZEREL", flagsMinSize.c_str());
|
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_MINSIZEREL", flagsMinSize.c_str());
|
||||||
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG", flagsDebug.c_str());
|
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG", flagsDebug.c_str());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user