OSDN Git Service

Rename drmhwctwo to iahwc2.
[android-x86/external-IA-Hardware-Composer.git] / Android.mk
1 # Copyright (C) 2015 The Android Open Source Project
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 ifeq ($(strip $(BOARD_USES_IA_HWCOMPOSER)),true)
16 # Obtain root HWC source path
17 HWC_PATH := $(call my-dir)
18
19 HWC_VERSION_GIT_BRANCH := $(shell pushd $(HWC_PATH) > /dev/null; git rev-parse --abbrev-ref HEAD; popd > /dev/null)
20 HWC_VERSION_GIT_SHA := $(shell pushd $(HWC_PATH) > /dev/null; git rev-parse HEAD; popd > /dev/null)
21
22 LOCAL_PATH := $(call my-dir)
23 include $(CLEAR_VARS)
24
25 LOCAL_SHARED_LIBRARIES := \
26         libcutils \
27         libdrm \
28         libEGL \
29         libGLESv2 \
30         libhardware \
31         liblog \
32         libui \
33         libutils \
34         libhwcservice \
35         libbinder
36
37 LOCAL_C_INCLUDES := \
38         system/core/include/utils \
39         $(LOCAL_PATH)/public \
40         $(LOCAL_PATH)/common/core \
41         $(LOCAL_PATH)/common/compositor \
42         $(LOCAL_PATH)/common/compositor/gl \
43         $(LOCAL_PATH)/common/display \
44         $(LOCAL_PATH)/common/utils \
45         $(LOCAL_PATH)/os \
46         $(LOCAL_PATH)/os/android \
47         $(LOCAL_PATH)/wsi \
48         $(LOCAL_PATH)/wsi/drm
49
50 LOCAL_SRC_FILES := \
51         common/compositor/compositor.cpp \
52         common/compositor/factory.cpp \
53         common/compositor/nativesurface.cpp \
54         common/compositor/renderstate.cpp \
55         common/core/gpudevice.cpp \
56         common/core/hwclayer.cpp \
57         common/core/overlaylayer.cpp \
58         common/display/displayplanemanager.cpp \
59         common/display/displayqueue.cpp \
60         common/display/headless.cpp \
61         common/display/vblankeventhandler.cpp \
62         common/display/virtualdisplay.cpp \
63         common/utils/fdhandler.cpp \
64         common/utils/hwcevent.cpp \
65         common/utils/hwcthread.cpp \
66         common/utils/hwcutils.cpp \
67         common/utils/disjoint_layers.cpp \
68         wsi/physicaldisplay.cpp \
69         wsi/drm/drmdisplay.cpp \
70         wsi/drm/drmbuffer.cpp \
71         wsi/drm/drmplane.cpp \
72         wsi/drm/drmdisplaymanager.cpp \
73         wsi/drm/drmscopedtypes.cpp \
74         os/android/iahwc2.cpp \
75         os/android/hwcservice.cpp
76
77 ifeq ($(strip $(BOARD_USES_GRALLOC1)), true)
78 LOCAL_SRC_FILES += os/android/gralloc1bufferhandler.cpp
79 else
80 LOCAL_SRC_FILES += os/android/grallocbufferhandler.cpp
81 endif
82
83 LOCAL_CFLAGS += -DHWC_VERSION_GIT_BRANCH="\"$(HWC_VERSION_GIT_BRANCH)\""
84 LOCAL_CFLAGS += -DHWC_VERSION_GIT_SHA="\"$(HWC_VERSION_GIT_SHA)\""
85 LOCAL_CFLAGS += -Wno-date-time
86 LOCAL_CPPFLAGS += \
87         -DHWC2_USE_CPP11 \
88         -DHWC2_INCLUDE_STRINGIFICATION \
89         -DUSE_ANDROID_SYNC \
90         -DUSE_ANDROID_SHIM \
91         -O2 \
92         -D_FORTIFY_SOURCE=2 \
93         -fstack-protector-strong \
94         -Wformat -Wformat-security
95
96 ifeq ($(strip $(BOARD_DISABLE_NATIVE_COLOR_MODES)),true)
97 LOCAL_CPPFLAGS += -DDISABLE_NATIVE_COLOR_MODES
98 endif
99
100 ifeq ($(strip $(BOARD_USES_VULKAN)),)
101 LOCAL_CPPFLAGS += \
102         -DUSE_GL
103
104 LOCAL_SRC_FILES += \
105         common/compositor/gl/glprogram.cpp \
106         common/compositor/gl/glrenderer.cpp \
107         common/compositor/gl/glsurface.cpp \
108         common/compositor/gl/egloffscreencontext.cpp \
109         common/compositor/gl/nativeglresource.cpp \
110         common/compositor/gl/shim.cpp \
111         common/compositor/scopedrendererstate.cpp
112 endif
113
114 ifeq ($(strip $(BOARD_USES_MINIGBM)),true)
115 LOCAL_CPPFLAGS += -DUSE_MINIGBM
116 LOCAL_C_INCLUDES += \
117         $(INTEL_MINIGBM)/cros_gralloc/
118 else
119 LOCAL_C_INCLUDES += \
120         $(INTEL_DRM_GRALLOC)
121 endif
122
123 LOCAL_MODULE := hwcomposer.$(TARGET_BOARD_PLATFORM)
124 LOCAL_MODULE_TAGS := optional
125 #Preffered paths for all vendor hals /vendor/lib/hw
126 LOCAL_PROPRIETARY_MODULE := true
127 LOCAL_MODULE_RELATIVE_PATH := hw
128 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
129 LOCAL_MODULE_SUFFIX := $(TARGET_SHLIB_SUFFIX)
130 include $(BUILD_SHARED_LIBRARY)
131
132 # libhwcservice
133 HWC_BUILD_DIRS := \
134 $(LOCAL_PATH)/os/android/libhwcservice/Android.mk
135
136 include $(HWC_BUILD_DIRS)
137
138 #Include tests only if eng build
139 ifneq (,$(filter eng,$(TARGET_BUILD_VARIANT)))
140 # Commenting for now include when ld issue is resolved
141 #include $(LOCAL_PATH)/tests/third_party/json-c/Android.mk
142 endif
143
144 endif