diff options
author | Arvind Kumar <karvin@codeaurora.org> | 2021-10-11 22:46:31 +0530 |
---|---|---|
committer | Arvind Kumar <karvin@codeaurora.org> | 2021-10-19 17:22:46 +0530 |
commit | 24a8a69dba1a880066556108af4d78d358687d9f (patch) | |
tree | 21a1e1935d44309262d23d268446838f9145a019 | |
parent | ec79f086fd5c29a957e8858f018557bf5095b2c5 (diff) |
lights: Add soong configs for lights aidl
To resolve compilation issue for legacy targets
where lights aidl is not required, adding soong module
and configs for lights aidl to remove shared
libs dependency for legacy target and adding
shared libs dependency only for target defined
in soong_config_variables.
Change-Id: I3d42ebe9cee37804ec684e9c189c13df2e7cd3d1
-rw-r--r-- | base.mk | 12 | ||||
-rw-r--r-- | lights/Android.bp | 42 |
2 files changed, 53 insertions, 1 deletions
@@ -606,6 +606,18 @@ LIBPOWER += android.hardware.power@1.0-impl LIBPOWER += android.hardware.power@1.0-service endif +ifeq ($(PLATFORM_VERSION), $(filter $(PLATFORM_VERSION),R 11)) + SOONG_CONFIG_NAMESPACES += lights + SOONG_CONFIG_lights += lighttargets + SOONG_CONFIG_lights_lighttargets := lightaidltarget +endif + +ifeq ($(PLATFORM_VERSION), $(filter $(PLATFORM_VERSION),S 12)) + SOONG_CONFIG_NAMESPACES += lights + SOONG_CONFIG_lights += lighttargets + SOONG_CONFIG_lights_lighttargets := lightaidlV1target +endif + #LLVM for RenderScript #use qcom LLVM $(call inherit-product-if-exists, external/llvm/llvm-select.mk) diff --git a/lights/Android.bp b/lights/Android.bp index cd4c44e..523285a 100644 --- a/lights/Android.bp +++ b/lights/Android.bp @@ -1,5 +1,46 @@ +// This introduces the module type lights_cc_defaults +// If target.mk file contained: +// +// SOONG_CONFIG_NAMESPACES += lights +// SOONG_CONFIG_lights += lighttargets +// SOONG_CONFIG_lights_lighttargets := lightaidltarget +// +// Then ligets lib would build with shared_libs + +soong_config_module_type { + name: "lights_cc_defaults", + module_type: "cc_defaults", + config_namespace: "lights", + variables: ["lighttargets"], + properties: ["shared_libs"], +} + +soong_config_string_variable { + name: "lighttargets", + values: ["lightaidltarget", "lightaidlV1target"], +} + +lights_cc_defaults { + name: "lights_defaults", + soong_config_variables: { + lighttargets: { + lightaidltarget: { + shared_libs: [ + "android.hardware.light-ndk_platform", + ], + }, + lightaidlV1target: { + shared_libs: [ + "android.hardware.light-V1-ndk_platform", + ], + }, + }, + }, +} + cc_binary { name: "android.hardware.lights-service.qti", + defaults: ["lights_defaults"], relative_install_path: "hw", init_rc: ["android.hardware.lights-qti.rc"], vintf_fragments: ["android.hardware.lights-qti.xml"], @@ -9,7 +50,6 @@ cc_binary { "liblog", "libhardware", "libbinder_ndk", - "android.hardware.light-ndk_platform", ], srcs: [ "Lights.cpp", |