diff options
author | Jiyong Park <jiyong@google.com> | 2017-01-20 08:57:02 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2017-03-14 09:13:44 +0900 |
commit | 4c48f724e1b339128447ab1dafd656a9557557f5 (patch) | |
tree | fb919348ccdce51fade25cc5feb029f881cec22f /cc/library.go | |
parent | 300151ba19bfa79a68e25223f8864d34cf5039f6 (diff) | |
download | build_soong-4c48f724e1b339128447ab1dafd656a9557557f5.tar.gz build_soong-4c48f724e1b339128447ab1dafd656a9557557f5.tar.bz2 build_soong-4c48f724e1b339128447ab1dafd656a9557557f5.zip |
install *.so in different paths for their types
Shared libraries are now installed to different directories depending on
their types.
* NDK libraries: /system/lib/ndk
* VNDK libraries: /system/lib/vndk
* VNDK-ext libraries: /system/lib/vndk-ext
* Framework-only libraries: /system/lib
* Vendor-only libraries: /vendor/lib
* Same-process HALs: /vendor/lib/sameprocess
In addition, a new module type vndk_ext_library is added. It is almost
identical to cc_shared_library but it introduces another attribute
'extends'. This is use to reference the vndk library that this vndk-ext
library is extending.
For example, in order to extend a vndk library libFoo:
cc_library {
name: "libFoo",
srcs: [...]
}
---------------------
vndk_ext_library {
name: "libFoo-extended",
srcs: [...]
extends: "libFoo"
}
Then, libFoo will be installed as /system/lib/vndk/libFoo.so and
libFoo-extended will be installed as /system/lib/vndk-ext/libFoo.so.
Note that file name of the latter is libFoo.so, not libFoo-extended.so:
file name of an extending module is automatically set to that of the
extended module.
Bug: 33681361
Test: build & run. Libraries must be in the correct directories.
Change-Id: Ia1eb3940605d582a252c78da0f3a5b36fdab062b
Diffstat (limited to 'cc/library.go')
-rw-r--r-- | cc/library.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cc/library.go b/cc/library.go index f7194e46..b5512bb2 100644 --- a/cc/library.go +++ b/cc/library.go @@ -587,6 +587,26 @@ func (library *libraryDecorator) toc() android.OptionalPath { func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) { if !ctx.static() { + if ctx.Device() { + if ctx.isNdk() { + library.baseInstaller.subDir = "ndk" + if ctx.Proprietary() { + ctx.ModuleErrorf("NDK library must not be proprietary") + } + } else if ctx.isVndk() { + library.baseInstaller.subDir = "vndk" + if ctx.Proprietary() { + ctx.ModuleErrorf("VNDK library must not be proprietary") + } + } else if ctx.isSameProcessHal() { + library.baseInstaller.subDir = "sameprocess" + if !ctx.Proprietary() { + ctx.ModuleErrorf("SameProcess HAL library must be proprietary") + } + } else { + // Do nothing for other types of lib + } + } library.baseInstaller.install(ctx, file) } } |