From a1c66a2993b0c63c5074f8f29d7107631208cfe2 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Tue, 30 Aug 2022 15:13:10 -0700 Subject: [PATCH] Add cc_defaults wrapper for android.hardware.graphics.allocator ndk package. - to avoid manually rev up if needed. Bug: 243429120 Test: builds Change-Id: I25bfcc203cda61af308c37c3766fa9efe6c6784c Merged-In: I25bfcc203cda61af308c37c3766fa9efe6c6784c --- graphics/Android.bp | 59 +++++++++++++++++++ graphics/allocator/aidl/vts/Android.bp | 3 +- graphics/composer/2.1/utils/vts/Android.bp | 7 ++- .../composer/2.1/vts/functional/Android.bp | 6 +- graphics/composer/2.2/utils/vts/Android.bp | 8 ++- .../composer/2.2/vts/functional/Android.bp | 3 +- graphics/composer/2.3/utils/vts/Android.bp | 5 +- .../composer/2.3/vts/functional/Android.bp | 6 +- graphics/composer/2.4/utils/vts/Android.bp | 6 +- .../composer/2.4/vts/functional/Android.bp | 6 +- graphics/mapper/4.0/utils/vts/Android.bp | 8 ++- graphics/mapper/4.0/vts/functional/Android.bp | 3 +- sensors/common/vts/utils/Android.bp | 14 +++-- 13 files changed, 107 insertions(+), 27 deletions(-) create mode 100644 graphics/Android.bp diff --git a/graphics/Android.bp b/graphics/Android.bp new file mode 100644 index 0000000000..b48844d475 --- /dev/null +++ b/graphics/Android.bp @@ -0,0 +1,59 @@ +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_defaults { + name: "android.hardware.graphics.allocator-ndk_static", + static_libs: [ + "android.hardware.graphics.allocator-V1-ndk", + ], +} + +cc_defaults { + name: "android.hardware.graphics.allocator-ndk_shared", + shared_libs: [ + "android.hardware.graphics.allocator-V1-ndk", + ], +} + +cc_defaults { + name: "android.hardware.graphics.common-ndk_static", + static_libs: [ + "android.hardware.graphics.common-V3-ndk", + ], +} + +cc_defaults { + name: "android.hardware.graphics.common-ndk_shared", + shared_libs: [ + "android.hardware.graphics.common-V3-ndk", + ], +} + +cc_defaults { + name: "android.hardware.graphics.composer3-ndk_static", + static_libs: [ + "android.hardware.graphics.composer3-V1-ndk", + ], +} + +cc_defaults { + name: "android.hardware.graphics.composer3-ndk_shared", + shared_libs: [ + "android.hardware.graphics.composer3-V1-ndk", + ], +} diff --git a/graphics/allocator/aidl/vts/Android.bp b/graphics/allocator/aidl/vts/Android.bp index 99ffb24079..a38af14730 100644 --- a/graphics/allocator/aidl/vts/Android.bp +++ b/graphics/allocator/aidl/vts/Android.bp @@ -27,6 +27,7 @@ cc_test { name: "VtsHalGraphicsAllocatorAidl_TargetTest", defaults: [ "VtsHalTargetTestDefaults", + "android.hardware.graphics.allocator-ndk_shared", "use_libaidlvintf_gtest_helper_static", "hwui_defaults", ], @@ -35,8 +36,6 @@ cc_test { ], shared_libs: [ - "android.hardware.graphics.allocator-V1-ndk", - "android.hardware.graphics.common-V3-ndk", "android.hardware.graphics.mapper@4.0", "libEGL", "libGLESv2", diff --git a/graphics/composer/2.1/utils/vts/Android.bp b/graphics/composer/2.1/utils/vts/Android.bp index c0a0c078b2..7b6a0e6367 100644 --- a/graphics/composer/2.1/utils/vts/Android.bp +++ b/graphics/composer/2.1/utils/vts/Android.bp @@ -25,14 +25,16 @@ package { cc_library_static { name: "android.hardware.graphics.composer@2.1-vts", - defaults: ["hidl_defaults"], + defaults: [ + "android.hardware.graphics.allocator-ndk_static", + "hidl_defaults", + ], srcs: [ "ComposerVts.cpp", "GraphicsComposerCallback.cpp", "TestCommandReader.cpp", ], static_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.mapper@2.0-vts", "android.hardware.graphics.mapper@3.0-vts", @@ -40,7 +42,6 @@ cc_library_static { "libgtest", ], export_static_lib_headers: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.mapper@2.0-vts", "android.hardware.graphics.mapper@3.0-vts", diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp index 502036edb4..0f6d7e8eba 100644 --- a/graphics/composer/2.1/vts/functional/Android.bp +++ b/graphics/composer/2.1/vts/functional/Android.bp @@ -25,7 +25,10 @@ package { cc_test { name: "VtsHalGraphicsComposerV2_1TargetTest", - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalTargetTestDefaults", + "android.hardware.graphics.allocator-ndk_static", + ], tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_1TargetTest.cpp"], srcs: ["VtsHalGraphicsComposerV2_1TargetTest.cpp"], @@ -42,7 +45,6 @@ cc_test { "android.hardware.graphics.mapper@4.0", ], static_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp index cca53230ae..e383ce20de 100644 --- a/graphics/composer/2.2/utils/vts/Android.bp +++ b/graphics/composer/2.2/utils/vts/Android.bp @@ -25,7 +25,11 @@ package { cc_library_static { name: "android.hardware.graphics.composer@2.2-vts", - defaults: ["hidl_defaults"], + defaults: [ + "android.hardware.graphics.allocator-ndk_static", + "android.hardware.graphics.composer3-ndk_static", + "hidl_defaults", + ], srcs: [ "ComposerVts.cpp", "ReadbackVts.cpp", @@ -35,7 +39,6 @@ cc_library_static { "libui", ], static_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.composer3-V1-ndk", @@ -53,7 +56,6 @@ cc_library_static { "android.hardware.graphics.mapper@4.0-vts", ], export_static_lib_headers: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.mapper@2.1-vts", diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp index 960b62da8a..cdc7a93025 100644 --- a/graphics/composer/2.2/vts/functional/Android.bp +++ b/graphics/composer/2.2/vts/functional/Android.bp @@ -27,6 +27,8 @@ cc_test { name: "VtsHalGraphicsComposerV2_2TargetTest", defaults: [ "VtsHalTargetTestDefaults", + "android.hardware.graphics.allocator-ndk_static", + "android.hardware.graphics.composer3-ndk_static", // Needed for librenderengine "skia_deps", ], @@ -59,7 +61,6 @@ cc_test { "android.hardware.graphics.mapper@4.0", ], static_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", diff --git a/graphics/composer/2.3/utils/vts/Android.bp b/graphics/composer/2.3/utils/vts/Android.bp index 7bc07a4428..b372804341 100644 --- a/graphics/composer/2.3/utils/vts/Android.bp +++ b/graphics/composer/2.3/utils/vts/Android.bp @@ -25,7 +25,10 @@ package { cc_library_static { name: "android.hardware.graphics.composer@2.3-vts", - defaults: ["hidl_defaults"], + defaults: [ + "android.hardware.graphics.allocator-ndk_static", + "hidl_defaults", + ], srcs: [ "ComposerVts.cpp", ], diff --git a/graphics/composer/2.3/vts/functional/Android.bp b/graphics/composer/2.3/vts/functional/Android.bp index 40b77d5a15..13f2b113ab 100644 --- a/graphics/composer/2.3/vts/functional/Android.bp +++ b/graphics/composer/2.3/vts/functional/Android.bp @@ -25,7 +25,10 @@ package { cc_test { name: "VtsHalGraphicsComposerV2_3TargetTest", - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalTargetTestDefaults", + "android.hardware.graphics.allocator-ndk_static", + ], tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_3TargetTest.cpp"], srcs: ["VtsHalGraphicsComposerV2_3TargetTest.cpp"], @@ -43,7 +46,6 @@ cc_test { "android.hardware.graphics.mapper@4.0", ], static_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", diff --git a/graphics/composer/2.4/utils/vts/Android.bp b/graphics/composer/2.4/utils/vts/Android.bp index de3197573d..d2b2ffab9a 100644 --- a/graphics/composer/2.4/utils/vts/Android.bp +++ b/graphics/composer/2.4/utils/vts/Android.bp @@ -25,14 +25,16 @@ package { cc_library_static { name: "android.hardware.graphics.composer@2.4-vts", - defaults: ["hidl_defaults"], + defaults: [ + "android.hardware.graphics.allocator-ndk_static", + "hidl_defaults", + ], srcs: [ "ComposerVts.cpp", "GraphicsComposerCallback.cpp", "TestCommandReader.cpp", ], static_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.composer@2.3-vts", diff --git a/graphics/composer/2.4/vts/functional/Android.bp b/graphics/composer/2.4/vts/functional/Android.bp index b73ea9403e..b4ab259dd6 100644 --- a/graphics/composer/2.4/vts/functional/Android.bp +++ b/graphics/composer/2.4/vts/functional/Android.bp @@ -25,7 +25,10 @@ package { cc_test { name: "VtsHalGraphicsComposerV2_4TargetTest", - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalTargetTestDefaults", + "android.hardware.graphics.allocator-ndk_static", + ], tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_4TargetTest.cpp"], srcs: ["VtsHalGraphicsComposerV2_4TargetTest.cpp"], @@ -42,7 +45,6 @@ cc_test { "android.hardware.graphics.mapper@4.0", ], static_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.allocator@3.0", "android.hardware.graphics.allocator@4.0", diff --git a/graphics/mapper/4.0/utils/vts/Android.bp b/graphics/mapper/4.0/utils/vts/Android.bp index 7abf5dba24..269b972ded 100644 --- a/graphics/mapper/4.0/utils/vts/Android.bp +++ b/graphics/mapper/4.0/utils/vts/Android.bp @@ -25,14 +25,17 @@ package { cc_library_static { name: "android.hardware.graphics.mapper@4.0-vts", - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalTargetTestDefaults", + "android.hardware.graphics.allocator-ndk_static", + "android.hardware.graphics.common-ndk_static", + ], srcs: ["MapperVts.cpp"], cflags: [ "-O0", "-g", ], static_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@4.0", "android.hardware.graphics.common-V3-ndk", "android.hardware.graphics.mapper@4.0", @@ -44,7 +47,6 @@ cc_library_static { "libvndksupport", ], export_static_lib_headers: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@4.0", "android.hardware.graphics.common-V3-ndk", "android.hardware.graphics.mapper@4.0", diff --git a/graphics/mapper/4.0/vts/functional/Android.bp b/graphics/mapper/4.0/vts/functional/Android.bp index e83063367d..8f3e7ebee9 100644 --- a/graphics/mapper/4.0/vts/functional/Android.bp +++ b/graphics/mapper/4.0/vts/functional/Android.bp @@ -27,6 +27,8 @@ cc_test { name: "VtsHalGraphicsMapperV4_0TargetTest", defaults: [ "VtsHalTargetTestDefaults", + "android.hardware.graphics.allocator-ndk_shared", + "android.hardware.graphics.common-ndk_static", "use_libaidlvintf_gtest_helper_static", ], srcs: ["VtsHalGraphicsMapperV4_0TargetTest.cpp"], @@ -38,7 +40,6 @@ cc_test { "libsync", ], shared_libs: [ - "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.allocator@4.0", "android.hardware.graphics.common@1.0", "android.hardware.graphics.common@1.1", diff --git a/sensors/common/vts/utils/Android.bp b/sensors/common/vts/utils/Android.bp index 08b6afa202..b35280a541 100644 --- a/sensors/common/vts/utils/Android.bp +++ b/sensors/common/vts/utils/Android.bp @@ -27,9 +27,11 @@ package { // dependencies cc_defaults { name: "VtsHalSensorsDefaults", + defaults: [ + "android.hardware.graphics.allocator-ndk_shared", + "android.hardware.graphics.common-ndk_shared", + ], shared_libs: [ - "android.hardware.graphics.allocator-V1-ndk", - "android.hardware.graphics.common-V3-ndk", "libbinder_ndk", "libutils", "libvndksupport", @@ -42,7 +44,11 @@ cc_defaults { cc_library_static { name: "VtsHalSensorsTargetTestUtils", - defaults: ["VtsHalTargetTestDefaults"], + defaults: [ + "VtsHalTargetTestDefaults", + "android.hardware.graphics.allocator-ndk_shared", + "android.hardware.graphics.common-ndk_shared", + ], cflags: ["-DLOG_TAG=\"sensors_hidl_hal_test\""], srcs: [ "GrallocWrapper.cpp", @@ -55,8 +61,6 @@ cc_library_static { ], // Targets that depend on us need to also include these shared_libs: [ - "android.hardware.graphics.allocator-V1-ndk", - "android.hardware.graphics.common-V3-ndk", "libbinder_ndk", "libutils", "libvndksupport",