vlc | branch: master | Alexandre Janniaux <[email protected]> | Tue Nov 26 10:56:41 2019 +0100| [d1a978c32468cc5d07730e165593b4ed90530cd7] | committer: Thomas Guillem
contrib: toolchain.cmake: enforce variables for android CMAKE_SYSTEM_PROCESSOR must match specific rules for Android, defined in the CMake files: Modules/Platform/Android-Determine.cmake. Instead, pass down the ANDROID_ABI variable to the CMAKE_ANDROID_ARCH_ABI which will be used to set the correct environment, including the processor variable. Also enforce CMAKE_SYSTEM_NAME to have CMAKE_CROSSCOMPILE = true and CMAKE_ANDROID_ARM_NEON with armeabi-v7a for correct neon support and enable switch. Signed-off-by: Thomas Guillem <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d1a978c32468cc5d07730e165593b4ed90530cd7 --- contrib/src/main.mak | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/contrib/src/main.mak b/contrib/src/main.mak index 4ce040bb4f..e0d8066ded 100644 --- a/contrib/src/main.mak +++ b/contrib/src/main.mak @@ -543,6 +543,9 @@ endif ifdef HAVE_DARWIN_OS CMAKE_SYSTEM_NAME = Darwin endif +ifdef HAVE_ANDROID +CMAKE_SYSTEM_NAME = Android +endif ifdef HAVE_ANDROID CFLAGS += -DANDROID_NATIVE_API_LEVEL=$(ANDROID_API) @@ -556,7 +559,30 @@ ifndef WITH_OPTIMIZATION else echo "set(CMAKE_BUILD_TYPE Release)" >> $@ endif + +ifdef HAVE_ANDROID +# Android has special rules for detecting the architecture +# and CMAKE_SYSTEM_PROCESSOR should match them. + echo "set(CMAKE_SYSTEM_VERSION ${ANDROID_API})" >> $@ + echo "set(CMAKE_ANDROID_ARCH_ABI ${ANDROID_ABI})" >> $@ + +# From CMake manual: +# When Cross Compiling for Android and CMAKE_ANDROID_ARCH_ABI is set to +# armeabi-v7a set CMAKE_ANDROID_ARM_NEON to ON to target ARM NEON devices. +ifeq ($(ANDROID_ABI),armeabi-v7a) +ifdef HAVE_NEON + echo "set(CMAKE_ANDROID_ARM_NEON ON)" >> $@ +else + echo "set(CMAKE_ANDROID_ARM_NEON OFF)" >> $@ +endif +endif + +# Else use the default expected behaviour for other platforms +else echo "set(CMAKE_SYSTEM_PROCESSOR $(ARCH))" >> $@ +endif + + if test -n "$(CMAKE_SYSTEM_NAME)"; then \ echo "set(CMAKE_SYSTEM_NAME $(CMAKE_SYSTEM_NAME))" >> $@; \ fi; _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
