Commit 377bdba3 authored by Tobias Sargeant's avatar Tobias Sargeant Committed by Commit Bot

Make library basename generation more robust.

The aim is to turn (e.g.) libmonochrome.so into monochrome, but in the
secondary abi case the path passed has a directory component, which
means that an incorrect library name is generated.

This CL changes the implementation to be more robust to directory
components and the length of the extension.

Bug: 988041
Change-Id: Idfca8a38bbb4fdd2a136a64f14c9f00b675776c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1720876Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Tobias Sargeant <tobiasjs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681853}
parent 17def0f2
......@@ -70,9 +70,14 @@ def main():
continue
lib_paths.append(line)
def LibBasename(path):
filename = os.path.split(path)[1]
base = os.path.splitext(filename)[0]
return base[3:] # remove lib prefix
# Convert to "base" library names: e.g. libfoo.so -> foo.
native_libraries_list = (
'{%s}' % ','.join(['"%s"' % s[3:-3] for s in lib_paths]))
'{%s}' % ','.join(['"%s"' % LibBasename(s) for s in lib_paths]))
def bool_str(value):
if value:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment