aboutsummaryrefslogtreecommitdiffstats
path: root/cc/cc.go
diff options
context:
space:
mode:
authorJustin Yun <justinyun@google.com>2017-11-17 12:10:28 +0900
committerJustin Yun <justinyun@google.com>2017-12-05 10:19:43 +0900
commit7154928c93e062775c1d3885ed59a5b61c48e168 (patch)
tree0047694a146398263efaf491dbbfcfbd7197fc9d /cc/cc.go
parent5760c9a12c0660c8639d11d770236bea7a900b1a (diff)
downloadbuild_soong-7154928c93e062775c1d3885ed59a5b61c48e168.tar.gz
build_soong-7154928c93e062775c1d3885ed59a5b61c48e168.tar.bz2
build_soong-7154928c93e062775c1d3885ed59a5b61c48e168.zip
Install VNDK snapshot libraries for system build
When BOARD_VNDK_VERSION := <VNDK version>, or PRODUCT_EXTRA_VNDK_VERSIONS includes the needed <VNDK version> list, the prebuilt VNDK libs in prebuilts/vndk/ directory will be installed. Each prebuilt VNDK module uses "vndk_prebuilt_shared" for shared VNDK/VNDK-SP libs. Following is the sample configuration of a vndk snapshot module: vndk_prebuilt_shared { name: "libfoo", version: "27", vendor_available: true, vndk: { enabled: true, }, arch: { arm64: { srcs: ["arm/lib64/libfoo.so"], }, arm: { srcs: ["arm/lib/libfoo.so"], }, }, } The Android.bp for the snapshot modules will be auto-generated by a script. Bug: 38304393 Bug: 65377115 Bug: 68123344 Test: set BOARD_VNDK_VERSION := 27 copy a snapshot for v27 build with make command Change-Id: Ib93107530dbabb4a24583f4d6e4f0c513c9adfec
Diffstat (limited to 'cc/cc.go')
-rw-r--r--cc/cc.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cc/cc.go b/cc/cc.go
index 891dccb0..c31cf042 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1372,7 +1372,7 @@ func vendorMutator(mctx android.BottomUpMutatorContext) {
if genrule, ok := mctx.Module().(*genrule.Module); ok {
if props, ok := genrule.Extra.(*VendorProperties); ok {
- if !mctx.DeviceConfig().CompileVndk() {
+ if mctx.DeviceConfig().VndkVersion() == "" {
mctx.CreateVariations(coreMode)
} else if Bool(props.Vendor_available) {
mctx.CreateVariations(coreMode, vendorMode)
@@ -1408,7 +1408,7 @@ func vendorMutator(mctx android.BottomUpMutatorContext) {
}
}
- if !mctx.DeviceConfig().CompileVndk() {
+ if mctx.DeviceConfig().VndkVersion() == "" {
// If the device isn't compiling against the VNDK, we always
// use the core mode.
mctx.CreateVariations(coreMode)
@@ -1419,6 +1419,12 @@ func vendorMutator(mctx android.BottomUpMutatorContext) {
} else if _, ok := m.linker.(*llndkHeadersDecorator); ok {
// ... and LL-NDK headers as well
mctx.CreateVariations(vendorMode)
+ } else if _, ok := m.linker.(*vndkPrebuiltLibraryDecorator); ok {
+ // Make vendor variants only for the versions in BOARD_VNDK_VERSION and
+ // PRODUCT_EXTRA_VNDK_VERSIONS.
+ mod := mctx.CreateVariations(vendorMode)
+ vendor := mod[0].(*Module)
+ vendor.Properties.UseVndk = true
} else if m.hasVendorVariant() {
// This will be available in both /system and /vendor
// or a /system directory that is available to vendor.