diff options
author | Brad King <brad.king@kitware.com> | 2006-08-03 13:26:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-08-03 13:26:07 (GMT) |
commit | 88702ff4424478dac8efef80324437632584fbff (patch) | |
tree | 74830590180dc323706fbca7324241318db012bc /Source/cmLocalGenerator.cxx | |
parent | e647052d4986de9cbe852faa1d79c03147cea13a (diff) | |
download | CMake-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.cxx | 16 |
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())); +} |