From 91eac475fc8458ffe636a228905494fd21bb6096 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sun, 7 Nov 2021 07:15:24 -0800 Subject: [PATCH] soong: Omit redundant stems --- src/build/soong.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/build/soong.ts b/src/build/soong.ts index 1883b33..9eb8880 100644 --- a/src/build/soong.ts +++ b/src/build/soong.ts @@ -16,7 +16,7 @@ export interface TargetSrcs { } export interface SharedLibraryModule { - stem: string + stem?: string relative_install_path?: string strip: { none: boolean @@ -32,7 +32,7 @@ export interface SharedLibraryModule { export interface ExecutableModule { srcs: Array - stem: string + stem?: string relative_install_path?: string check_elf_files: boolean prefer: boolean @@ -134,7 +134,7 @@ export function blobToSoongModule( moduleSpecific = { _type: 'cc_prebuilt_binary', srcs: [entry.srcPath], - stem: path.basename(entry.path), + ...(name != pathParts.at(-1) && { stem: pathParts.at(-1) }), ...(relPath && { relative_install_path: relPath }), check_elf_files: false, prefer: true, @@ -187,9 +187,10 @@ export function blobToSoongModule( srcs: [otherSrcPath], } as TargetSrcs + let origFileName = pathParts.at(-1)?.replace(/\.so$/, '') moduleSpecific = { _type: 'cc_prebuilt_library_shared', - stem: path.basename(entry.path, '.so'), + ...(name != origFileName && { stem: origFileName }), ...(relPath && { relative_install_path: relPath }), strip: { none: true,