Option to pack unstripped .so into libwebrtc.aar
Bug: webrtc:12508 Change-Id: I12e9e9efabc9e8669cad1ff6be9919fef5027da7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270423 Reviewed-by: Xavier Lepaul <xalep@webrtc.org> Commit-Queue: Xavier Lepaul <xalep@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37689}
This commit is contained in:
parent
e644a4bde0
commit
b0a57d8e61
@ -68,6 +68,10 @@ def _ParseArgs():
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
help='Use goma.')
|
help='Use goma.')
|
||||||
|
parser.add_argument('--use-unstripped-libs',
|
||||||
|
action='store_true',
|
||||||
|
default=False,
|
||||||
|
help='Use unstripped .so files within libwebrtc.aar')
|
||||||
parser.add_argument('--verbose',
|
parser.add_argument('--verbose',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
@ -197,14 +201,16 @@ def CollectCommon(aar_file, build_dir, arch):
|
|||||||
aar_file.write(os.path.join(output_directory, JAR_FILE), 'classes.jar')
|
aar_file.write(os.path.join(output_directory, JAR_FILE), 'classes.jar')
|
||||||
|
|
||||||
|
|
||||||
def Collect(aar_file, build_dir, arch):
|
def Collect(aar_file, build_dir, arch, unstripped):
|
||||||
"""Collects architecture specific files into the .aar-archive."""
|
"""Collects architecture specific files into the .aar-archive."""
|
||||||
logging.info('Collecting: %s', arch)
|
logging.info('Collecting: %s', arch)
|
||||||
output_directory = _GetOutputDirectory(build_dir, arch)
|
output_directory = _GetOutputDirectory(build_dir, arch)
|
||||||
|
|
||||||
abi_dir = os.path.join('jni', arch)
|
abi_dir = os.path.join('jni', arch)
|
||||||
for so_file in NEEDED_SO_FILES:
|
for so_file in NEEDED_SO_FILES:
|
||||||
aar_file.write(os.path.join(output_directory, so_file),
|
source_so_file = os.path.join("lib.unstripped",
|
||||||
|
so_file) if unstripped else so_file
|
||||||
|
aar_file.write(os.path.join(output_directory, source_so_file),
|
||||||
os.path.join(abi_dir, so_file))
|
os.path.join(abi_dir, so_file))
|
||||||
|
|
||||||
|
|
||||||
@ -220,7 +226,8 @@ def BuildAar(archs,
|
|||||||
extra_gn_args=None,
|
extra_gn_args=None,
|
||||||
ext_build_dir=None,
|
ext_build_dir=None,
|
||||||
extra_gn_switches=None,
|
extra_gn_switches=None,
|
||||||
extra_ninja_switches=None):
|
extra_ninja_switches=None,
|
||||||
|
unstripped=False):
|
||||||
extra_gn_args = extra_gn_args or []
|
extra_gn_args = extra_gn_args or []
|
||||||
extra_gn_switches = extra_gn_switches or []
|
extra_gn_switches = extra_gn_switches or []
|
||||||
extra_ninja_switches = extra_ninja_switches or []
|
extra_ninja_switches = extra_ninja_switches or []
|
||||||
@ -234,7 +241,7 @@ def BuildAar(archs,
|
|||||||
# Architecture doesn't matter here, arbitrarily using the first one.
|
# Architecture doesn't matter here, arbitrarily using the first one.
|
||||||
CollectCommon(aar_file, build_dir, archs[0])
|
CollectCommon(aar_file, build_dir, archs[0])
|
||||||
for arch in archs:
|
for arch in archs:
|
||||||
Collect(aar_file, build_dir, arch)
|
Collect(aar_file, build_dir, arch, unstripped)
|
||||||
|
|
||||||
license_dir = os.path.dirname(os.path.realpath(output_file))
|
license_dir = os.path.dirname(os.path.realpath(output_file))
|
||||||
GenerateLicenses(license_dir, build_dir, archs)
|
GenerateLicenses(license_dir, build_dir, archs)
|
||||||
@ -248,7 +255,8 @@ def main():
|
|||||||
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
|
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
|
||||||
|
|
||||||
BuildAar(args.arch, args.output, args.use_goma, args.extra_gn_args,
|
BuildAar(args.arch, args.output, args.use_goma, args.extra_gn_args,
|
||||||
args.build_dir, args.extra_gn_switches, args.extra_ninja_switches)
|
args.build_dir, args.extra_gn_switches, args.extra_ninja_switches,
|
||||||
|
args.use_unstripped_libs)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user