[toolchain] Support C standard selection override via flag or Kconfig

Allows selecting the C standard either via Kconfig (default)
or by overriding it using the `--@zephyr-bazel//toolchain/args/c:c_standard`
build setting (e.g. to "90", "99", "11", "17", "23").

This is implemented by:
1. Defining generic cXX and gnuXX features in `toolchain/args/c/BUILD.bazel`.
2. Defining the `c_standard` string flag and triggers in `toolchain/args/c/BUILD.bazel`.
3. Redefining the `std_cXX_gnu/pure` config settings in `toolchain/args/c/BUILD.bazel` to use the new trigger logic.
4. Using `select` on these config settings in all toolchains.

This matches the C++ standard selection override logic and cleans up
`toolchain/args/BUILD.bazel` by moving C-related stuff to `toolchain/args/c/BUILD.bazel`.

TAG=agy
CONV=66f377df-07e2-4b31-b652-bc93477153b4

Change-Id: Ic18e476e524a3f09a3aa884a8c5b8ab133f24814
Reviewed-on: https://pigweed-review.googlesource.com/c/zephyr/zephyr-bazel/+/437576
11 files changed
tree: 97d3080168573841a8d9e25770f8ae31e2bcd665
  1. .vscode/
  2. bazel/
  3. bazel_overlay/
  4. build_config/
  5. designs/
  6. docs/
  7. examples/
  8. modules/
  9. pw_tests/
  10. scripts/
  11. tests/
  12. third_party/
  13. toolchain/
  14. tools/
  15. ztests/
  16. .bazelignore
  17. .bazelrc
  18. .bazelversion
  19. .gitignore
  20. AUTHORS
  21. BUILD.bazel
  22. common.bazelrc
  23. CONTRIBUTING.md
  24. generate_diff.py
  25. LICENSE
  26. MODULE.bazel
  27. MODULE.bazel.lock
  28. naming.bzl
  29. OWNERS
  30. pigweed_dep.MODULE.bazel
  31. pw
  32. README.md
  33. setup.bzl
  34. workflows.json
  35. WORKSPACE
README.md

Zephyr-Bazel

The way this repository works is by overlaying itself on top of Zephyr to provide Bazel build capability to the underlying Zephyr repository.

Getting Started

User Guide

For more information on the architecture and internal design of Zephyr-Bazel, see the design documents in the designs folder of this repository: