forked from intel/IA-Hardware-Composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAndroid.common.mk
139 lines (115 loc) · 3.41 KB
/
Android.common.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Copyright (c) 2017 Intel Corporation
#
# 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.
ifeq ($(strip $(BOARD_USES_IA_HWCOMPOSER)), true)
# Obtain root HWC source path
HWC_PATH := $(call my-dir)
HWC_VERSION_GIT_BRANCH := $(shell pushd $(HWC_PATH) > /dev/null; git rev-parse --abbrev-ref HEAD; popd > /dev/null)
HWC_VERSION_GIT_SHA := $(shell pushd $(HWC_PATH) > /dev/null; git rev-parse HEAD; popd > /dev/null)
# Obtain Android Version
ANDROID_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdrm \
libEGL \
libGLESv2 \
libhardware \
liblog \
libui \
libutils \
libhwcservice \
libbinder
LOCAL_C_INCLUDES := \
system/core/include/utils \
frameworks/native/libs/nativewindow/include \
frameworks/native/libs/nativewindow \
$(LOCAL_PATH)/public \
$(LOCAL_PATH)/common/core \
$(LOCAL_PATH)/common/compositor \
$(LOCAL_PATH)/common/compositor/gl \
$(LOCAL_PATH)/common/display \
$(LOCAL_PATH)/common/utils \
$(LOCAL_PATH)/os \
$(LOCAL_PATH)/os/android \
$(LOCAL_PATH)/wsi \
$(LOCAL_PATH)/wsi/drm
LOCAL_SRC_FILES := \
os/platformcommondrmdefines.cpp \
os/android/platformdefines.cpp
ifeq ($(strip $(TARGET_USES_HWC2)), true)
LOCAL_SRC_FILES += os/android/iahwc2.cpp \
os/android/hwcservice.cpp
else
LOCAL_SRC_FILES += os/android/iahwc1.cpp
LOCAL_C_INCLUDES += \
system/core/libsync \
system/core/libsync/include
LOCAL_SHARED_LIBRARIES += \
libsync
LOCAL_CPPFLAGS += -DENABLE_DOUBLE_BUFFERING
endif
LOCAL_CPPFLAGS += -DUSE_GRALLOC1
ifeq ($(strip $(ENABLE_NESTED_DISPLAY_SUPPORT)), true)
LOCAL_CPPFLAGS += -DNESTED_DISPLAY_SUPPORT
endif
LOCAL_SRC_FILES += os/android/gralloc1bufferhandler.cpp
LOCAL_CPPFLAGS += \
-DHWC_VERSION_GIT_BRANCH="\"$(HWC_VERSION_GIT_BRANCH)\"" \
-DHWC_VERSION_GIT_SHA="\"$(HWC_VERSION_GIT_SHA)\"" \
-DHWC2_INCLUDE_STRINGIFICATION \
-DHWC2_USE_CPP11 \
-Wno-date-time \
-DUSE_ANDROID_SHIM \
-D_FORTIFY_SOURCE=2 \
-fstack-protector-strong \
-Wformat -Wformat-security \
-std=c++14 -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
-Wall -Wsign-compare -Wpointer-arith \
-Wcast-qual -Wcast-align \
-D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
-O3 \
-Wno-unused-private-field \
-Wno-unused-function \
-Wno-unused-parameter \
-Wno-unused-variable
ifeq ($(strip $(BOARD_USES_VULKAN)), true)
LOCAL_SHARED_LIBRARIES += \
libvulkan
LOCAL_CPPFLAGS += \
-DUSE_VK \
-DDISABLE_EXPLICIT_SYNC
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/common/compositor/vk \
$(LOCAL_PATH)/../mesa/include
else
LOCAL_CPPFLAGS += \
-DUSE_GL \
-DENABLE_RBC
endif
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/common/compositor/va
LOCAL_SHARED_LIBRARIES += \
libva \
libva-android
LOCAL_C_INCLUDES += \
$(INTEL_MINIGBM)/cros_gralloc/
ifeq ($(shell test $(ANDROID_VERSION) -ge 8; echo $$?), 0)
LOCAL_SHARED_LIBRARIES += libnativewindow
endif
ifeq ($(strip $(BOARD_CURSOR_WA)), true)
LOCAL_CPPFLAGS += \
-DDISABLE_CURSOR_PLANE
endif
endif