-
Notifications
You must be signed in to change notification settings - Fork 756
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
Apply warning and error compile flags only to 1P code #7241
Conversation
Move the unit test source under src/ so that all of our 1P code and none of our 3P code is under src/, then move the configuration of all the error and warning flags to src/CMakeLists.txt so it only applies to 1P code. This will make it easier to add 3P code that does not compile cleanly with all the warnings and errors we enable for our own code.
This reverts commit 4e7f514.
Right, so it doesn't appear that this actually works. CMAKE_CXX_FLAGS includes all the expected flags when we descend into the 1P source subdirectories, but it seems that the point at which its value matters is when the target is defined by We have a few options:
|
Ok, this is vastly simplified now. The fact that CMAKE_CXX_FLAGS takes effect at the moment a target is declared made it obvious that we just needed to set all the warning and error flags after visiting third_party and before visiting our own code. |
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.
Nice!
(cmake... i'll never understand it)
Move all the configuration of error and warning flags to after we have
added the third_party subdirectory and declared all of the 3P targets.
This ensures that only the basic configuration that e.g. affects ABI is
applied to the 3P code. This will make it easier to add 3P code that
does not compile cleanly with all the warnings and errors we enable for
our own code.