mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-03 05:08:47 -06:00
CMP0050: Remove support for OLD behavior
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
|
||||
@@ -590,44 +589,10 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
|
||||
cc->SetImplicitDepends(implicit_depends);
|
||||
mf.AddCustomCommandToOutput(std::move(cc));
|
||||
} else {
|
||||
if (!byproducts.empty()) {
|
||||
status.SetError(
|
||||
"BYPRODUCTS may not be specified with SOURCE signatures");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (uses_terminal) {
|
||||
status.SetError("USES_TERMINAL may not be used with SOURCE signatures");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool issueMessage = true;
|
||||
std::ostringstream e;
|
||||
MessageType messageType = MessageType::AUTHOR_WARNING;
|
||||
switch (mf.GetPolicyStatus(cmPolicies::CMP0050)) {
|
||||
case cmPolicies::WARN:
|
||||
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0050) << "\n";
|
||||
break;
|
||||
case cmPolicies::OLD:
|
||||
issueMessage = false;
|
||||
break;
|
||||
case cmPolicies::NEW:
|
||||
messageType = MessageType::FATAL_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
if (issueMessage) {
|
||||
e << "The SOURCE signatures of add_custom_command are no longer "
|
||||
"supported.";
|
||||
mf.IssueMessage(messageType, e.str());
|
||||
if (messageType == MessageType::FATAL_ERROR) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Use the old-style mode for backward compatibility.
|
||||
mf.AddCustomCommandOldStyle(target, outputs, depends, source, commandLines,
|
||||
comment);
|
||||
mf.IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
"The SOURCE signatures of add_custom_command are no longer supported.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user