diff options
author | Brad King <brad.king@kitware.com> | 2020-07-23 17:19:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-23 17:31:16 (GMT) |
commit | bce82df0aaa4046b31fcf0608f0ce1249bdfc9bd (patch) | |
tree | b2e4f3f81f2048693c9cf0ec31cb015015fb885b | |
parent | 6fd7ca5e5126067b2b346b76473adf240fcd8151 (diff) | |
download | CMake-bce82df0aaa4046b31fcf0608f0ce1249bdfc9bd.zip CMake-bce82df0aaa4046b31fcf0608f0ce1249bdfc9bd.tar.gz CMake-bce82df0aaa4046b31fcf0608f0ce1249bdfc9bd.tar.bz2 |
cmGeneratorTarget: Remove unnecessary target type check in dependency tracing
Since commit 2600e923a6 (Disallow INTERFACE libraries with
add_custom_command(TARGET)., 2014-03-19, v3.0.0-rc3~1^2), we do not
trace dependencies of INTERFACE libraries that do not participate in the
build system. Therefore we can remove a check of the target type from
the implementation that had been added by commit 9db9c1fc8b (cmTarget:
Don't try to get sources of an INTERFACE_LIBRARY., 2014-02-14,
v3.0.0-rc1~20^2).
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index b10ce89..bfefbe6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2813,29 +2813,26 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target) this->CurrentEntry = nullptr; // Queue all the source files already specified for the target. - if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { - std::set<cmSourceFile*> emitted; - std::vector<std::string> const& configs = - this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); - for (std::string const& c : configs) { - std::vector<cmSourceFile*> sources; - this->GeneratorTarget->GetSourceFiles(sources, c); - for (cmSourceFile* sf : sources) { - const std::set<cmGeneratorTarget const*> tgts = - this->GlobalGenerator->GetFilenameTargetDepends(sf); - if (cm::contains(tgts, this->GeneratorTarget)) { - std::ostringstream e; - e << "Evaluation output file\n \"" << sf->ResolveFullPath() - << "\"\ndepends on the sources of a target it is used in. This " - "is a dependency loop and is not allowed."; - this->GeneratorTarget->LocalGenerator->IssueMessage( - MessageType::FATAL_ERROR, e.str()); - return; - } - if (emitted.insert(sf).second && - this->SourcesQueued.insert(sf).second) { - this->SourceQueue.push(sf); - } + std::set<cmSourceFile*> emitted; + std::vector<std::string> const& configs = + this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); + for (std::string const& c : configs) { + std::vector<cmSourceFile*> sources; + this->GeneratorTarget->GetSourceFiles(sources, c); + for (cmSourceFile* sf : sources) { + const std::set<cmGeneratorTarget const*> tgts = + this->GlobalGenerator->GetFilenameTargetDepends(sf); + if (cm::contains(tgts, this->GeneratorTarget)) { + std::ostringstream e; + e << "Evaluation output file\n \"" << sf->ResolveFullPath() + << "\"\ndepends on the sources of a target it is used in. This " + "is a dependency loop and is not allowed."; + this->GeneratorTarget->LocalGenerator->IssueMessage( + MessageType::FATAL_ERROR, e.str()); + return; + } + if (emitted.insert(sf).second && this->SourcesQueued.insert(sf).second) { + this->SourceQueue.push(sf); } } } |