-
-
Notifications
You must be signed in to change notification settings - Fork 522
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: cleanup CMake #319
build: cleanup CMake #319
Conversation
Rather than explicitly name the C++ runtime, use the `LINKER_LANGUAGE` property to use the driver to spell the C++ runtime appropriately.
Rather than use compiler specific flags to control the language standard, indicate to CMake the desired standard.
These flags are being applied to the *C* compiler, check the C compiler, not the C++ compiler.
This loosens the compiler identifier check to enable matching AppleClang which is the identifier for the Xcode compiler.
This hoists the common shared flags handling to the top-level CMakeLists from sub-layers. This prevents the duplication of the handling.
This is unnecessary, `/TP` is forced on all MSVC builds, no need to duplicate the flag for older versions.
Loosen the check to a match rather than equality check, this allows it to match AppleClang which is the identifier for the Apple vended clang compiler part of Xcode.
Use `add_compile_options` rather than modify `CMAKE_C_FLAGS`. The latter is meant to be only modified by the user, not the package developer.
This moves the CMAKE_C_FLAGS handling to the top-level and uses `add_compile_options` rather than modifying the user controlled flags.
These are global settings, hoist them to the top level.
Use a generator expression and hoist the flag handling for the debug build.
This is a global flag, hoist it to the top level and use `add_compile_options` rather than modify the user controlled flags.
This seemed to be attempting to set the linker not the linker flags for the profile configuration. This variable is not used, do not set it.
Many thanks. I barely know what I'm doing with cmake. |
Looks good. I'm only curious about the claim that |
@jgm my pleasure :) @nwellnhof, yeah, that is very subtle, and an accident that I caused. In fbe364a I hoisted the shared configuration between the |
Whoops, this PR caused problems with our automatic fuzzing setup: see the build log at https://oss-fuzz-build-logs.storage.googleapis.com/log-b8018641-3053-4be0-80c1-f17c8d1ed4e8.txt
Can you fix? |
Ugh, |
Then I'd prefer to keep the version check which also serves as implicit documentation why the flag is needed. |
Even better if a comment is added as explicit documentation. |
Some minor cleanups that I noticed which would improve things. This allows building on platforms which do not use libstdc++. There are still further refinements which can be made, but, this improves the state of things.