summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMichael Stürmer <michael.stuermer@schaeffler.com>2017-08-30 13:30:32 (GMT)
committerMichael Stürmer <michael.stuermer@schaeffler.com>2017-09-04 09:41:45 (GMT)
commit34c4108bbcb8774821ac857e0ad0a92294ee8b0b (patch)
tree031024e2aedfe71d180a405a5d61974ff4923352 /Source
parent8d13e9c1f5fa7871153ef83aa67d67e72fcaa5c1 (diff)
downloadCMake-34c4108bbcb8774821ac857e0ad0a92294ee8b0b.zip
CMake-34c4108bbcb8774821ac857e0ad0a92294ee8b0b.tar.gz
CMake-34c4108bbcb8774821ac857e0ad0a92294ee8b0b.tar.bz2
add HasOnlyEmptyCommandLines() method to cmCustomCommandGenerator
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCustomCommandGenerator.cxx12
-rw-r--r--Source/cmCustomCommandGenerator.h1
2 files changed, 13 insertions, 0 deletions
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<std::string> const& GetOutputs() const;
std::vector<std::string> const& GetByproducts() const;
std::vector<std::string> const& GetDepends() const;
+ bool HasOnlyEmptyCommandLines() const;
};
#endif