-
Notifications
You must be signed in to change notification settings - Fork 84
[CMAKE] Enable multithreaded compilation for VC6 builds #1169
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
Conversation
I would make this as an alternative build method instead of a replacement since we still need PDB files when debugging crashes. |
It still has embedded debug information |
@OmniBlade What are your thoughts on this? |
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.
There is a lot of none functional change in the json files which could do with being reverted. No averse to an autoformatted file, but it should be applied in a separate PR.
Just checked in VSCode and the way its formatted now is the way it gets autoformatted there, so I think I'd need a good case made for changing how its formatted? |
521936d
to
a04e60c
Compare
b65c45a
to
a8e7920
Compare
a8e7920
to
64a1f1a
Compare
It seems to create a pdb even if debug information format is set to null |
Combined with #1210 this provides a huge improvement for VC6 build times for me. |
All vc6 targets are failing with How do we get this Ninja locally then? |
Maybe you don't have ninja in your environment variables or haven't installed it? |
I do not have it yes and CI is also failing for it. Should this perhaps be a new preset? |
The ci actually doesn't fail for it. It is only failing because delete cache needs to be run once but if I change the binary directory to a new one then it passes. Just download ninja. Look at the bottom of the link I sent |
How do we delete build cache? |
I just click delete cache and reconfigure under Project in visual studio |
So how do we fix the CI failing builds? And what can we do for users that do not yet use Ninja? |
With #1210 the visual studio ninja will be used automatically when using cmake inside visual studio. Plus our wiki already tells people to install ninja. They can also add the path to their version of ninja to the environment variiable. I'll try see if detection of ninja can be done in a .cmake file As for the CI, I would look into it except I don't have access to submit a pr that modifies the CI. We just need to update the cache it uses |
we could add something like "CMAKE_MAKE_PROGRAM": "C:/PROGRA |
nvm I do have access. I just happened to be using an access token that didn't have the right permissions |
043dbd4
to
f50ca09
Compare
CI is now fixed |
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.
Looks good, works locally for me. Good spot on being able to limit the linker to one concurrent run, that did indeed fix the issue I had trying to link concurrently with VC6. Before merge I would like clarification on if the compiler pools are required or if you can just leave that unspecified and let ninja determine the max pool size.
With this there doesn't appear to be much difference between VC6 and win32 presets, perhaps they should be merged into a single preset now that will vary only based on the environment they are run in.
This change is amazing. VC6 compile time is incredible. Under 1 minute on my system. Can we have the same compile speed for VS 2022 builds as well? Fyi, to use, I downloaded Windows Ninja from https://ninja-build.org/, extracted the ninja.exe into a folder, put it into Path environment variable, and then reconfigured CMake for VC6 builds. |
I'm actually quite puzzled on why vs 2022 builds are so much slower even though they also use ninja. My guess is that its due to the way thread safety is setup but I will investigate |
Hmm on my machine it uses MSBuild.exe I think. |
Do you set the generator to visual studio? |
Yes |
Then that's why. For vc6 as well if I use the visual studio generator then it's significantly slower than with ninja. Ninja in general is a really fast build tool. |
Most the stuff can be extractedd into a common preset for them to inherit from but if we make them a single preset then they would use the same binary directory and that would make force having to delete the entire build directory rebuild cache every time we want to switch from building one to the other |
Created a custom cmake toolchain file for using the vc6 compiler with the ninja generatorSwitching from nmake to multithreaded ninja reduces compile times by an order of magnitude