gn2bp: Add an helper to drop unneeded third_party dependencies

Use a more expressive always_disable function to disable unneeded
third_party dependencies.

Test: Android.bp.swp output is equivalent
Change-Id: Ib21646dfa076fc6f745b7871851744d6ed18eaf3
This commit is contained in:
Stefano Duo 2023-03-03 14:39:19 +00:00
commit f5954480f5

View file

@ -190,6 +190,9 @@ additional_args = {
],
}
def always_disable(module, arch):
return None
def enable_brotli(module, arch):
# Requires crrev/c/4111690
if arch is None:
@ -227,17 +230,17 @@ def enable_boringssl(module, arch):
# depends on.
builtin_deps = {
'//buildtools/third_party/libunwind:libunwind':
lambda m, a: None, # disable libunwind
always_disable,
'//buildtools/third_party/libunwind:libunwind__testing':
lambda m, a: None, # disable libunwind
always_disable,
'//net/data/ssl/chrome_root_store:gen_root_store_inc':
lambda m, a: None,
always_disable,
'//net/data/ssl/chrome_root_store:gen_root_store_inc__testing':
lambda m, a: None,
always_disable,
'//net/tools/root_store_tool:root_store_tool':
lambda m, a: None,
always_disable,
'//net/tools/root_store_tool:root_store_tool__testing':
lambda m, a: None,
always_disable,
'//third_party/zlib:zlib':
enable_zlib,
'//third_party/zlib:zlib__testing':