Honor parallelsJobs value when the generator is a Visual Studio one (multicore support) #975
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes
the perfomance of a build when the cmake generator is Visual Studio one f.e.
Visual Studio 15 2017 Win64
because cmake build single-core by default. Adding/maxcpucount
as additional flag (it's the same flag as-j
in gcc) will activate multicore build (when the Visual Studio solution is generated by Visual Studio ´/maxcpucount´ is the default).This PR always add the number of cores calculate by this extension (as defined with
cmake.parallelJobs
setting), so the flag always looks like f.e/maxcpucount:8
. msbuild would have also the option to detect the cores by itself with/maxcpucount
, but the implementation for that in this extension would be much more complicated.The purpose of this change
Multicore-build per default => better speed in most cases