From 34c4108bbcb8774821ac857e0ad0a92294ee8b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20St=C3=BCrmer?= Date: Wed, 30 Aug 2017 15:30:32 +0200 Subject: add HasOnlyEmptyCommandLines() method to cmCustomCommandGenerator --- Source/cmCustomCommandGenerator.cxx | 12 ++++++++++++ Source/cmCustomCommandGenerator.h | 1 + 2 files changed, 13 insertions(+) diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index fdc0a97..c6a2800 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -97,6 +97,18 @@ const char* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const return nullptr; } +bool cmCustomCommandGenerator::HasOnlyEmptyCommandLines() const +{ + for (size_t i = 0; i < this->CommandLines.size(); ++i) { + for (size_t j = 0; j < this->CommandLines[i].size(); ++j) { + if (!this->CommandLines[i][j].empty()) { + return false; + } + } + } + return true; +} + std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const { if (const char* emulator = this->GetCrossCompilingEmulator(c)) { diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h index ea33b51..34fd653 100644 --- a/Source/cmCustomCommandGenerator.h +++ b/Source/cmCustomCommandGenerator.h @@ -40,6 +40,7 @@ public: std::vector const& GetOutputs() const; std::vector const& GetByproducts() const; std::vector const& GetDepends() const; + bool HasOnlyEmptyCommandLines() const; }; #endif -- cgit v0.12