add_custom_target: Add output checks for custom target byproducts

Use the output checks for byproducts of add_custom_command also for byproducts
of add_custom_target.
This commit is contained in:
Daniel Eiband
2019-09-23 22:18:36 +02:00
parent cbb861ade8
commit a1cc6b4447
11 changed files with 122 additions and 43 deletions
+6
View File
@@ -4,6 +4,7 @@
#include <utility>
#include "cmCheckCustomOutputs.h"
#include "cmCustomCommandLines.h"
#include "cmExecutionStatus.h"
#include "cmGeneratorExpression.h"
@@ -205,6 +206,11 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args,
return false;
}
// Make sure the byproduct names and locations are safe.
if (!cmCheckCustomOutputs(byproducts, "BYPRODUCTS", status)) {
return false;
}
// Add the utility target to the makefile.
bool escapeOldStyle = !verbatim;
cmTarget* target = mf.AddUtilityCommand(