-
Notifications
You must be signed in to change notification settings - Fork 158
FIX: Clang and MSVC compile options duplicate for clang-cl #697
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
base: master
Are you sure you want to change the base?
Conversation
Previously, clang-cl inherited both Clang-specific and MSVC-specific flags in `target_compile_options`, leading to duplicate flags and excessive warnings. After this change: - Clang-cl builds now only apply MSVC compile options (/W4, etc.). - Native Clang builds retain only Clang-specific flags. - -Wall/-Wextra for clang are avoided in clang-cl, preventing gigabytes of warnings and drastically improving build times.
There are a few other places where clang-specific compiler options are set e.g. DiligentCore/Graphics/ShaderTools/CMakeLists.txt Lines 141 to 143 in c4a98bd
DiligentCore/Graphics/ShaderTools/CMakeLists.txt Lines 146 to 149 in c4a98bd
DiligentCore/Graphics/GraphicsEngineOpenGL/CMakeLists.txt Lines 223 to 248 in c4a98bd
DiligentCore/Tests/DiligentCoreTest/CMakeLists.txt Lines 25 to 32 in c4a98bd
DiligentCore/Tests/GPUTestFramework/CMakeLists.txt Lines 126 to 141 in c4a98bd
DiligentCore/Tests/DiligentCoreAPITest/CMakeLists.txt Lines 128 to 141 in c4a98bd
|
I'm 99% sure they all should be fixed same way. But I didn't checked any of this. |
Did you figure out how to make the build faster? |
This change does not seem to be correct.
This reduces the number of warnings, but build time is still ridiculous. It takes more than 5 minutes to build only |
With all errors ignored using -w, the build completed in less than a minute. Warnings significantly affect build performance. |
For me, it feels like linking takes most of the time. |
Summary
When building with clang-cl (Clang frontend for MSVC):
applied, producing duplicate warnings and huge warning output.
Changes
Benefits