CMake: Remove need to fiddle with CMAKE_C_FLAGS / CMAKE_CXX_FLAGS #1409
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to help modernize the CMake setup (#1263)
There a are likely several ways to accomplish this, but this is the cleanest way that I can see. Most of the custom flags added to date are warning flags. There are now cached into
PROJ_C_WARN_FLAGS
/PROJ_CXX_WARN_FLAGS
, then applied to the relevant targets.Currently, these target compile options
PRIVATE
, since warning flags should not change the behavior of the library/utilities. But perhaps these should beINTERFACE
?Also,
/D_CRT_SECURE_NO_WARNINGS
is not exactly a warning flag, so it's been bumped into a globaladd_definitions
.The only remaining
CMAKE_C_FLAGS
modification is related to an Intel flag, which I may address another day.