From 2a81fb61a5c5f7bde83810b16f7dbd589d64d856 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Fri, 30 Jun 2017 10:23:12 +0200 Subject: Refactor CMake file and disable troublesome compilation to MIPS* --- app/CMakeLists.txt | 25 +++++++++++++------------ app/build.gradle | 3 +++ 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'app') diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index d115cb6..8114db4 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -2,20 +2,19 @@ cmake_minimum_required(VERSION 3.4.1) include(ExternalProject) set(xCONFIG - "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN} ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}" + "CC=${CMAKE_C_COMPILER} \ + ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN} \ + ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET} \ + ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}" "LD=${CMAKE_LINKER}" "AR=${CMAKE_AR}" "RANLIB=${CMAKE_RANLIB}" - "CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}" - "LDFLAGS=${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}" + "CFLAGS=${CMAKE_C_FLAGS}" + "LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}" "--host=${CMAKE_C_COMPILER_TARGET}" ) -if(${ANDROID_ABI} STREQUAL "mips64") - list(APPEND xCONFIG --disable-asm) -endif() - -ExternalProject_Add(lzo +ExternalProject_Add( lzo URL http://files.pacien.net/tmp/lzo-2.10.tar.gz URL_HASH SHA1=4924676a9bae5db58ef129dc1cebce3baa3c4b5d CONFIGURE_COMMAND /configure ${xCONFIG} --disable-shared @@ -24,7 +23,7 @@ ExternalProject_Add(lzo rm -r ) -ExternalProject_Add(libressl +ExternalProject_Add( libressl URL http://files.pacien.net/tmp/libressl-2.5.4.tar.gz URL_HASH SHA256=107a5b522fbb8318d4c3be668075e5e607296f0a9255d71674caa94571336efa CONFIGURE_COMMAND /configure ${xCONFIG} --disable-shared @@ -34,7 +33,7 @@ ExternalProject_Add(libressl rm -r ) -ExternalProject_Add(tinc +ExternalProject_Add( tinc DEPENDS lzo libressl URL http://files.pacien.net/tmp/tinc-1.1pre15-SNAPSHOT.tar.gz CONFIGURE_COMMAND autoreconf -fsi && @@ -45,8 +44,10 @@ ExternalProject_Add(tinc --disable-readline BUILD_COMMAND make -j4 -C src INSTALL_COMMAND make -C src install DESTDIR=${CMAKE_CURRENT_BINARY_DIR} && - ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tinc ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtinc.so && - ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tincd ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtincd.so && + ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tinc ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtinc.so && + ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tincd ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtincd.so && rm -r ) diff --git a/app/build.gradle b/app/build.gradle index 840289d..a707cbb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,6 +11,9 @@ android { targetSdkVersion 21 versionCode 1 versionName "0.1-preview" + ndk { + abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a' + } } buildTypes { release { -- cgit v1.2.3