Handle stl flags for sdk variant

The three main categories of user-provided stl value are
- "" or "system"
- "libc++"
- "libc++_static"

For each of these values, stl.bzl emits a select statement with an
additional config_setting for sdk
(//build/bazel/rules/apex:unbundled_app). The single select ensures that
non-sdk deps do not get added when building sdk variants.

The implementation choice of using a single select comes at the cost of some
.bzl file verbosity.

Test: b test //build/bazel/rules/cc:stl_tests to verify no regression
for non-sdk variants
Test: Added assertions for sdk variants in sdk_test.bzl
Bug: 201079053
Change-Id: Id0c2b006c61e52b988c2c5fbc1dcd90610f65589

Change-Id: I35c8806a6228ca83218c59601a7b9e68e481e15c
3 files changed
tree: 21d440e98cba06b0f9e70147b40f5d0971d749e9
  1. api_surfaces/
  2. bazel_sandwich/
  3. bin/
  4. ci/
  5. compliance/
  6. docs/
  7. examples/
  8. flags/
  9. json_module_graph/
  10. mk2rbc/
  11. mkcompare/
  12. platforms/
  13. product_config/
  14. rules/
  15. scripts/
  16. tests/
  17. toolchains/
  18. utils/
  19. vendor/
  20. .gitignore
  21. bazel.BUILD
  22. bazel.WORKSPACE
  23. buildifier_hook.sh
  24. common.bazelrc
  25. constants_exported_to_soong.bzl
  26. darwin.bazelrc
  27. linux.bazelrc
  28. OWNERS
  29. PREUPLOAD.cfg
  30. README.md
README.md

Bazel

The code in this directory is experimental. Bazel support for Android Platform is undergoing active development and workflow stability is currently not guaranteed.