summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-10-16 14:32:47 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-10-16 14:32:47 (GMT)
commit4d2ca08bc7a91fcc207ec481323796acdf68eec6 (patch)
tree7bb25d6dee9be5caf919e84dbbb4f20392984bb2
parent073a5b69b72ee04fab9fa3253c113f9531798c66 (diff)
downloadCMake-4d2ca08bc7a91fcc207ec481323796acdf68eec6.zip
CMake-4d2ca08bc7a91fcc207ec481323796acdf68eec6.tar.gz
CMake-4d2ca08bc7a91fcc207ec481323796acdf68eec6.tar.bz2
ENH: allow UNICODE to be specifed in the cxx flags and if not default to MBCS
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx6
-rw-r--r--Templates/DLLHeader.dsptemplate14
-rw-r--r--Templates/EXEHeader.dsptemplate16
-rw-r--r--Templates/EXEWinHeader.dsptemplate16
-rw-r--r--Templates/staticLibHeader.dsptemplate16
5 files changed, 37 insertions, 31 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 3168f81..4d56017 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1005,6 +1005,12 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
flags = " ";
flags = m_Makefile->GetDefinition("CMAKE_C_FLAGS");
}
+ // if unicode is not found, then add -D_MBCS
+ if(flags.find("D_UNICODE") == flags.npos)
+ {
+ flags += " /D \"_MBCS\"";
+ }
+
// 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
diff --git a/Templates/DLLHeader.dsptemplate b/Templates/DLLHeader.dsptemplate
index 0a05711..2e4a13d 100644
--- a/Templates/DLLHeader.dsptemplate
+++ b/Templates/DLLHeader.dsptemplate
@@ -57,8 +57,8 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
@@ -89,7 +89,7 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
@@ -120,9 +120,9 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Intermediate_Dir "MinSizeRel"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
@@ -152,8 +152,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Intermediate_Dir "RelWithDebInfo"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
diff --git a/Templates/EXEHeader.dsptemplate b/Templates/EXEHeader.dsptemplate
index a279d32..190b854 100644
--- a/Templates/EXEHeader.dsptemplate
+++ b/Templates/EXEHeader.dsptemplate
@@ -56,8 +56,8 @@ RSC=rc.exe
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHRelease"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
@@ -86,8 +86,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHDebug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
-# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
-# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
+# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
+# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
@@ -117,8 +117,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHMinSizeRel"
# PROP Intermediate_Dir "MinSizeRel"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# ADD CPP /nologo /D "WIN32" BUILD_INCLUDES EXTRA_DEFINES /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
+# ADD CPP /nologo /D "WIN32" BUILD_INCLUDES EXTRA_DEFINES /D "NDEBUG" /D "_CONSOLE" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
@@ -147,8 +147,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHRelWithDebInfo"
# PROP Intermediate_Dir "RelWithDebInfo"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
diff --git a/Templates/EXEWinHeader.dsptemplate b/Templates/EXEWinHeader.dsptemplate
index 6acebc5..b74a940 100644
--- a/Templates/EXEWinHeader.dsptemplate
+++ b/Templates/EXEWinHeader.dsptemplate
@@ -56,8 +56,8 @@ RSC=rc.exe
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHRelease"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
@@ -88,8 +88,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHDebug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
-# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c
+# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /GZ /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
@@ -120,8 +120,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHMinSizeRel"
# PROP Intermediate_Dir "MinSizeRel"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
@@ -150,8 +150,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHRelWithDebInfo"
# PROP Intermediate_Dir "RelWithDebInfo"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
-# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
diff --git a/Templates/staticLibHeader.dsptemplate b/Templates/staticLibHeader.dsptemplate
index 2eb8ea0..3aef2c3 100644
--- a/Templates/staticLibHeader.dsptemplate
+++ b/Templates/staticLibHeader.dsptemplate
@@ -53,8 +53,8 @@ RSC=rc.exe
# PROP Output_Dir "LIBRARY_OUTPUT_PATHRelease"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
-# ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c
+# ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_LIB" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
@@ -81,8 +81,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Output_Dir "LIBRARY_OUTPUT_PATHDebug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /c
-# ADD CPP /nologo /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /GZ /c
+# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_LIB" /FD /c
+# ADD CPP /nologo /D "_DEBUG" /D "WIN32" /D "_LIB" /FD /GZ /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
@@ -109,8 +109,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Intermediate_Dir "MinSizeRel"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_DLL" /FD /c
-# ADD CPP /nologo /D "NDEBUG" /D "_MBCS" /D "_ATL_DLL" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_ATL_DLL" /FD /c
+# ADD CPP /nologo /D "NDEBUG" /D "_ATL_DLL" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
@@ -137,8 +137,8 @@ CMAKE_CUSTOM_RULE_CODE
# PROP Output_Dir "LIBRARY_OUTPUT_PATHRelWithDebInfo"
# PROP Intermediate_Dir "RelWithDebInfo"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
-# ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c
+# ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_LIB" /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO