OSDN Git Service

Squash Static and Android.mk to use Android.common.mk
[android-x86/external-IA-Hardware-Composer.git] / Android.common.mk
1 # Copyright (c) 2017 Intel Corporation
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15
16 ifeq ($(strip $(BOARD_USES_IA_HWCOMPOSER)), true)
17 # Obtain root HWC source path
18 HWC_PATH := $(call my-dir)
19
20 HWC_VERSION_GIT_BRANCH := $(shell pushd $(HWC_PATH) > /dev/null; git rev-parse --abbrev-ref HEAD; popd > /dev/null)
21 HWC_VERSION_GIT_SHA := $(shell pushd $(HWC_PATH) > /dev/null; git rev-parse HEAD; popd > /dev/null)
22
23 # Obtain Android Version
24 ANDROID_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
25
26 LOCAL_PATH := $(call my-dir)
27 include $(CLEAR_VARS)
28
29 LOCAL_SHARED_LIBRARIES := \
30         libcutils \
31         libdrm \
32         libEGL \
33         libGLESv2 \
34         libhardware \
35         liblog \
36         libui \
37         libutils \
38         libhwcservice \
39         libbinder
40
41 LOCAL_C_INCLUDES := \
42         system/core/include/utils \
43         $(LOCAL_PATH)/public \
44         $(LOCAL_PATH)/common/core \
45         $(LOCAL_PATH)/common/compositor \
46         $(LOCAL_PATH)/common/compositor/gl \
47         $(LOCAL_PATH)/common/display \
48         $(LOCAL_PATH)/common/utils \
49         $(LOCAL_PATH)/os \
50         $(LOCAL_PATH)/os/android \
51         $(LOCAL_PATH)/wsi \
52         $(LOCAL_PATH)/wsi/drm
53
54 LOCAL_SRC_FILES := \
55         os/android/platformdefines.cpp
56
57 ifeq ($(strip $(TARGET_USES_HWC2)), true)
58 LOCAL_SRC_FILES += os/android/iahwc2.cpp \
59                    os/android/hwcservice.cpp
60 else
61 LOCAL_SRC_FILES += os/android/iahwc1.cpp
62 LOCAL_C_INCLUDES += \
63         system/core/libsync \
64         system/core/libsync/include
65
66 LOCAL_SHARED_LIBRARIES += \
67         libsync
68
69 LOCAL_CPPFLAGS += -DENABLE_DOUBLE_BUFFERING
70 endif
71
72 ifeq ($(strip $(BOARD_USES_GRALLOC1)), true)
73 LOCAL_SRC_FILES += os/android/gralloc1bufferhandler.cpp
74 else
75 LOCAL_SRC_FILES += os/android/grallocbufferhandler.cpp
76 endif
77
78 LOCAL_CPPFLAGS += \
79         -DHWC_VERSION_GIT_BRANCH="\"$(HWC_VERSION_GIT_BRANCH)\"" \
80         -DHWC_VERSION_GIT_SHA="\"$(HWC_VERSION_GIT_SHA)\"" \
81         -DHWC2_INCLUDE_STRINGIFICATION \
82         -DHWC2_USE_CPP11 \
83         -Wno-date-time \
84         -DUSE_ANDROID_SHIM \
85         -D_FORTIFY_SOURCE=2 \
86         -fstack-protector-strong \
87         -Wformat -Wformat-security \
88         -std=c++14 -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
89         -Wall -Wsign-compare -Wpointer-arith \
90         -Wcast-qual -Wcast-align \
91         -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
92         -O3 \
93         -Wno-unused-private-field \
94         -Wno-unused-function \
95         -Wno-unused-parameter \
96         -Wno-unused-variable
97
98 ifeq ($(strip $(BOARD_USES_VULKAN)), true)
99 LOCAL_SHARED_LIBRARIES += \
100         libvulkan
101
102 LOCAL_CPPFLAGS += \
103         -DUSE_VK \
104         -DDISABLE_EXPLICIT_SYNC
105
106 LOCAL_C_INCLUDES += \
107         $(LOCAL_PATH)/common/compositor/vk \
108         $(LOCAL_PATH)/../mesa/include
109 else
110 LOCAL_CPPFLAGS += \
111         -DUSE_GL
112 endif
113
114 ifeq ($(strip $(BOARD_USES_LIBVA)), true)
115 LOCAL_C_INCLUDES += \
116         $(LOCAL_PATH)/common/compositor/va
117
118 LOCAL_SHARED_LIBRARIES += \
119         libva \
120         libva-android
121 endif
122
123 ifeq ($(strip $(BOARD_USES_MINIGBM)), true)
124 LOCAL_CPPFLAGS += -DUSE_MINIGBM
125 LOCAL_C_INCLUDES += \
126         $(INTEL_MINIGBM)/cros_gralloc/
127 else
128 LOCAL_C_INCLUDES += \
129         $(INTEL_DRM_GRALLOC)
130 endif
131
132 ifeq ($(shell test $(ANDROID_VERSION) -ge 8; echo $$?), 0)
133 LOCAL_SHARED_LIBRARIES += libnativewindow
134 endif
135
136 ifeq ($(strip $(BOARD_CURSOR_WA)), true)
137 LOCAL_CPPFLAGS += \
138         -DDISABLE_CURSOR_PLANE
139 endif
140
141 endif