| # Copyright 2026 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| load("@fuchsia_rules_common//build_flags:build_flags.bzl", "build_flags") | |
| package(default_applicable_licenses = ["//:license"]) | |
| # Some Android libraries fail to build with thread safety analysis but we do not | |
| # want to disable thread safety analysis for any downstream users. | |
| # | |
| # If updating the third_party Android code fails to compile, you may add this | |
| # config to the private config sections of the failing target. | |
| # LINT.IfChange(android_config_no_thread_safety_analysis) | |
| build_flags( | |
| name = "android_config_no_thread_safety_analysis", | |
| cflags_cc = ["-Wno-thread-safety-analysis"], | |
| subflags = [":android_config"], | |
| visibility = ["//src/lib/android/binder:__subpackages__"], | |
| ) | |
| # LINT.ThenChange(BUILD.gn:android_config_no_thread_safety_analysis) | |
| # LINT.IfChange(android_config) | |
| build_flags( | |
| name = "android_config", | |
| cflags_cc = [ | |
| "-Wno-c++98-compat-extra-semi", | |
| "-Wno-c99-designator", | |
| "-Wno-deprecated-declarations", | |
| "-Wno-extra-semi", | |
| "-Wno-implicit-int-conversion", | |
| "-Wno-inconsistent-missing-override", | |
| "-Wno-newline-eof", | |
| "-Wno-range-loop-construct", | |
| "-Wno-reorder-init-list", | |
| "-Wno-shorten-64-to-32", | |
| "-Wno-sign-compare", | |
| "-Wno-string-conversion", | |
| "-Wno-unused-but-set-variable", | |
| "-Wno-unused-result", | |
| ], | |
| subflags = ["//build/config:Wno-nontrivial-memaccess"], | |
| visibility = [ | |
| "//src/lib/android:__subpackages__", | |
| "//vendor/google:__subpackages__", | |
| ], | |
| ) | |
| # LINT.ThenChange(BUILD.gn:android_config) | |
| # LINT.IfChange(android_rust_config) | |
| build_flags( | |
| name = "android_rust_config", | |
| rustflags = [ | |
| "-Adead-code", | |
| "-Adeprecated", | |
| "-Aelided-lifetimes-in-paths", | |
| "-Anon-camel-case-types", | |
| "-Aunused-imports", | |
| "-Aunused-must-use", | |
| "-Aunused-mut", | |
| "-Aunused-assignments", | |
| "-Zallow-features=custom_inner_attributes", | |
| ], | |
| visibility = [ | |
| "//src/lib/android:__subpackages__", | |
| "//vendor/google:__subpackages__", | |
| ], | |
| ) | |
| # LINT.ThenChange(BUILD.gn:android_rust_config) | |
| # LINT.IfChange(android_aidl_rust_config) | |
| build_flags( | |
| name = "android_aidl_rust_config", | |
| rustflags = [ | |
| "-Aunused-crate-dependencies", | |
| "-Adeprecated", | |
| "-Aunused-variables", | |
| "-Aunreachable-patterns", | |
| ], | |
| subflags = [":android_rust_config"], | |
| visibility = [ | |
| "//src/lib/android:__subpackages__", | |
| "//src/microfuchsia:__subpackages__", | |
| "//vendor/google:__subpackages__", | |
| ], | |
| ) | |
| # LINT.ThenChange(BUILD.gn:android_aidl_rust_config) |