summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMichael Stürmer <michael.stuermer@schaeffler.com>2017-08-30 15:40:02 (GMT)
committerMichael Stürmer <michael.stuermer@schaeffler.com>2017-09-04 09:42:35 (GMT)
commit9ed242807893becd4cd8245248fade93f7054c71 (patch)
treef25c531d66dff2d04a7fab3c834463a25018068f /Source
parent34c4108bbcb8774821ac857e0ad0a92294ee8b0b (diff)
downloadCMake-9ed242807893becd4cd8245248fade93f7054c71.zip
CMake-9ed242807893becd4cd8245248fade93f7054c71.tar.gz
CMake-9ed242807893becd4cd8245248fade93f7054c71.tar.bz2
VS: only add custom command line if it is not empty
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx10
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx12
2 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 41025af..d772d95 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -191,13 +191,17 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
// Write each command on a single line.
for (unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c) {
+ // Add this command line.
+ std::string cmd = ccg.GetCommand(c);
+
+ if (cmd.empty()) {
+ continue;
+ }
+
// Start a new line.
script += newline;
newline = newline_text;
- // Add this command line.
- std::string cmd = ccg.GetCommand(c);
-
// Use "call " before any invocations of .bat or .cmd files
// invoked as custom commands.
//
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 86099eb..2b3d40f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3536,11 +3536,13 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
for (std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i) {
cmCustomCommandGenerator ccg(*i, configName, this->LocalGenerator);
- comment += pre;
- comment += lg->ConstructComment(ccg);
- script += pre;
- pre = "\n";
- script += cmVS10EscapeXML(lg->ConstructScript(ccg));
+ if (!ccg.HasOnlyEmptyCommandLines()) {
+ comment += pre;
+ comment += lg->ConstructComment(ccg);
+ script += pre;
+ pre = "\n";
+ script += cmVS10EscapeXML(lg->ConstructScript(ccg));
+ }
}
comment = cmVS10EscapeComment(comment);
if (this->ProjectType != csproj) {