diff options
-rw-r--r-- | Android.common.mk | 9 | ||||
-rw-r--r-- | Android.mk | 13 | ||||
-rw-r--r-- | src/amd/Android.common.mk | 3 | ||||
-rw-r--r-- | src/gallium/Android.common.mk | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/Android.mk | 8 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/Android.mk | 7 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/Android.mk | 2 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/Android.mk | 2 |
8 files changed, 27 insertions, 23 deletions
diff --git a/Android.common.mk b/Android.common.mk index eb9a3f0e87..5e7fd9445a 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -86,15 +86,6 @@ LOCAL_CFLAGS += \ endif endif -ifeq ($(MESA_ENABLE_LLVM),true) - ifeq ($(MESA_ANDROID_MAJOR_VERSION),6) - LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 -DMESA_LLVM_VERSION_PATCH=0 - endif - ifeq ($(MESA_ANDROID_MAJOR_VERSION),7) - LOCAL_CFLAGS += -DHAVE_LLVM=0x0308 -DMESA_LLVM_VERSION_PATCH=0 - endif -endif - ifneq ($(LOCAL_IS_HOST_MODULE),true) LOCAL_CFLAGS += -DHAVE_LIBDRM LOCAL_SHARED_LIBRARIES += libdrm diff --git a/Android.mk b/Android.mk index e2d792d8e4..600b37a52e 100644 --- a/Android.mk +++ b/Android.mk @@ -82,6 +82,19 @@ ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),) MESA_ENABLE_LLVM := true endif +define mesa-build-with-llvm + $(if $(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5), \ + $(warning Unsupported LLVM version in Android $(MESA_ANDROID_MAJOR_VERSION)),) \ + $(if $(filter 6,$(MESA_ANDROID_MAJOR_VERSION)), \ + $(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0307 -DMESA_LLVM_VERSION_PATCH=0) \ + $(eval LOCAL_STATIC_LIBRARIES += libLLVMCore) \ + $(eval LOCAL_C_INCLUDES += external/llvm/include external/llvm/device/include),) \ + $(if $(filter 7,$(MESA_ANDROID_MAJOR_VERSION)), \ + $(eval LOCAL_CFLAGS += -DHAVE_LLVM=0x0308 -DMESA_LLVM_VERSION_PATCH=0) \ + $(eval LOCAL_STATIC_LIBRARIES += libLLVMCore) \ + $(eval LOCAL_C_INCLUDES += external/llvm/include external/llvm/device/include),) +endef + # add subdirectories SUBDIRS := \ src/gbm \ diff --git a/src/amd/Android.common.mk b/src/amd/Android.common.mk index 18ace02b90..62d4df1511 100644 --- a/src/amd/Android.common.mk +++ b/src/amd/Android.common.mk @@ -61,11 +61,12 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \ $(LOCAL_PATH)/common LOCAL_STATIC_LIBRARIES := \ - libLLVMCore \ libmesa_nir LOCAL_WHOLE_STATIC_LIBRARIES := \ libelf +$(call mesa-build-with-llvm) + include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/src/gallium/Android.common.mk b/src/gallium/Android.common.mk index b2eb95bcd6..782510ff0f 100644 --- a/src/gallium/Android.common.mk +++ b/src/gallium/Android.common.mk @@ -29,10 +29,4 @@ LOCAL_C_INCLUDES += \ $(GALLIUM_TOP)/winsys \ $(GALLIUM_TOP)/drivers -ifeq ($(MESA_ENABLE_LLVM),true) -LOCAL_C_INCLUDES += \ - external/llvm/include \ - external/llvm/device/include -endif - include $(MESA_COMMON_MK) diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk index 4f6f71bbf6..e2a1fc214e 100644 --- a/src/gallium/auxiliary/Android.mk +++ b/src/gallium/auxiliary/Android.mk @@ -38,12 +38,12 @@ LOCAL_C_INCLUDES := \ ifeq ($(MESA_ENABLE_LLVM),true) LOCAL_SRC_FILES += \ - $(GALLIVM_SOURCES) \ - $(GALLIVM_CPP_SOURCES) -LOCAL_STATIC_LIBRARIES += libLLVMCore -LOCAL_CPPFLAGS := -std=c++11 + $(GALLIVM_SOURCES) +$(call mesa-build-with-llvm) endif +LOCAL_CPPFLAGS += -std=c++11 + # We need libmesa_nir to get NIR's generated include directories. LOCAL_MODULE := libmesa_gallium LOCAL_STATIC_LIBRARIES += libmesa_nir diff --git a/src/gallium/drivers/radeon/Android.mk b/src/gallium/drivers/radeon/Android.mk index 64815f6f08..eb1a32182b 100644 --- a/src/gallium/drivers/radeon/Android.mk +++ b/src/gallium/drivers/radeon/Android.mk @@ -30,13 +30,14 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(C_SOURCES) +LOCAL_SHARED_LIBRARIES := libdrm_radeon libLLVM +LOCAL_MODULE := libmesa_pipe_radeon + ifeq ($(MESA_ENABLE_LLVM),true) LOCAL_CFLAGS += -DFORCE_BUILD_AMDGPU # instructs LLVM to declare LLVMInitializeAMDGPU* functions +$(call mesa-build-with-llvm) endif -LOCAL_SHARED_LIBRARIES := libdrm_radeon libLLVM -LOCAL_MODULE := libmesa_pipe_radeon - include $(GALLIUM_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/src/gallium/drivers/radeonsi/Android.mk b/src/gallium/drivers/radeonsi/Android.mk index cd76875151..5676c55983 100644 --- a/src/gallium/drivers/radeonsi/Android.mk +++ b/src/gallium/drivers/radeonsi/Android.mk @@ -43,6 +43,8 @@ LOCAL_STATIC_LIBRARIES := libmesa_amd_common LOCAL_SHARED_LIBRARIES := libdrm_radeon libLLVM LOCAL_MODULE := libmesa_pipe_radeonsi +$(call mesa-build-with-llvm) + include $(GALLIUM_COMMON_MK) include $(BUILD_STATIC_LIBRARY) diff --git a/src/gallium/winsys/amdgpu/drm/Android.mk b/src/gallium/winsys/amdgpu/drm/Android.mk index 75a4a15809..a05304ae5d 100644 --- a/src/gallium/winsys/amdgpu/drm/Android.mk +++ b/src/gallium/winsys/amdgpu/drm/Android.mk @@ -39,6 +39,8 @@ LOCAL_STATIC_LIBRARIES := libmesa_amdgpu_addrlib LOCAL_SHARED_LIBRARIES := libdrm_amdgpu LOCAL_MODULE := libmesa_winsys_amdgpu +$(call mesa-build-with-llvm) + include $(GALLIUM_COMMON_MK) include $(BUILD_STATIC_LIBRARY) |