[Mesa-dev] [PATCH 11/12] Android: Add LLVM support for Android O

Rob Herring robh at kernel.org
Thu Apr 27 19:43:47 UTC 2017


Android O moves to LLVM 3.9 and also has some differences in header
dependencies as LLVM has moved to blueprint files. It seems libLLVMCore
was only needed for header dependencies.

Signed-off-by: Rob Herring <robh at kernel.org>
---
 Android.common.mk                |  5 +++--
 src/amd/Android.common.mk        |  7 ++++++-
 src/gallium/auxiliary/Android.mk | 12 ++++++++----
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/Android.common.mk b/Android.common.mk
index a7b78bb910fc..8669492bec11 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -86,9 +86,10 @@ 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)
+  else ifeq ($(MESA_ANDROID_MAJOR_VERSION),7)
     LOCAL_CFLAGS += -DHAVE_LLVM=0x0308 -DMESA_LLVM_VERSION_PATCH=0
+  else
+    LOCAL_CFLAGS += -DHAVE_LLVM=0x0309 -DMESA_LLVM_VERSION_PATCH=0
   endif
 endif
 
diff --git a/src/amd/Android.common.mk b/src/amd/Android.common.mk
index 764076e599e1..449e64d543f5 100644
--- a/src/amd/Android.common.mk
+++ b/src/amd/Android.common.mk
@@ -60,9 +60,14 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
 	$(LOCAL_PATH)/common
 
 LOCAL_STATIC_LIBRARIES := \
-	libLLVMCore \
 	libmesa_nir \
 	libelf
 
+ifneq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 5 6 7),)
+LOCAL_STATIC_LIBRARIES += libLLVMCore
+else
+LOCAL_HEADER_LIBRARIES := llvm-headers
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/auxiliary/Android.mk b/src/gallium/auxiliary/Android.mk
index e8628e43744a..58a8447b9ad6 100644
--- a/src/gallium/auxiliary/Android.mk
+++ b/src/gallium/auxiliary/Android.mk
@@ -38,12 +38,16 @@ 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)
+ifneq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 5 6 7),)
+LOCAL_STATIC_LIBRARIES := libLLVMCore
+else
+LOCAL_HEADER_LIBRARIES := llvm-headers
+endif
 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
-- 
2.11.0



More information about the mesa-dev mailing list