Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ndk_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,12 @@ def ndk_cc_toolchain_config(
enabled = True,
),

# Optionally, allow use of APIs above the api_level, so long as the use is
# protected with a call to __builtin_available(android <version>, *).
# For more, see https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#weak-symbols-for-api-definitions
# This takes effect with NDK r26 and greater.
feature(name = "android_ndk_conditional_api_availability"),

# User-settable feature controls warning aggressiveness for compilation.
feature(name = "warnings_as_errors"),

Expand Down Expand Up @@ -682,6 +688,14 @@ def ndk_cc_toolchain_config(
],
features = ["android_unwind_tables"],
),
flag_set(
actions = actions.all_compile,
flags = [
"-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__",
"-Werror=unguarded-availability",
],
features = ["android_ndk_conditional_api_availability"],
),

## Options for particular compile modes:

Expand Down