Merge branch 'custom-command-expand-empty' into release-3.11

Merge-request: !2074
This commit is contained in:
Brad King 2018-05-14 11:54:37 -04:00
commit 813bcc2997
3 changed files with 10 additions and 0 deletions

View File

@ -40,6 +40,14 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
argv.push_back(std::move(parsed_arg));
}
}
// Later code assumes at least one entry exists, but expanding
// lists on an empty command may have left this empty.
// FIXME: Should we define behavior for removing empty commands?
if (argv.empty()) {
argv.push_back(std::string());
}
this->CommandLines.push_back(std::move(argv));
}

View File

@ -0,0 +1 @@
add_custom_target(EmptyCustom COMMAND "" COMMAND_EXPAND_LISTS)

View File

@ -1,5 +1,6 @@
include(RunCMake)
run_cmake(CommandExpandsEmpty)
run_cmake(NoArguments)
run_cmake(BadTargetName)
run_cmake(ByproductsNoCommand)