gn2bp: support '//' in label_to_path

Test: ./gen_android_bp --desc gn.json --output Android.bp \
'//third_party/zlib:zlib'

Change-Id: I65eb857440cb67a7774c120f619cbec86c10d73d
This commit is contained in:
Patrick Rohr
2022-10-25 11:34:20 -07:00
parent 344b247d4e
commit c6331c81e7

View File

@@ -150,7 +150,7 @@ def compute_source_dependencies(out, system_buildtools=False):
def label_to_path(label):
"""Turn a GN output label (e.g., //some_dir/file.cc) into a path."""
assert label.startswith('//')
return label[2:]
return label[2:] or "./"
def label_without_toolchain(label):