summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-03-14 17:00:22 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-03-14 17:00:22 (GMT)
commit8f6b7e7bad630843514e9e8f6a7866ad55a2cea7 (patch)
tree5b9b41dcbaf335fee910392275a354c15db77967
parentbd47afa2cd5e985eea2bac9dce8fe1d82df65295 (diff)
downloadCMake-8f6b7e7bad630843514e9e8f6a7866ad55a2cea7.zip
CMake-8f6b7e7bad630843514e9e8f6a7866ad55a2cea7.tar.gz
CMake-8f6b7e7bad630843514e9e8f6a7866ad55a2cea7.tar.bz2
use c flags with c and not cxx flags, also force c++ for c files
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index bb251d3..5b5ce0b 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -895,22 +895,27 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
flags = " ";
flags = m_Makefile->GetDefinition("CMAKE_CXX_FLAGS");
- flags += " ";
+ // force a C++ file type
+ flags += " /TP ";
}
// if C and the target is not CXX
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\\\"";
- flagsMinSize += m_Makefile->GetDefinition("CMAKE_CXX_FLAGS_MINSIZEREL");
+ flagsMinSize += m_Makefile->GetDefinition("CMAKE_C_FLAGS_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\\\"";
- flagsDebugRel += m_Makefile->GetDefinition("CMAKE_CXX_FLAGS_RELWITHDEBINFO");
+ flagsDebugRel += m_Makefile->GetDefinition("CMAKE_C_FLAGS_RELWITHDEBINFO");
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\"";
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_MINSIZEREL", flagsMinSize.c_str());
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG", flagsDebug.c_str());