vendor: Add project pathmap defs
[micky387] Squashed lot of commits and clean uneeded codes
For eg, like lahaina platform, Add this to your boardconfig
QCOM_HARDWARE_VARIANT := sm8350
Add your Qcom repo to you omni_depencencies with this "target_path": "hardware/qcom-caf/sm8350/media"
Change-Id: I5357eadcf6efe6ddbd6686ed69db0d59114e0a5d
diff --git a/build/core/pathmap.mk b/build/core/pathmap.mk
new file mode 100644
index 0000000..917bd9b
--- /dev/null
+++ b/build/core/pathmap.mk
@@ -0,0 +1,16 @@
+# Enter project path into pathmap
+#
+# $(1): name
+# $(2): path
+#
+define project-set-path
+$(eval pathmap_PROJ += $(1):$(2))
+endef
+
+# Returns the path to the requested module's include directory,
+# relative to the root of the source tree.
+#
+# $(1): a list of modules (or other named entities) to find the projects for
+define project-path-for
+$(foreach n,$(1),$(patsubst $(n):%,%,$(filter $(n):%,$(pathmap_PROJ))))
+endef
diff --git a/build/core/qcom_target.mk b/build/core/qcom_target.mk
index 2e5c042..22b3ab3 100644
--- a/build/core/qcom_target.mk
+++ b/build/core/qcom_target.mk
@@ -1,5 +1,6 @@
# Bring in Qualcomm helper macros
include vendor/omni/build/core/qcom_utils.mk
+include vendor/omni/build/core/pathmap.mk
# Target-specific configuration
ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
@@ -24,4 +25,29 @@
MSM_VIDC_TARGET_LIST := msm8974 msm8610 msm8226 apq8084 msm8916 msm8937 msm8952 msm8953 msm8994 msm8909 msm8992 msm8996 msm8998 sdm660 sdm710 sdm845 sm8150 msmnile
endif
+# Set device-specific HALs into project pathmap
+define set-device-specific-path
+$(if $(USE_DEVICE_SPECIFIC_$(1)), \
+ $(if $(DEVICE_SPECIFIC_$(1)_PATH), \
+ $(eval path := $(DEVICE_SPECIFIC_$(1)_PATH)), \
+ $(eval path := $(TARGET_DEVICE_DIR)/$(2))), \
+ $(eval path := $(3))) \
+$(call project-set-path,qcom-$(2),$(strip $(path)))
+endef
+ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
+
+$(call set-device-specific-path,AUDIO,audio,hardware/qcom-caf/$(QCOM_HARDWARE_VARIANT)/audio)
+$(call set-device-specific-path,DISPLAY,display,hardware/qcom-caf/$(QCOM_HARDWARE_VARIANT)/display)
+$(call set-device-specific-path,MEDIA,media,hardware/qcom-caf/$(QCOM_HARDWARE_VARIANT)/media)
+
+$(call set-device-specific-path,BT_VENDOR,bt-vendor,hardware/qcom-caf/bt)
+$(call set-device-specific-path,DATA_IPA_CFG_MGR,data-ipa-cfg-mgr,vendor/qcom/opensource/data-ipa-cfg-mgr)
+$(call set-device-specific-path,DATASERVICES,dataservices,vendor/qcom/opensource/dataservices)
+$(call set-device-specific-path,VR,vr,hardware/qcom-caf/vr)
+$(call set-device-specific-path,WLAN,wlan,hardware/qcom-caf/wlan)
+
+PRODUCT_CFI_INCLUDE_PATHS += \
+ hardware/qcom-caf/wlan/qcwcn/wpa_supplicant_8_lib
+
+endif