summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArvind Kumar <karvin@codeaurora.org>2021-10-11 22:46:31 +0530
committerArvind Kumar <karvin@codeaurora.org>2021-10-19 17:22:46 +0530
commit24a8a69dba1a880066556108af4d78d358687d9f (patch)
tree21a1e1935d44309262d23d268446838f9145a019
parentec79f086fd5c29a957e8858f018557bf5095b2c5 (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.mk12
-rw-r--r--lights/Android.bp42
2 files changed, 53 insertions, 1 deletions
diff --git a/base.mk b/base.mk
index e8f1e8d..18c5e45 100644
--- a/base.mk
+++ b/base.mk
@@ -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",