mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 03:48:02 +08:00
Genex: Evaluate byproduct generator expressions in cmCustomCommandGenerator
Evaluate and expand generator expressions in byproducts of custom commands. Note that it is still not possible to use generator expressions in byproducts of the commands `add_custom_command` and `add_custom_target`. These commands still reject the input. This is a preparation step for OUTPUT generator expression support. Issue: #12877
This commit is contained in:
@@ -72,6 +72,8 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
|
|||||||
this->CommandLines.push_back(std::move(argv));
|
this->CommandLines.push_back(std::move(argv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AppendPaths(cc.GetByproducts(), *this->GE, this->LG, this->Config,
|
||||||
|
this->Byproducts);
|
||||||
AppendPaths(cc.GetDepends(), *this->GE, this->LG, this->Config,
|
AppendPaths(cc.GetDepends(), *this->GE, this->LG, this->Config,
|
||||||
this->Depends);
|
this->Depends);
|
||||||
|
|
||||||
@@ -248,7 +250,7 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetOutputs() const
|
|||||||
|
|
||||||
std::vector<std::string> const& cmCustomCommandGenerator::GetByproducts() const
|
std::vector<std::string> const& cmCustomCommandGenerator::GetByproducts() const
|
||||||
{
|
{
|
||||||
return this->CC.GetByproducts();
|
return this->Byproducts;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
|
std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
|
||||||
|
@@ -23,6 +23,7 @@ class cmCustomCommandGenerator
|
|||||||
cmGeneratorExpression* GE;
|
cmGeneratorExpression* GE;
|
||||||
cmCustomCommandLines CommandLines;
|
cmCustomCommandLines CommandLines;
|
||||||
std::vector<std::vector<std::string>> EmulatorsWithArguments;
|
std::vector<std::vector<std::string>> EmulatorsWithArguments;
|
||||||
|
std::vector<std::string> Byproducts;
|
||||||
std::vector<std::string> Depends;
|
std::vector<std::string> Depends;
|
||||||
std::string WorkingDirectory;
|
std::string WorkingDirectory;
|
||||||
|
|
||||||
|
@@ -221,7 +221,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
|
|||||||
this->GeneratorTarget->GetPostBuildCommands());
|
this->GeneratorTarget->GetPostBuildCommands());
|
||||||
|
|
||||||
for (const auto& be : buildEventCommands) {
|
for (const auto& be : buildEventCommands) {
|
||||||
const std::vector<std::string>& byproducts = be.GetByproducts();
|
cmCustomCommandGenerator beg(be, this->ConfigName, this->LocalGenerator);
|
||||||
|
const std::vector<std::string>& byproducts = beg.GetByproducts();
|
||||||
for (std::string const& byproduct : byproducts) {
|
for (std::string const& byproduct : byproducts) {
|
||||||
this->CleanFiles.insert(
|
this->CleanFiles.insert(
|
||||||
this->LocalGenerator->MaybeConvertToRelativePath(currentBinDir,
|
this->LocalGenerator->MaybeConvertToRelativePath(currentBinDir,
|
||||||
|
Reference in New Issue
Block a user