OSDN Git Service

Allow minigbm gralloc to coexist with board gralloc. am: 3fbaca6783
[android-x86/external-minigbm.git] / Android.mk
1 # Use of this source code is governed by a BSD-style license that can be
2 # found in the LICENSE file.
3
4 ifeq ($(strip $(BOARD_USES_MINIGBM)), true)
5
6 MINIGBM_GRALLOC_MK := $(call my-dir)/Android.gralloc.mk
7 LOCAL_PATH := $(call my-dir)
8 intel_drivers := i915 i965
9
10 MINIGBM_SRC := \
11         amdgpu.c \
12         drv.c \
13         evdi.c \
14         exynos.c \
15         helpers_array.c \
16         helpers.c \
17         i915.c \
18         marvell.c \
19         mediatek.c \
20         meson.c \
21         msm.c \
22         nouveau.c \
23         radeon.c \
24         rockchip.c \
25         tegra.c \
26         udl.c \
27         vc4.c \
28         vgem.c \
29         virtio_gpu.c
30
31 MINIGBM_CPPFLAGS := -std=c++14
32 MINIGBM_CFLAGS := \
33         -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
34         -Wall -Wsign-compare -Wpointer-arith \
35         -Wcast-qual -Wcast-align \
36         -Wno-unused-parameter
37
38 ifneq ($(filter $(intel_drivers), $(BOARD_GPU_DRIVERS)),)
39 MINIGBM_CPPFLAGS += -DDRV_I915
40 MINIGBM_CFLAGS += -DDRV_I915
41 LOCAL_SHARED_LIBRARIES += libdrm_intel
42 endif
43
44 ifneq ($(filter meson, $(BOARD_GPU_DRIVERS)),)
45 MINIGBM_CPPFLAGS += -DDRV_MESON
46 MINIGBM_CFLAGS += -DDRV_MESON
47 endif
48
49 include $(CLEAR_VARS)
50
51 SUBDIRS := cros_gralloc
52
53 LOCAL_SHARED_LIBRARIES := \
54         libcutils \
55         libdrm
56
57 LOCAL_SRC_FILES := $(MINIGBM_SRC)
58
59 include $(MINIGBM_GRALLOC_MK)
60
61 LOCAL_CFLAGS := $(MINIGBM_CFLAGS)
62 LOCAL_CPPFLAGS := $(MINIGBM_CPPFLAGS)
63
64 LOCAL_MODULE := gralloc.minigbm
65 LOCAL_MODULE_TAGS := optional
66 # The preferred path for vendor HALs is /vendor/lib/hw
67 LOCAL_PROPRIETARY_MODULE := true
68 LOCAL_MODULE_RELATIVE_PATH := hw
69 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
70 LOCAL_MODULE_SUFFIX := $(TARGET_SHLIB_SUFFIX)
71 LOCAL_HEADER_LIBRARIES += \
72         libhardware_headers libnativebase_headers libsystem_headers
73 LOCAL_SHARED_LIBRARIES += libnativewindow libsync liblog
74 LOCAL_STATIC_LIBRARIES += libarect
75 include $(BUILD_SHARED_LIBRARY)
76
77
78 include $(CLEAR_VARS)
79 LOCAL_SHARED_LIBRARIES := liblog
80 LOCAL_STATIC_LIBRARIES := libdrm
81
82 LOCAL_SRC_FILES += $(MINIGBM_SRC) gbm.c gbm_helpers.c
83
84 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
85 LOCAL_CFLAGS := $(MINIGBM_CFLAGS)
86 LOCAL_CPPFLAGS := $(MINIGBM_CPPFLAGS)
87
88 LOCAL_MODULE := libminigbm
89 LOCAL_MODULE_TAGS := optional
90 include $(BUILD_SHARED_LIBRARY)
91
92 endif