Commit Graph

4 Commits

Author SHA1 Message Date
Googler a2949e206e Fix toolchain argument ordering
BEGIN_PUBLIC

Fix argument ordering

Expected argument ordering should be:

1. Arguments listed in `args`.
2. Legacy/built-in features.
3. User-defined features.

Due to some implementation changes, user-defined arguments were being applied last, reducing the ability for features to properly toggle behaviors dynamically.

This also fixes an issue caught by this change where cc_sysroot was applying flags to actions that had no associated action config.

END_PUBLIC

PiperOrigin-RevId: 683677895
Change-Id: I60e25ca22ffefce717e4e5ce476db0a070ca1993
2024-10-08 10:34:59 -07:00
Keith Smiley b4f54fab89
Allow extra args to cc_sysroot
It's possible for there to be some arguments that are naturally
associated with the sysroot flag, for example on macOS there are
associated framework search paths that should be added with
`-F{sysroot}/Library/Frameworks`. There are also warnings flags you
might want to add such as `-Werror=missing-sysroot`. In this case I
think it's nicer to provide them alongside the sysroot definition,
instead of having to create a custom cc_args for them.
2024-09-22 14:00:13 -07:00
Googler a778282a15 Fix action label evaluation in cc_sysroot
BEGIN_PUBLIC

Fix action label evaluation in cc_sysroot

Explicitly converts action labels in cc_sysroot to Label objects to address issues where the labels were being evaluated as relative to the module instantiating cc_sysroot rules.

END_PUBLIC

PiperOrigin-RevId: 667520654
Change-Id: Ia64306cc172dfaa747ef28a92390bcd90296b109
2024-08-26 03:09:37 -07:00
Googler 2480c90525 Replace sysroot with a cc_sysroot macro.
BEGIN_PUBLIC
Replace sysroot with a cc_sysroot macro.

This is part of what amontanez@ and I discussed about making C++ toolchains less "magic".
I'd like to do the same for cxx_builtin_include_directories, but that will require significantly more effort.

END_PUBLIC

PiperOrigin-RevId: 666607531
Change-Id: Ic9cfb157e892c05a9c875f240c0ed9a1048dea19
2024-08-22 20:36:02 -07:00