-
Notifications
You must be signed in to change notification settings - Fork 0
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
Standardize system include targets #62
Standardize system include targets #62
Conversation
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.
I think this is a good move.
In the early days of SYSTEM_INCLUDES
there were loads of problems with errors being flagged in headers of swift controlled dependencies that weren't being picked up in the dependencies themselves because of differences in compiler flags and .clang-tidy
. Have these differences been resolved or the problems somehow gone away now?
No these differences have not be resolved, we now have better control of it with this PR (ie. we can restrict/enable third party analysis with a cmake flag). Swiftlets for instance fails unless I add the Long term these clang-tidy/compile flags will need to be standard across the org, this lot of work will help us get to that point slowly. |
Ok, probably worth making sure the orion team is aware of this since they import |
I've produced two draft PRs for the orion repos to emulate what it would be with this cmake submodule update:
I'll let mark know before I hit the merge button. |
Background
This PR works towards our Platform OKR (https://swift-nav.atlassian.net/wiki/spaces/ENG/pages/804816541/Platform+OKRs+Q3+2020) where we try and avoid using
THIRD_PARTY_INCLUDE
to mask our issues with submodules.When calling
find_package(...)
to include a submodule project, we've by default made it so that all submodule projects are treated as foreign code, this is done by doing some cmake magic where we convert all C++ header include-I
flags to-isystem
. This is harmless in terms of generated code, but it does differ in terms of reporting warnings. Warnings are reported when using-I
but not when using-isystem
, so any issues in submodules are ignored which is problematic for a multitude of reasons:There is an oddity in this logic as well that when cross compiling it no longer considers it "system" targets because of the bug in the toolchain used for
starling
'sBuild for Yocto
Jenkins stage, so I'd like to fix that by simply fixing the starling build script.Changes
The changes that I'm introducing makes it clearer what the expected behaviour is. Any
Find*.cmake
script that callsGenericFindDependency
and hasSYSTEM_INCLUDES
is by default treated as foreign libraries (system headers) which we have little influence over, so things likeeigen
,variant
,gtest
, etc fall under this category. If users don't specifySYSTEM_INCLUDES
it is assumed to be within our control, so they are local headers by default. We can override this behaviour by passing theTHIRD_PARTY_INCLUDES_AS_SYSTEM
, atrue
value will set everything to system header, a value offalse
will set everything to local.Below is a list of all the third party projects which we consider SYSTEM (outside our control) vs LOCAL (within our control).
SYSTEM
LOCAL
PR depends on the following to be merged
Changes tested on a number of down stream PRs
NOTE: the PR failures above are due to
clang-format
errors (a false positive result because it usesgit diff
to identify format error, but the hacks in place modify the source code to reflect a uniform cmake/variant/libpal++ repo update across the organization).