-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add MSVC_MP
CMake option to adjust number of parallel build jobs
#2705
Add MSVC_MP
CMake option to adjust number of parallel build jobs
#2705
Conversation
4ab09d7
to
6bb7369
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two Three comments here:
- The logic is a little convoluted
- I'm on a long term effort to stop us from writing on
CMAKE_*_FLAGS
- Are you sure you can remove that version check on
MSVC
?
Here's my suggestion
if(USE_MSVC_MP EQUAL 0)
# USE_MSVC_MP is 0 in case the information cannot be determined by ProcessorCount => fallback
add_compile_options("/MP")
elseif(USE_MSVC_MP GREATER 1)
add_compile_options("/MP${USE_MSVC_MP}")
endif()
Assuming I'm not mistaken, this code should be equivalent.
See #2690 (comment). Since C++14 is now necessary we require at least VS 2015 (MSVC_VERSION 1900) now. I will check you suggestion. Looks indeed better :). |
6bb7369
to
85eb6ef
Compare
Tested it: And it works :). Side node: MSVC seems to ignore passed process count and only differ between with and without |
After reading the documentation I noticed that one can pass Also I'm questioning if Finally, our CI might blow-up out of memory if we don't tweak the number of compilations processes running, but we can tweak that later. |
I was thinking about it, too. But I there was a decision: Add a useless flag (
I added
I didn't changed behavior to the state of pre-PR. |
Makes sense. With the current logic, it will be ignored. Edit: if the
In this case better go with the
From the logic it seems that by default it will always try to use the number if gets from |
What do you prefer as new name
As before ;) |
Oh, true. |
85eb6ef
to
d06d250
Compare
LGTM, but I'm not a MSVC user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
MSVC_MP
CMake option to adjust number of parallel build jobs
No description provided.