diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-06-15 09:23:49 -0400 |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-06-22 09:13:16 -0400 |
commit | 7628153edb74ef29e3322fd4163754e301b9cb9a (patch) | |
tree | d2c66602ea5185b4667b40d02af9306d3b0c4929 /Source/cmSourceFileLocation.cxx | |
parent | 6f7853cb42b75715d38a71bce3123390b78a502a (diff) | |
download | cmake-7628153edb74ef29e3322fd4163754e301b9cb9a.tar.gz |
Refactor file extension queries to be more consistent
It was very easy to forgot to check against all language file
extensions. This updates the internal API to have a unified API.
Diffstat (limited to 'Source/cmSourceFileLocation.cxx')
-rw-r--r-- | Source/cmSourceFileLocation.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index e852c05bab..222bafac88 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -101,7 +101,7 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name) cmMakefile const* mf = this->Makefile; auto cm = mf->GetCMakeInstance(); if (!gg->GetLanguageFromExtension(ext.c_str()).empty() || - cm->IsSourceExtension(ext) || cm->IsHeaderExtension(ext)) { + cm->IsAKnownExtension(ext)) { // This is a known extension. Use the given filename with extension. this->Name = cmSystemTools::GetFilenameName(name); this->AmbiguousExtension = false; @@ -157,7 +157,7 @@ bool cmSourceFileLocation::MatchesAmbiguousExtension( auto ext = cm::string_view(this->Name).substr(loc.Name.size() + 1); cmMakefile const* mf = this->Makefile; auto cm = mf->GetCMakeInstance(); - return cm->IsSourceExtension(ext) || cm->IsHeaderExtension(ext); + return cm->IsAKnownExtension(ext); } bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc) |