MCPcopy Create free account
hub / github.com/Kitware/CMake / CheckExtension

Method CheckExtension

Source/cmSourceFile.cxx:263–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void cmSourceFile::CheckExtension()
264{
265 // Compute the extension.
266 cm::string_view realExt =
267 cmSystemTools::GetFilenameLastExtensionView(this->FullPath);
268 if (!realExt.empty()) {
269 // Store the extension without the leading '.'.
270 this->Extension = std::string(realExt.substr(1));
271 }
272
273 // Look for object files.
274 if (this->Extension == "obj" || this->Extension == "o" ||
275 this->Extension == "lo") {
276 this->SetProperty("EXTERNAL_OBJECT", "1");
277 }
278
279 // Try to identify the source file language from the extension.
280 if (this->Language.empty()) {
281 this->CheckLanguage(this->Extension);
282 }
283}
284
285void cmSourceFile::CheckLanguage(cm::string_view ext)
286{

Callers 1

cmSourceFile.cxxFile · 0.80

Calls 4

SetPropertyMethod · 0.95
CheckLanguageMethod · 0.95
emptyMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected