diff options
author | Brad King <brad.king@kitware.com> | 2015-03-30 13:27:53 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-03-30 13:27:53 (GMT) |
commit | c117c2bb5ef162dfa7d4cb2eb1acd0ee48c06297 (patch) | |
tree | 4579c5edd3c408dbb4da3abc8c6038ccee04ecc1 /Source | |
parent | a3bdb5578d54894832195fa29308ceb6b4ceed93 (diff) | |
parent | ac14cbf01710c08e9bf31670cf40d88512b55752 (diff) | |
download | CMake-c117c2bb5ef162dfa7d4cb2eb1acd0ee48c06297.zip CMake-c117c2bb5ef162dfa7d4cb2eb1acd0ee48c06297.tar.gz CMake-c117c2bb5ef162dfa7d4cb2eb1acd0ee48c06297.tar.bz2 |
Merge topic 'add_dependencies-INTERFACE-libraries'
ac14cbf0 Allow add_dependencies() on INTERFACE libraries (#15414)
817d31db Help: Format add_dependencies documentation
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmAddDependenciesCommand.cxx | 9 | ||||
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 6 |
2 files changed, 4 insertions, 11 deletions
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index b560452..3a74946 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -33,15 +33,6 @@ bool cmAddDependenciesCommand } if(cmTarget* target = this->Makefile->FindTargetToUse(target_name)) { - if (target->GetType() == cmTarget::INTERFACE_LIBRARY) - { - std::ostringstream e; - e << "Cannot add target-level dependencies to INTERFACE library " - "target \"" << target_name << "\".\n"; - this->SetError(e.str()); - return false; - } - std::vector<std::string>::const_iterator s = args.begin(); ++s; // skip over target_name for (; s != args.end(); ++s) diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index cf2b88e..bbffd5d 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -418,9 +418,11 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, cmTarget const* dependee, bool linking) { - if(dependee->IsImported()) + if(dependee->IsImported() || + dependee->GetType() == cmTarget::INTERFACE_LIBRARY) { - // Skip imported targets but follow their utility dependencies. + // Skip IMPORTED and INTERFACE targets but follow their utility + // dependencies. std::set<cmLinkItem> const& utils = dependee->GetUtilityItems(); for(std::set<cmLinkItem>::const_iterator i = utils.begin(); i != utils.end(); ++i) |