gn2bp: allow targets to depend on chromium's libc++ and libunwind

We need to determine if this should be replaced by Android's version of
those libraries.

This can be done via "stl" property on dependent targets (we would
additionally have to configure the version).

Test: n/a
Change-Id: Ibd54cc0b58086ec77d5eee40708f28b237d70c3f
This commit is contained in:
Patrick Rohr
2022-10-25 12:11:05 -07:00
parent fa7e92643d
commit 26af1e76b2

View File

@@ -185,11 +185,15 @@ class GnParser(object):
target.toolchain = desc.get('toolchain', None) target.toolchain = desc.get('toolchain', None)
self.all_targets[gn_target_name] = target self.all_targets[gn_target_name] = target
# TODO: determine if below comment should apply for cronet builds in Android.
# We should never have GN targets directly depend on buidtools. They # We should never have GN targets directly depend on buidtools. They
# should hop via //gn:xxx, so we can give generators an opportunity to # should hop via //gn:xxx, so we can give generators an opportunity to
# override them. # override them.
# Specifically allow targets to depend on libc++ and libunwind.
if not any(match in gn_target_name for match in ['libc++', 'libunwind']):
assert (not gn_target_name.startswith('//buildtools')) assert (not gn_target_name.startswith('//buildtools'))
# Don't descend further into third_party targets. Genrators are supposed # Don't descend further into third_party targets. Genrators are supposed
# to either ignore them or route to other externally-provided targets. # to either ignore them or route to other externally-provided targets.
if gn_target_name.startswith('//gn'): if gn_target_name.startswith('//gn'):