-
Notifications
You must be signed in to change notification settings - Fork 1
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
cc: split up rules for building c and c++ code [BUILD-560] #52
Conversation
cc @woodfell @RReichert thought it'd be good to tag you two for review. This essentially wraps up the API for the |
@isaactorz the one area that I see that might have issues with this is |
Check out this PR where I've tested: https://github.com/swift-nav/gnss-converters-private/pull/1468 But basically getting gnss-converters built correctly is what this PR addresses, since it's pretty much the only place in the codebase where we've been mixing languages. |
9f94824
to
841b61e
Compare
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 tested it locally with gnss_converters
, and it worked well. LGTM.
)" This reverts commit f631fd6.
Splits up our
swift_cc*
wrappers into two sets of functions for building c and c++ code separatelyDesign Notes
We use the
swift
wrappers to enforce that (among other options), we set the following flags consistently across our codebase:-fno-exceptions
-fno-rtti
-std=c++14
-std=c99
Unfortunately bazel cc* rules don't support distinguishing between options for the c compiler and options for the c++ compiler:
The solution proposed here is to split up building c and c++ code into two functions so the problematic flags can be applied separately.
Usage
Examples, see related PR's for actual implementations:
Also adds flags for enabling exceptions and rtti globally:
Also adds a flag for overriding the default c++ standard:
Testing
New features were tested in the following PR's:
Related PR's:
This PR cannot be merged in standalone without breaking a whole bunch of builds.
We'll need to first merge empty stub functions across the codebase, then come back and merge this one: