summaryrefslogtreecommitdiff
path: root/Source/cmAuxSourceDirectoryCommand.cxx
diff options
context:
space:
mode:
authorAaron Orenstein <aorenste@fb.com>2017-10-26 22:41:04 -0700
committerBrad King <brad.king@kitware.com>2017-11-17 10:25:41 -0500
commit4a6348dbbd35c51fabf01d517357129ed9480c85 (patch)
treeb38bcaa7a1416dd90f16a54651ea61cf0cfa1f1c /Source/cmAuxSourceDirectoryCommand.cxx
parent1fe9e49bad0ad4f540ceda028106d9af89084946 (diff)
downloadcmake-4a6348dbbd35c51fabf01d517357129ed9480c85.tar.gz
Performance: Improve efficiency of source file lookup in cmMakefile
This reintroduces the change from commit v3.10.0-rc1~69^2 (Performance: Improve efficiency of source file lookup in cmMakefile, 2017-08-17) with some corrections. The original was rolled back by commit v3.10.0-rc1~52^2~1 (Revert "Performance: ...", 2017-09-25) due to incompatibilities found. The rollback was followed-up by addition of a test for the offending case, and this revision passes the test.
Diffstat (limited to 'Source/cmAuxSourceDirectoryCommand.cxx')
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index 847a416604..fcdc632ec1 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -54,10 +54,8 @@ bool cmAuxSourceDirectoryCommand::InitialPass(
std::string ext = file.substr(dotpos + 1);
std::string base = file.substr(0, dotpos);
// Process only source files
- std::vector<std::string> const& srcExts =
- this->Makefile->GetCMakeInstance()->GetSourceExtensions();
- if (!base.empty() &&
- std::find(srcExts.begin(), srcExts.end(), ext) != srcExts.end()) {
+ auto cm = this->Makefile->GetCMakeInstance();
+ if (!base.empty() && cm->IsSourceExtension(ext)) {
std::string fullname = templateDirectory;
fullname += "/";
fullname += file;