1#Common headers
2display_top := $(call my-dir)
3
4#Common C flags
5common_flags := -Wno-missing-field-initializers
6common_flags += -Wconversion -Wall -Werror
7common_flags += -DUSE_GRALLOC1
8ifeq ($(TARGET_IS_HEADLESS), true)
9    common_flags += -DTARGET_HEADLESS
10    LOCAL_CLANG := false
11endif
12
13ifeq ($(TARGET_USES_COLOR_METADATA), true)
14    common_flags += -DUSE_COLOR_METADATA
15endif
16
17ifeq ($(TARGET_USES_QCOM_BSP),true)
18    common_flags += -DQTI_BSP
19endif
20
21ifeq ($(ARCH_ARM_HAVE_NEON),true)
22    common_flags += -D__ARM_HAVE_NEON
23endif
24
25ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
26    common_flags += -DMASTER_SIDE_CP
27endif
28
29use_hwc2 := false
30ifeq ($(TARGET_USES_HWC2), true)
31    use_hwc2 := true
32    common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE
33endif
34
35ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
36    common_flags += -DUSER_DEBUG
37endif
38
39ifeq ($(LLVM_SA), true)
40    common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror
41endif
42
43common_includes := system/libbase/include
44CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
45PLATFORM_SDK_NOUGAT = 25
46ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
47ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true)
48version_flag := -D__NOUGAT__
49
50# These include paths are deprecated post N
51common_includes += $(display_top)/libqdutils
52common_includes += $(display_top)/libqservice
53common_includes += $(display_top)/gpu_tonemapper
54ifneq ($(TARGET_IS_HEADLESS), true)
55    common_includes += $(display_top)/libcopybit
56endif
57
58common_includes += $(display_top)/include
59common_includes += $(display_top)/sdm/include
60common_flags += -isystem $(TARGET_OUT_HEADERS)/qcom/display
61endif
62endif
63
64common_header_export_path := qcom/display
65
66#Common libraries external to display HAL
67common_libs := liblog libutils libcutils libhardware
68common_deps  :=
69kernel_includes :=
70
71ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
72# This check is to pick the kernel headers from the right location.
73# If the macro above is defined, we make the assumption that we have the kernel
74# available in the build tree.
75# If the macro is not present, the headers are picked from $(QC_HARDWARE_ROOT)/msmXXXX
76# failing which, they are picked from bionic.
77    common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
78    kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include \
79                       $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include/display
80endif
81