diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-04-09 17:09:52 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-04-12 11:06:49 (GMT) |
commit | 0c47b91fccf5d55a0edc1512a543b8445a8fa4ba (patch) | |
tree | 564276e97cb2c4c0d08a8784d6cbbcac71dc1800 /Source/cmCustomCommandGenerator.cxx | |
parent | 43ecda68eb85bdb38c635ecd3e5a5296a2451f81 (diff) | |
download | CMake-0c47b91fccf5d55a0edc1512a543b8445a8fa4ba.zip CMake-0c47b91fccf5d55a0edc1512a543b8445a8fa4ba.tar.gz CMake-0c47b91fccf5d55a0edc1512a543b8445a8fa4ba.tar.bz2 |
Genex: add_custom_command: DEPFILE supports genex
This facility is very useful for 'Ninja Multi-Config' and required
as well for future support of DEPFILE in 'Xcode' and 'Visual Studio'
generators (#20286).
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 4329caf..4705443 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -139,6 +139,14 @@ std::vector<std::string> EvaluateOutputs(std::vector<std::string> const& paths, } return outputs; } + +std::string EvaluateDepfile(std::string const& path, + cmGeneratorExpression const& ge, + cmLocalGenerator* lg, std::string const& config) +{ + std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(path); + return cge->Evaluate(lg, config); +} } cmCustomCommandGenerator::cmCustomCommandGenerator( @@ -381,9 +389,20 @@ void cmCustomCommandGenerator::AppendArguments(unsigned int c, } } +std::string cmCustomCommandGenerator::GetDepfile() const +{ + const auto& depfile = this->CC->GetDepfile(); + if (depfile.empty()) { + return ""; + } + + cmGeneratorExpression ge(this->CC->GetBacktrace()); + return EvaluateDepfile(depfile, ge, this->LG, this->OutputConfig); +} + std::string cmCustomCommandGenerator::GetFullDepfile() const { - std::string depfile = this->CC->GetDepfile(); + std::string depfile = this->GetDepfile(); if (depfile.empty()) { return ""; } |