summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-20 13:22:12 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-03-20 13:22:12 (GMT)
commit86b003c3c682c3d3ec42d73a183c695f04d0ddb2 (patch)
treee1da4ef14a53702fda7cf61333d89d0d14a0405e /Source/cmMakefile.cxx
parent7bf8a549f9074b06d018419f1660573a412f695e (diff)
parent2600e923a66a86784f756c7d5b9a8b06c5848576 (diff)
downloadCMake-86b003c3c682c3d3ec42d73a183c695f04d0ddb2.zip
CMake-86b003c3c682c3d3ec42d73a183c695f04d0ddb2.tar.gz
CMake-86b003c3c682c3d3ec42d73a183c695f04d0ddb2.tar.bz2
Merge topic 'add_custom_command-no-INTERFACE-lib'
2600e923 Disallow INTERFACE libraries with add_custom_command(TARGET).
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 58625fb..ad9de60 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -926,6 +926,14 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
this->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
}
+ if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "Target \"" << target << "\" is an INTERFACE library "
+ "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
+ this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return;
+ }
// Add the command to the appropriate build step for the target.
std::vector<std::string> no_output;
cmCustomCommand cc(this, no_output, depends,