summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraCodeLiteGenerator.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-07-04 10:59:55 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-07-04 11:46:19 (GMT)
commit90b5289c55c29f0c183e878944924203bf1832db (patch)
tree8bfb872cc7938f08116f2b8b8e6e046bb9f43f5c /Source/cmExtraCodeLiteGenerator.cxx
parente50fa44a351cb4ea10267f98868d5a54efaa1a1d (diff)
downloadCMake-90b5289c55c29f0c183e878944924203bf1832db.zip
CMake-90b5289c55c29f0c183e878944924203bf1832db.tar.gz
CMake-90b5289c55c29f0c183e878944924203bf1832db.tar.bz2
cmExtraCodeLiteGenerator: Use cmake::Is*Extension for file type detection
In cmExtraCodeLiteGenerator.cxx use `cmake::Is*Extension` methods instead of `cmSystemTools::GetFileFormat` for file type detection.
Diffstat (limited to 'Source/cmExtraCodeLiteGenerator.cxx')
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 6fe8c14..30b3f0d 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -217,22 +217,21 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
case cmStateEnums::STATIC_LIBRARY:
case cmStateEnums::SHARED_LIBRARY:
case cmStateEnums::MODULE_LIBRARY: {
+ cmake const* cm = makefile->GetCMakeInstance();
std::vector<cmSourceFile*> sources;
gt->GetSourceFiles(sources,
makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (cmSourceFile* s : sources) {
+ std::string const& fullPath = s->GetFullPath();
+ std::string const& extLower =
+ cmSystemTools::LowerCase(s->GetExtension());
// check whether it is a source or a include file
// then put it accordingly into one of the two containers
- switch (cmSystemTools::GetFileFormat(s->GetExtension())) {
- case cmSystemTools::C_FILE_FORMAT:
- case cmSystemTools::CXX_FILE_FORMAT:
- case cmSystemTools::CUDA_FILE_FORMAT:
- case cmSystemTools::FORTRAN_FILE_FORMAT: {
- cFiles[s->GetFullPath()] = s;
- } break;
- default: {
- otherFiles.insert(s->GetFullPath());
- }
+ if (cm->IsSourceExtension(extLower) || cm->IsCudaExtension(extLower) ||
+ cm->IsFortranExtension(extLower)) {
+ cFiles[fullPath] = s;
+ } else {
+ otherFiles.insert(fullPath);
}
}
}