[vlc-devel] [PATCH 4/6] contrib: aom: support android in the build
Alexandre Janniaux
ajanni at videolabs.io
Fri Nov 22 16:08:02 CET 2019
When CMAKE_SYSTEM_NAME is set to Android, it raises issues with the
detection of AS_EXECUTABLE and refuses to configure. It could work
without setting CMAKE_SYSTEM_NAME because it would fallback the variable
to Linux and use the Linux configuration.
---
contrib/src/aom/aom-cmake-android.patch | 51 +++++++++++++++++++++++++
contrib/src/aom/rules.mak | 1 +
2 files changed, 52 insertions(+)
create mode 100644 contrib/src/aom/aom-cmake-android.patch
diff --git a/contrib/src/aom/aom-cmake-android.patch b/contrib/src/aom/aom-cmake-android.patch
new file mode 100644
index 0000000000..97c7f0df95
--- /dev/null
+++ b/contrib/src/aom/aom-cmake-android.patch
@@ -0,0 +1,51 @@
+From a578790ec534177ecb5739d2a894da4512f75343 Mon Sep 17 00:00:00 2001
+From: Alexandre Janniaux <ajanni at videolabs.io>
+Date: Thu, 21 Nov 2019 20:11:53 +0100
+Subject: [PATCH] cmake: add support for android
+
+---
+ build/cmake/aom_configure.cmake | 3 ++-
+ build/cmake/aom_optimization.cmake | 6 ++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake
+index a89336b81..a7f226428 100644
+--- a/build/cmake/aom_configure.cmake
++++ b/build/cmake/aom_configure.cmake
+@@ -154,7 +154,8 @@ elseif("${AOM_TARGET_CPU}" MATCHES "arm")
+ if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
+ set(AS_EXECUTABLE as)
+ set(AOM_AS_FLAGS -arch ${AOM_TARGET_CPU} -isysroot ${CMAKE_OSX_SYSROOT})
+- elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
++ elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux"
++ OR "${AOM_TARGET_SYSTEM}" STREQUAL "Android")
+ if(NOT AS_EXECUTABLE)
+ set(AS_EXECUTABLE as)
+ endif()
+diff --git a/build/cmake/aom_optimization.cmake b/build/cmake/aom_optimization.cmake
+index 9879ea745..9ae19db3a 100644
+--- a/build/cmake/aom_optimization.cmake
++++ b/build/cmake/aom_optimization.cmake
+@@ -83,7 +83,8 @@ function(get_asm_obj_format out_format)
+ if("${AOM_TARGET_CPU}" STREQUAL "x86_64")
+ if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
+ set(objformat "macho64")
+- elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
++ elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux"
++ OR "${AOM_TARGET_SYSTEM}" STREQUAL "Android")
+ set(objformat "elf64")
+ elseif("${AOM_TARGET_SYSTEM}" STREQUAL "MSYS"
+ OR "${AOM_TARGET_SYSTEM}" STREQUAL "Windows")
+@@ -94,7 +95,8 @@ function(get_asm_obj_format out_format)
+ elseif("${AOM_TARGET_CPU}" STREQUAL "x86")
+ if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
+ set(objformat "macho32")
+- elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
++ elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux"
++ OR "${AOM_TARGET_SYSTEM}" STREQUAL "Android")
+ set(objformat "elf32")
+ elseif("${AOM_TARGET_SYSTEM}" STREQUAL "MSYS"
+ OR "${AOM_TARGET_SYSTEM}" STREQUAL "Windows")
+--
+2.24.0
+
diff --git a/contrib/src/aom/rules.mak b/contrib/src/aom/rules.mak
index 457b5faa1e..efc91d7ca1 100644
--- a/contrib/src/aom/rules.mak
+++ b/contrib/src/aom/rules.mak
@@ -24,6 +24,7 @@ ifdef HAVE_ANDROID
$(APPLY) $(SRC)/aom/aom-android-pthreads.patch
$(APPLY) $(SRC)/aom/aom-android-cpufeatures.patch
endif
+ $(APPLY) $(SRC)/aom/aom-cmake-android.patch
$(MOVE)
ifdef HAVE_ANDROID
cp $(ANDROID_NDK)/sources/android/cpufeatures/cpu-features.c $(ANDROID_NDK)/sources/android/cpufeatures/cpu-features.h aom/aom_ports/
--
2.24.0
More information about the vlc-devel
mailing list