Update Android.mk for amlogic
This adds a separate app-linkable libminigbm target that disables
the gralloc code and links in the gbm api. Adds support for meson
buildflag.
Bug: b/76099793
Test: amlogic test tool, drawframe
Change-Id: I7aba3ec65fa39cabbb8c96c44d6d59b8225956a9
Reviewed-on: https://chromium-review.googlesource.com/998758
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
diff --git a/Android.mk b/Android.mk
index 2f3f519..0abeaf4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -6,15 +6,8 @@
MINIGBM_GRALLOC_MK := $(call my-dir)/Android.gralloc.mk
LOCAL_PATH := $(call my-dir)
intel_drivers := i915 i965
-include $(CLEAR_VARS)
-SUBDIRS := cros_gralloc
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libdrm
-
-LOCAL_SRC_FILES := \
+MINIGBM_SRC := \
amdgpu.c \
drv.c \
evdi.c \
@@ -36,24 +29,43 @@
virtio_dumb.c \
virtio_virgl.c
-include $(MINIGBM_GRALLOC_MK)
-
-LOCAL_CPPFLAGS += -std=c++14 -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
-LOCAL_CFLAGS += -Wall -Wsign-compare -Wpointer-arith \
+MINIGBM_CPPFLAGS := -std=c++14 -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
+MINIGBM_CFLAGS := -Wall -Wsign-compare -Wpointer-arith \
-Wcast-qual -Wcast-align \
-D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
ifneq ($(filter $(intel_drivers), $(BOARD_GPU_DRIVERS)),)
-LOCAL_CPPFLAGS += -DDRV_I915
-LOCAL_CFLAGS += -DDRV_I915
+MINIGBM_CPPFLAGS += -DDRV_I915
+MINIGBM_CFLAGS += -DDRV_I915
LOCAL_SHARED_LIBRARIES += libdrm_intel
endif
ifneq ($(filter virgl, $(BOARD_GPU_DRIVERS)),)
-LOCAL_CPPFLAGS += -DDRV_VIRGL
-LOCAL_CFLAGS += -DDRV_VIRGL
+MINIGBM_CPPFLAGS += -DDRV_VIRGL
+MINIGBM_CFLAGS += -DDRV_VIRGL
endif
+ifneq ($(filter meson, $(BOARD_GPU_DRIVERS)),)
+MINIGBM_CPPFLAGS += -DDRV_MESON
+MINIGBM_CFLAGS += -DDRV_MESON
+endif
+
+
+include $(CLEAR_VARS)
+
+SUBDIRS := cros_gralloc
+
+LOCAL_SHARED_LIBRARIES := \
+ libcutils \
+ libdrm
+
+LOCAL_SRC_FILES := $(MINIGBM_SRC)
+
+include $(MINIGBM_GRALLOC_MK)
+
+LOCAL_CFLAGS := $(MINIGBM_CFLAGS)
+LOCAL_CPPFLAGS := $(MINIGBM_CPPFLAGS)
+
LOCAL_MODULE := gralloc.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_TAGS := optional
# The preferred path for vendor HALs is /vendor/lib/hw
@@ -64,4 +76,18 @@
LOCAL_SHARED_LIBRARIES += libnativewindow libsync liblog
include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_SHARED_LIBRARIES := libcutils
+LOCAL_STATIC_LIBRARIES := libdrm
+
+LOCAL_SRC_FILES += $(MINIGBM_SRC) gbm.c gbm_helpers.c
+
+LOCAL_CFLAGS := $(MINIGBM_CFLAGS)
+LOCAL_CPPFLAGS := $(MINIGBM_CPPFLAGS)
+
+LOCAL_MODULE := libminigbm
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_SHARED_LIBRARY)
+
endif