soong: Omit redundant stems

This commit is contained in:
Danny Lin 2021-11-07 07:15:24 -08:00
parent 1e7f04d7c4
commit 91eac475fc

View file

@ -16,7 +16,7 @@ export interface TargetSrcs {
} }
export interface SharedLibraryModule { export interface SharedLibraryModule {
stem: string stem?: string
relative_install_path?: string relative_install_path?: string
strip: { strip: {
none: boolean none: boolean
@ -32,7 +32,7 @@ export interface SharedLibraryModule {
export interface ExecutableModule { export interface ExecutableModule {
srcs: Array<string> srcs: Array<string>
stem: string stem?: string
relative_install_path?: string relative_install_path?: string
check_elf_files: boolean check_elf_files: boolean
prefer: boolean prefer: boolean
@ -134,7 +134,7 @@ export function blobToSoongModule(
moduleSpecific = { moduleSpecific = {
_type: 'cc_prebuilt_binary', _type: 'cc_prebuilt_binary',
srcs: [entry.srcPath], srcs: [entry.srcPath],
stem: path.basename(entry.path), ...(name != pathParts.at(-1) && { stem: pathParts.at(-1) }),
...(relPath && { relative_install_path: relPath }), ...(relPath && { relative_install_path: relPath }),
check_elf_files: false, check_elf_files: false,
prefer: true, prefer: true,
@ -187,9 +187,10 @@ export function blobToSoongModule(
srcs: [otherSrcPath], srcs: [otherSrcPath],
} as TargetSrcs } as TargetSrcs
let origFileName = pathParts.at(-1)?.replace(/\.so$/, '')
moduleSpecific = { moduleSpecific = {
_type: 'cc_prebuilt_library_shared', _type: 'cc_prebuilt_library_shared',
stem: path.basename(entry.path, '.so'), ...(name != origFileName && { stem: origFileName }),
...(relPath && { relative_install_path: relPath }), ...(relPath && { relative_install_path: relPath }),
strip: { strip: {
none: true, none: true,