diff options
author | Brad King <brad.king@kitware.com> | 2018-05-29 14:02:09 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-05-29 14:05:09 (GMT) |
commit | f248f8ad7898816a5a627e288d3a04fed993967f (patch) | |
tree | 39474bb70be2d89d344e55ba4aa5def19905ee28 /Source/cmGlobalVisualStudio10Generator.cxx | |
parent | 42752d0c11df67a9ca4f5e71efa58965c58552f8 (diff) | |
parent | 1ab3881ec9e809ac5f6cad5cd84048310b8683e2 (diff) | |
download | CMake-f248f8ad7898816a5a627e288d3a04fed993967f.zip CMake-f248f8ad7898816a5a627e288d3a04fed993967f.tar.gz CMake-f248f8ad7898816a5a627e288d3a04fed993967f.tar.bz2 |
Merge topic 'parallel_build_option'
1ab3881ec9 cmake: Add options for parallel builds to --build mode
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Henry Schreiner <henryschreineriii@gmail.com>
Merge-request: !1962
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 205e0d0..51e9ab1 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -764,7 +764,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( std::vector<std::string>& makeCommand, const std::string& makeProgram, const std::string& projectName, const std::string& projectDir, const std::string& targetName, const std::string& config, bool fast, - bool verbose, std::vector<std::string> const& makeOptions) + int jobs, bool verbose, std::vector<std::string> const& makeOptions) { // Select the caller- or user-preferred make program, else MSBuild. std::string makeProgramSelected = @@ -805,7 +805,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( // Use devenv to build solutions containing Intel Fortran projects. cmGlobalVisualStudio7Generator::GenerateBuildCommand( makeCommand, makeProgram, projectName, projectDir, targetName, config, - fast, verbose, makeOptions); + fast, jobs, verbose, makeOptions); return; } @@ -813,6 +813,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( std::string realTarget = targetName; // msbuild.exe CxxOnly.sln /t:Build /p:Configuration=Debug /target:ALL_BUILD + // /m if (realTarget.empty()) { realTarget = "ALL_BUILD"; } @@ -841,6 +842,17 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand( makeCommand.push_back(configArg); makeCommand.push_back(std::string("/p:VisualStudioVersion=") + this->GetIDEVersion()); + + if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) { + if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) { + makeCommand.push_back("/m"); + } else { + makeCommand.push_back(std::string("/m:") + std::to_string(jobs)); + } + // Having msbuild.exe and cl.exe using multiple jobs is discouraged + makeCommand.push_back("/p:CL_MPCount=1"); + } + makeCommand.insert(makeCommand.end(), makeOptions.begin(), makeOptions.end()); } |