summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-03 13:26:07 (GMT)
committerBrad King <brad.king@kitware.com>2006-08-03 13:26:07 (GMT)
commit88702ff4424478dac8efef80324437632584fbff (patch)
tree74830590180dc323706fbca7324241318db012bc /Source/cmLocalGenerator.cxx
parente647052d4986de9cbe852faa1d79c03147cea13a (diff)
downloadCMake-88702ff4424478dac8efef80324437632584fbff.zip
CMake-88702ff4424478dac8efef80324437632584fbff.tar.gz
CMake-88702ff4424478dac8efef80324437632584fbff.tar.bz2
ENH: Moved GetSourceFileLanguage up to cmLocalGenerator.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index e604320..fdeed5b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2198,3 +2198,19 @@ cmLocalGenerator::GetObjectFileNameWithoutTarget(const cmSourceFile& source)
// Convert to a safe name.
return this->CreateSafeUniqueObjectFileName(objectName.c_str());
}
+
+//----------------------------------------------------------------------------
+const char*
+cmLocalGenerator
+::GetSourceFileLanguage(const cmSourceFile& source)
+{
+ // Check for an explicitly assigned language.
+ if(const char* lang = source.GetProperty("LANGUAGE"))
+ {
+ return lang;
+ }
+
+ // Infer the language from the source file extension.
+ return (this->GlobalGenerator
+ ->GetLanguageFromExtension(source.GetSourceExtension().c_str()));
+}