Support prebuilt shared libs end with versions
This commit changes how `cc/androidmk.go` generates LOCAL_MODULE_STEM, LOCAL_MODULE_SUFFIX, and LOCAL_BUILT_MODULE_STEM. Now, `splitFileExt()` takes a file name and a list of expected file extensions. `splitFileExt()` searches the first occurrence of expected file extensions in the file name. If it can not find any, it will simply return the last file extension. Before this commit, `cc/androidmk.go` simply extracts the last file extension (e.g. `.so`). However, if the prebuilt shared libs end with version numbers (e.g. `libc++.so.1`), it will use `$(LOCAL_MODULE).1` as LOCAL_BUILT_MODULE_STEM and this will lead to missing target ninja error. Bug: 111579848 Test: Build a program that links libc++_host (from prebuilts/clang) Change-Id: Id96726c69705d518ea725bb6abd8ff4527ca0cbc
Loading
Please register or sign in to comment