summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h1
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx8
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h3
4 files changed, 20 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index a7a47effe7..1e01dd6a2b 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -1498,6 +1498,17 @@ bool cmGlobalVisualStudio10Generator::IsMsBuildRestoreSupported() const
cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer15_7_5));
}
+bool cmGlobalVisualStudio10Generator::IsBuildInParallelSupported() const
+{
+ if (this->Version >= VSVersion::VS16) {
+ return true;
+ }
+
+ static std::string const vsVer15_8_0 = "15.8.27705.0";
+ cm::optional<std::string> vsVer = this->GetVSInstanceVersion();
+ return (vsVer &&
+ cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer15_8_0));
+}
std::string cmGlobalVisualStudio10Generator::GetClFlagTableName() const
{
std::string const& toolset = this->GetPlatformToolsetString();
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 63c21c57de..deed206c13 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -168,6 +168,7 @@ public:
cmIDEFlagTable const* GetNasmFlagTable() const;
bool IsMsBuildRestoreSupported() const;
+ bool IsBuildInParallelSupported() const;
protected:
cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name,
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ce9a842573..50658764df 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1807,7 +1807,8 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
outputs.str(), comment, ccg);
} else {
this->WriteCustomRuleCpp(*spe2, c, script, additional_inputs.str(),
- outputs.str(), comment, ccg, symbolic);
+ outputs.str(), comment, ccg, symbolic,
+ command.GetUsesTerminal());
}
}
}
@@ -1816,9 +1817,12 @@ void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp(
Elem& e2, std::string const& config, std::string const& script,
std::string const& additional_inputs, std::string const& outputs,
std::string const& comment, cmCustomCommandGenerator const& ccg,
- bool symbolic)
+ bool symbolic, bool uses_terminal)
{
const std::string cond = this->CalcCondition(config);
+ if (this->GlobalGenerator->IsBuildInParallelSupported() && !uses_terminal) {
+ e2.WritePlatformConfigTag("BuildInParallel", cond, "true");
+ }
e2.WritePlatformConfigTag("Message", cond, comment);
e2.WritePlatformConfigTag("Command", cond, script);
e2.WritePlatformConfigTag("AdditionalInputs", cond, additional_inputs);
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 166cdf7bb7..194fbaa8af 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -157,7 +157,8 @@ private:
std::string const& additional_inputs,
std::string const& outputs,
std::string const& comment,
- cmCustomCommandGenerator const& ccg, bool symbolic);
+ cmCustomCommandGenerator const& ccg, bool symbolic,
+ bool uses_terminal);
void WriteCustomRuleCSharp(Elem& e0, std::string const& config,
std::string const& commandName,
std::string const& script,