diff options
author | Brad King <brad.king@kitware.com> | 2017-09-11 11:53:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-11 11:53:18 (GMT) |
commit | 28adf3833c23411dfce12b5be754ad53bc2b9b05 (patch) | |
tree | 00cd2f817a879541d0b290f322c56c5be06dc3b9 /Source/cmCustomCommandGenerator.cxx | |
parent | bf19bb5609b409c9c4043b22a7bbdb38354af73a (diff) | |
parent | 9ed242807893becd4cd8245248fade93f7054c71 (diff) | |
download | CMake-28adf3833c23411dfce12b5be754ad53bc2b9b05.zip CMake-28adf3833c23411dfce12b5be754ad53bc2b9b05.tar.gz CMake-28adf3833c23411dfce12b5be754ad53bc2b9b05.tar.bz2 |
Merge topic 'vs_improve_custom_command'
9ed24280 VS: only add custom command line if it is not empty
34c4108b add HasOnlyEmptyCommandLines() method to cmCustomCommandGenerator
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1050
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 12 |
1 files changed, 12 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)) { |