Skip to content

fix: set C/C++ language standards per target #1217

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

Merged
merged 37 commits into from
Oct 23, 2024
Merged

Conversation

cgrindel
Copy link
Owner

@cgrindel cgrindel commented Sep 8, 2024

This PR refactors the creation of C, C++, ObjC, and ObjC++ targets. For each C-like target in a Swift package, we now create a separate xxx_library target based upon the type of the source file (e.g. C, C++, ObjC, ObjC++, and assembly). These child libraries are added to a parent library that represents the Swift package target.

The goal of this work was to support language standard flags in the Bazel targets generated by rules_swift_package_manager. If a C language standard is specified in the Swift package, it is applied to the C and ObjC targets. If a C++ language standard is specified, it is applied to the C++ and the ObjC++ targets.

Note

The configuration for rules_xcodeproj in the Firebase example had to be updated to use the sandbox. Without this change, we were seeing duplicate definition errors. If you see these errors in your build, you may need to do the same.

Closes #1079 .

@cgrindel cgrindel self-assigned this Sep 8, 2024
@cgrindel cgrindel force-pushed the gh1079_c_std_settings2 branch 2 times, most recently from 9706eb5 to ca19083 Compare September 28, 2024 15:59
@cgrindel cgrindel force-pushed the gh1079_c_std_settings2 branch from 6dba8c0 to f0a8e2d Compare September 29, 2024 20:58
@cgrindel cgrindel mentioned this pull request Sep 30, 2024
20 tasks
@cgrindel cgrindel force-pushed the gh1079_c_std_settings2 branch from f0a8e2d to 0a8f2b2 Compare October 21, 2024 00:18
@cgrindel cgrindel marked this pull request as ready for review October 21, 2024 13:46
@cgrindel
Copy link
Owner Author

@Mergifyio queue

Copy link
Contributor

mergify bot commented Oct 23, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 6d12d53

@mergify mergify bot merged commit 6d12d53 into main Oct 23, 2024
33 checks passed
@mergify mergify bot deleted the gh1079_c_std_settings2 branch October 23, 2024 14:29
@luispadron luispadron restored the gh1079_c_std_settings2 branch November 26, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C/C++ language standards should be set per-target
3 participants