summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFile.cxx
diff options
context:
space:
mode:
authorTushar Maheshwari <tushar27192@gmail.com>2019-08-27 06:49:43 (GMT)
committerTushar Maheshwari <tushar27192@gmail.com>2019-08-27 16:11:12 (GMT)
commita40744c81a8d6dad994def5a63103fc229a75afc (patch)
treeb6335dd49ba8acdc7aa2f246e89c89e1b8015578 /Source/cmSourceFile.cxx
parent8cb3cffa42e11c2508ed8db703f2f9a1a73fbbb9 (diff)
downloadCMake-a40744c81a8d6dad994def5a63103fc229a75afc.zip
CMake-a40744c81a8d6dad994def5a63103fc229a75afc.tar.gz
CMake-a40744c81a8d6dad994def5a63103fc229a75afc.tar.bz2
cmSourceFile: Move LANGUAGE to GetPropertyForUser
- Remove the special case from cmGetSourceFilePropertyCommand Tests: check LANGUAGE for source file - use target_sources to add file - use get_property to read property value
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r--Source/cmSourceFile.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 738a1c0..5d738d5 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -272,6 +272,13 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
this->GetFullPath();
}
+ // Similarly, LANGUAGE can be determined by the file extension
+ // if it is requested by the user.
+ if (prop == propLANGUAGE) {
+ // The c_str pointer is valid until `this->Language` is modified.
+ return this->GetOrDetermineLanguage().c_str();
+ }
+
// Perform the normal property lookup.
return this->GetProperty(prop);
}