summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-02-20 14:35:21 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-02-20 14:35:21 (GMT)
commit1d8e7e9411f62a60340b1edba6c55a8e7548a93b (patch)
tree932198ce265b630740c8340c0e2d0a8a723919bc /Source/cmLocalVisualStudio7Generator.cxx
parent5c0a340a9e0146841b14065497373cb9a79d5768 (diff)
downloadCMake-1d8e7e9411f62a60340b1edba6c55a8e7548a93b.zip
CMake-1d8e7e9411f62a60340b1edba6c55a8e7548a93b.tar.gz
CMake-1d8e7e9411f62a60340b1edba6c55a8e7548a93b.tar.bz2
BUG: fix for bug 4423 set language fixes
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index b69d9bb..642b78f 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1148,9 +1148,16 @@ void cmLocalVisualStudio7Generator
}
const char* lang = this->GlobalGenerator->GetLanguageFromExtension
((*sf)->GetSourceExtension().c_str());
+ const char* sourceLang = this->GetSourceFileLanguage(*(*sf));
const char* linkLanguage = target.GetLinkerLanguage
(this->GetGlobalGenerator());
-
+ bool needForceLang = false;
+ // source file does not match its extension language
+ if(lang && sourceLang && strcmp(lang, sourceLang) != 0)
+ {
+ needForceLang = true;
+ lang = sourceLang;
+ }
// If lang is set, the compiler will generate code automatically.
// If HEADER_FILE_ONLY is set, we must suppress this generation in
// the project file
@@ -1159,7 +1166,7 @@ void cmLocalVisualStudio7Generator
// if the source file does not match the linker language
// then force c or c++
- if(linkLanguage && lang && strcmp(lang, linkLanguage) != 0)
+ if(needForceLang || (linkLanguage && lang && strcmp(lang, linkLanguage) != 0))
{
if(strcmp(lang, "CXX") == 0)
{