diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2018-01-09 13:40:48 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2018-01-10 16:21:11 (GMT) |
commit | b0716fbcc5be83ecd082e8b6d101f1137d6f16f8 (patch) | |
tree | f93425efeb3e11cb4cd2af9c771e1b5632571fa9 /Source/cmMakefile.cxx | |
parent | ddc4f9a3c05fa24240fde1ba6c0ab28b7d2e91ea (diff) | |
download | CMake-b0716fbcc5be83ecd082e8b6d101f1137d6f16f8.zip CMake-b0716fbcc5be83ecd082e8b6d101f1137d6f16f8.tar.gz CMake-b0716fbcc5be83ecd082e8b6d101f1137d6f16f8.tar.bz2 |
cmSourceFileLocation: allow skipping ambiguous extensions
The ambiguous extension logic is an old behavior that ends up taking
lots of extra compute cycles to execute. This is triggered by various
CMake codepaths which pass extension-less paths down when CMake actually
knows that they are not ambiguous. These codepaths will be indicated in
upcoming changes.
Various APIs have gained a cmSourceFileLocationKind parameter, but they
are all optional and default to the existing behavior.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d069a5c..5e32e15 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3132,9 +3132,10 @@ void cmMakefile::SetArgcArgv(const std::vector<std::string>& args) } } -cmSourceFile* cmMakefile::GetSource(const std::string& sourceName) const +cmSourceFile* cmMakefile::GetSource(const std::string& sourceName, + cmSourceFileLocationKind kind) const { - cmSourceFileLocation sfl(this, sourceName); + cmSourceFileLocation sfl(this, sourceName, kind); auto name = this->GetCMakeInstance()->StripExtension(sfl.GetName()); #if defined(_WIN32) || defined(__APPLE__) name = cmSystemTools::LowerCase(name); @@ -3151,9 +3152,10 @@ cmSourceFile* cmMakefile::GetSource(const std::string& sourceName) const } cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName, - bool generated) + bool generated, + cmSourceFileLocationKind kind) { - cmSourceFile* sf = new cmSourceFile(this, sourceName); + cmSourceFile* sf = new cmSourceFile(this, sourceName, kind); if (generated) { sf->SetProperty("GENERATED", "1"); } @@ -3170,12 +3172,13 @@ cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName, } cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName, - bool generated) + bool generated, + cmSourceFileLocationKind kind) { - if (cmSourceFile* esf = this->GetSource(sourceName)) { + if (cmSourceFile* esf = this->GetSource(sourceName, kind)) { return esf; } - return this->CreateSource(sourceName, generated); + return this->CreateSource(sourceName, generated, kind); } void cmMakefile::AddTargetObject(std::string const& tgtName, |