Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: compile source files in parallel under MSVC #1562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aras-p
Copy link

@aras-p aras-p commented Nov 17, 2024

When using cmake with Visual Studio project files (default on Windows), add MSVC compile flag that enables using more than 1 CPU core during the build (i.e. compile source files in parallel).

On my PC (Ryzen 5950X), full rebuild of the MSVC solution in Release config goes from 4.6sec down to 2.4sec. Not much, but there's no downside of using the /MP flag. (I've recently landed the same build improvement in OpenEXR and OpenColorIO)

When using cmake with Visual Studio project files (default on Windows), add MSVC compile flag that enables using more than 1 CPU core during the build (i.e. compile source files in parallel).
@rouault
Copy link
Collaborator

rouault commented Nov 27, 2024

I'm perplexed by this. Doesn't standard CMake options provide that capability already? If not, then this should be something to enhance on CMake itself, instead of hacking every software here and there

@aras-p
Copy link
Author

aras-p commented Nov 27, 2024

I'm perplexed by this. Doesn't standard CMake options provide that capability already? If not, then this should be something to enhance on CMake itself, instead of hacking every software here and there

There's a 7 year old open issue in cmake project about this yes: https://gitlab.kitware.com/cmake/cmake/-/issues/16951
And no, cmake of today still does not do it out of the box, so "add this manually to every project out there" it is :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants