diff options
author | Brad King <brad.king@kitware.com> | 2008-01-17 15:00:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-17 15:00:19 (GMT) |
commit | 18b9e7db6c84bfe3936d33e7c7ca86a544f3e818 (patch) | |
tree | a24be738857d8de87efdba3ebae30a7795d54016 /Source/cmLocalVisualStudio6Generator.cxx | |
parent | 81af53e3c0b00005d2cf81a4a5482474573dd4b1 (diff) | |
download | CMake-18b9e7db6c84bfe3936d33e7c7ca86a544f3e818.zip CMake-18b9e7db6c84bfe3936d33e7c7ca86a544f3e818.tar.gz CMake-18b9e7db6c84bfe3936d33e7c7ca86a544f3e818.tar.bz2 |
ENH: Enable CMAKE_<lang>_DEFINE_FLAG for COMPILE_DEFINITIONS property implementation.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 9465275..a79f8a7 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -413,42 +413,42 @@ void cmLocalVisualStudio6Generator compileFlags += cflags; } + const char* lang = this->GetSourceFileLanguage(*(*sf)); + if(lang) + { + if(strcmp(lang, "CXX") == 0) + { + // force a C++ file type + compileFlags += " /TP "; + } + else if(strcmp(lang, "C") == 0) + { + // force to c file type + compileFlags += " /TC "; + } + } + // Add per-source and per-configuration preprocessor definitions. std::map<cmStdString, cmStdString> cdmap; this->AppendDefines(compileFlags, - (*sf)->GetProperty("COMPILE_DEFINITIONS")); + (*sf)->GetProperty("COMPILE_DEFINITIONS"), lang); if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_DEBUG")) { - this->AppendDefines(cdmap["DEBUG"], cdefs); + this->AppendDefines(cdmap["DEBUG"], cdefs, lang); } if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_RELEASE")) { - this->AppendDefines(cdmap["RELEASE"], cdefs); + this->AppendDefines(cdmap["RELEASE"], cdefs, lang); } if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_MINSIZEREL")) { - this->AppendDefines(cdmap["MINSIZEREL"], cdefs); + this->AppendDefines(cdmap["MINSIZEREL"], cdefs, lang); } if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO")) { - this->AppendDefines(cdmap["RELWITHDEBINFO"], cdefs); - } - - const char* lang = this->GetSourceFileLanguage(*(*sf)); - if(lang) - { - if(strcmp(lang, "CXX") == 0) - { - // force a C++ file type - compileFlags += " /TP "; - } - else if(strcmp(lang, "C") == 0) - { - // force to c file type - compileFlags += " /TC "; - } + this->AppendDefines(cdmap["RELWITHDEBINFO"], cdefs, lang); } bool excludedFromBuild = @@ -1503,17 +1503,17 @@ void cmLocalVisualStudio6Generator } // Add per-target and per-configuration preprocessor definitions. - this->AppendDefines(flags, target.GetProperty("COMPILE_DEFINITIONS")); + this->AppendDefines(flags, target.GetProperty("COMPILE_DEFINITIONS"), 0); this->AppendDefines(flagsDebug, - target.GetProperty("COMPILE_DEFINITIONS_DEBUG")); + target.GetProperty("COMPILE_DEFINITIONS_DEBUG"), 0); this->AppendDefines(flagsRelease, - target.GetProperty("COMPILE_DEFINITIONS_RELEASE")); + target.GetProperty("COMPILE_DEFINITIONS_RELEASE"), 0); this->AppendDefines (flagsMinSize, - target.GetProperty("COMPILE_DEFINITIONS_MINSIZEREL")); + target.GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"), 0); this->AppendDefines (flagsDebugRel, - target.GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO")); + target.GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"), 0); // 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 |