Merge "VNDK lib must not have product_specific: true
"
This commit is contained in:
6
cc/cc.go
6
cc/cc.go
@@ -1757,6 +1757,7 @@ func imageMutator(mctx android.BottomUpMutatorContext) {
|
|||||||
|
|
||||||
// Sanity check
|
// Sanity check
|
||||||
vendorSpecific := mctx.SocSpecific() || mctx.DeviceSpecific()
|
vendorSpecific := mctx.SocSpecific() || mctx.DeviceSpecific()
|
||||||
|
productSpecific := mctx.ProductSpecific()
|
||||||
|
|
||||||
if m.VendorProperties.Vendor_available != nil && vendorSpecific {
|
if m.VendorProperties.Vendor_available != nil && vendorSpecific {
|
||||||
mctx.PropertyErrorf("vendor_available",
|
mctx.PropertyErrorf("vendor_available",
|
||||||
@@ -1766,6 +1767,11 @@ func imageMutator(mctx android.BottomUpMutatorContext) {
|
|||||||
|
|
||||||
if vndkdep := m.vndkdep; vndkdep != nil {
|
if vndkdep := m.vndkdep; vndkdep != nil {
|
||||||
if vndkdep.isVndk() {
|
if vndkdep.isVndk() {
|
||||||
|
if productSpecific {
|
||||||
|
mctx.PropertyErrorf("product_specific",
|
||||||
|
"product_specific must not be true when `vndk: {enabled: true}`")
|
||||||
|
return
|
||||||
|
}
|
||||||
if vendorSpecific {
|
if vendorSpecific {
|
||||||
if !vndkdep.isVndkExt() {
|
if !vndkdep.isVndkExt() {
|
||||||
mctx.PropertyErrorf("vndk",
|
mctx.PropertyErrorf("vndk",
|
||||||
|
@@ -492,6 +492,21 @@ func TestVndkDepError(t *testing.T) {
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestVndkMustNotBeProductSpecific(t *testing.T) {
|
||||||
|
// Check whether an error is emitted when a vndk lib has 'product_specific: true'.
|
||||||
|
testCcError(t, "product_specific must not be true when `vndk: {enabled: true}`", `
|
||||||
|
cc_library {
|
||||||
|
name: "libvndk",
|
||||||
|
product_specific: true, // Cause error
|
||||||
|
vendor_available: true,
|
||||||
|
vndk: {
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
nocrt: true,
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
func TestVndkExt(t *testing.T) {
|
func TestVndkExt(t *testing.T) {
|
||||||
// This test checks the VNDK-Ext properties.
|
// This test checks the VNDK-Ext properties.
|
||||||
ctx := testCc(t, `
|
ctx := testCc(t, `
|
||||||
|
Reference in New Issue
Block a user