Let cargo2android ensure some libraries are whole_static_libs.
Test: Use on a crate. Change-Id: I1d6a3bdb47141d5d20af3c118fd7a05bef223a48
This commit is contained in:
@@ -681,8 +681,11 @@ class Crate(object):
|
||||
self.dump_android_flags()
|
||||
if self.externs:
|
||||
self.dump_android_externs()
|
||||
static_libs = [lib for lib in self.static_libs if not lib in self.runner.args.lib_blocklist]
|
||||
all_static_libs = [lib for lib in self.static_libs if not lib in self.runner.args.lib_blocklist]
|
||||
static_libs = [lib for lib in all_static_libs if not lib in self.runner.args.whole_static_libs]
|
||||
self.dump_android_property_list('static_libs', '"lib%s"', static_libs)
|
||||
whole_static_libs = [lib for lib in all_static_libs if lib in self.runner.args.whole_static_libs]
|
||||
self.dump_android_property_list('whole_static_libs', '"lib%s"', whole_static_libs)
|
||||
shared_libs = [lib for lib in self.shared_libs if not lib in self.runner.args.lib_blocklist]
|
||||
self.dump_android_property_list('shared_libs', '"lib%s"', shared_libs)
|
||||
|
||||
@@ -1605,16 +1608,21 @@ def get_parser():
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='Make the main library an rlib.')
|
||||
parser.add_argument(
|
||||
'--whole-static-libs',
|
||||
nargs='*',
|
||||
default=[],
|
||||
help='Make the given libraries (without lib prefixes) whole_static_libs.')
|
||||
parser.add_argument(
|
||||
'--dependency-blocklist',
|
||||
nargs='*',
|
||||
default=[],
|
||||
help='Do not emit the given dependencies.')
|
||||
help='Do not emit the given dependencies (without lib prefixes).')
|
||||
parser.add_argument(
|
||||
'--lib-blocklist',
|
||||
nargs='*',
|
||||
default=[],
|
||||
help='Do not emit the given C libraries as dependencies.')
|
||||
help='Do not emit the given C libraries as dependencies (without lib prefixes).')
|
||||
parser.add_argument(
|
||||
'--test-blocklist',
|
||||
nargs='*',
|
||||
|
||||
Reference in New Issue
Block a user