summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
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()));
+}