diff options
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 441f11c..0b12a65 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -432,6 +432,23 @@ void cmState::AddBuiltinCommand(std::string const& name, Command command) this->BuiltinCommands.emplace(name, std::move(command)); } +void cmState::AddBuiltinCommand(std::string const& name, + BuiltinCommand command) +{ + this->AddBuiltinCommand( + name, + [command](const std::vector<cmListFileArgument>& args, + cmExecutionStatus& status) -> bool { + std::vector<std::string> expandedArguments; + if (!status.GetMakefile().ExpandArguments(args, expandedArguments)) { + // There was an error expanding arguments. It was already + // reported, so we can skip this command without error. + return true; + } + return command(expandedArguments, status); + }); +} + void cmState::AddDisallowedCommand(std::string const& name, std::unique_ptr<cmCommand> command, cmPolicies::PolicyID policy, |