summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2010-08-26 19:54:43 (GMT)
committerAlex Neundorf <neundorf@kde.org>2010-08-26 19:54:43 (GMT)
commit6aef6d84d7faa5e5f0e93237f991a8ef134ddff9 (patch)
tree9b955e6612f82e36d6fc0b3df9b5604dccd8fe76
parentc7866351494885cee1d1d5747ec2bc03fe845f6f (diff)
downloadCMake-6aef6d84d7faa5e5f0e93237f991a8ef134ddff9.zip
CMake-6aef6d84d7faa5e5f0e93237f991a8ef134ddff9.tar.gz
CMake-6aef6d84d7faa5e5f0e93237f991a8ef134ddff9.tar.bz2
Just warn in case of a bad target as only argument for t_l_l()
As discussed on cmake-devel, if target_link_libraries() is called with only one argument, and this one argument is not a valid target, just print a warning but don't fail, since otherwise probably some existing code somewhere might stop building. Alex
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 390e39b..e92a8fa 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -38,8 +38,18 @@ bool cmTargetLinkLibrariesCommand
cmOStringStream e;
e << "Cannot specify link libraries for target \"" << args[0] << "\" "
<< "which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
- cmSystemTools::SetFatalErrorOccured();
+ // The bad target is the only argument, just warn, don't fail, because
+ // there is probably some code out there which would stop building
+ // otherwise:
+ if (args.size() < 2)
+ {
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ }
+ else
+ {
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ cmSystemTools::SetFatalErrorOccured();
+ }
return true;
}