Commit c5e906d
authored
feat(toolchain): add copts and objc_copts attributes to toolchains (#1564)
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.1 parent 2af3bad commit c5e906d
File tree
2 files changed
+19
-3
lines changed- swift/toolchains
2 files changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
630 | 635 | | |
631 | 636 | | |
632 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
739 | | - | |
| 739 | + | |
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | | - | |
| 744 | + | |
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
| |||
929 | 929 | | |
930 | 930 | | |
931 | 931 | | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
932 | 943 | | |
933 | 944 | | |
934 | 945 | | |
| |||
0 commit comments