c2a: Crate: Don't parse -Wclippy, -D, and -W flags

Don't fail the generation of the Android.bp file when those flags are
encountered.

Bug: 243662244
Test: Used on gdbstub, which fixed issues seen in aosp/2191020
Change-Id: I80a6ecd8df7980234552a98ddb1149dc29542ac7
This commit is contained in:
Pierre-Clément Tosi
2022-08-24 16:15:16 +01:00
parent 435dfe58d1
commit e5342d134a

View File

@@ -433,9 +433,13 @@ class Crate(object):
self.emit_list = arg.replace('--emit=', '')
elif arg.startswith('--edition='):
self.edition = arg.replace('--edition=', '')
elif arg.startswith('-Aclippy'):
elif arg.startswith('-Aclippy') or arg.startswith('-Wclippy'):
# TODO: Consider storing these to include in the Android.bp.
_ = arg # ignored
elif arg.startswith('-W'):
pass # ignored
elif arg.startswith('-D'):
pass # TODO: Consider storing these to include in the Android.bp.
elif not arg.startswith('-'):
# shorten imported crate main source paths like $HOME/.cargo/
# registry/src/github.com-1ecc6299db9ec823/memchr-2.3.3/src/lib.rs