Skip to content

Conversation

@ma-oli
Copy link
Contributor

@ma-oli ma-oli commented Aug 29, 2025

When using rules_swift with a custom (rules based) cc_toolchain, it is sometimes useful to propagate certain flags to every swift invocation. And while a cc_library() could potentially be used in implicit_deps to pass the usual options (-isystem, -iquote, -D, etc...), the CcInfo provider does not allow propagating every option.

Some options in particular (such as -Xclang -internal-externc-system) cannot currently be propagated that way, and they can nonetheless be necessary in certain environment.

So we're making the current toolchain rules a tad more flexible in this commit, by allowing the user to specify "objc_copts" (for xcode only) and "copts" at toolchain parameters. The content of these attributes is then added to the corresponding compilation actions.

When using rules_swift with a custom (rules based) cc_toolchain, it is
sometimes useful to propagate certain flags to every swift invocation.
And while a cc_library() could potentially be used in implicit_deps to
pass the usual options (-isystem, -iquote, -D, etc...), the CcInfo
provider does not allow propagating every option.

Some options in particular (such as -Xclang -internal-externc-system)
cannot currently be propagated that way, and they can nonetheless be
necessary in certain environment.

So we're making the current toolchain rules a tad more flexible in this
commit, by allowing the user to specify "objc_copts" (for xcode only)
and "copts" at toolchain parameters. The content of these attributes
is then added to the corresponding compilation actions.
@keith keith merged commit c5e906d into bazelbuild:master Aug 29, 2025
13 checks passed
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.

2 participants