diff options
author | Pacien TRAN-GIRARD | 2017-06-30 10:23:12 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2017-06-30 10:23:12 +0200 |
commit | 2a81fb61a5c5f7bde83810b16f7dbd589d64d856 (patch) | |
tree | bc54a4307b069ea43c1c9e78315d2c0faf46fca4 /app/CMakeLists.txt | |
parent | c89016e7427defd1f8a095d7aeb30292a42fad92 (diff) | |
download | tincapp-2a81fb61a5c5f7bde83810b16f7dbd589d64d856.tar.gz |
Refactor CMake file and disable troublesome compilation to MIPS*
Diffstat (limited to 'app/CMakeLists.txt')
-rw-r--r-- | app/CMakeLists.txt | 25 |
1 files changed, 13 insertions, 12 deletions
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) | |||
2 | include(ExternalProject) | 2 | include(ExternalProject) |
3 | 3 | ||
4 | set(xCONFIG | 4 | set(xCONFIG |
5 | "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN} ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}" | 5 | "CC=${CMAKE_C_COMPILER} \ |
6 | ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN} \ | ||
7 | ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET} \ | ||
8 | ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}" | ||
6 | "LD=${CMAKE_LINKER}" | 9 | "LD=${CMAKE_LINKER}" |
7 | "AR=${CMAKE_AR}" | 10 | "AR=${CMAKE_AR}" |
8 | "RANLIB=${CMAKE_RANLIB}" | 11 | "RANLIB=${CMAKE_RANLIB}" |
9 | "CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}" | 12 | "CFLAGS=${CMAKE_C_FLAGS}" |
10 | "LDFLAGS=${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}" | 13 | "LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}" |
11 | "--host=${CMAKE_C_COMPILER_TARGET}" | 14 | "--host=${CMAKE_C_COMPILER_TARGET}" |
12 | ) | 15 | ) |
13 | 16 | ||
14 | if(${ANDROID_ABI} STREQUAL "mips64") | 17 | ExternalProject_Add( lzo |
15 | list(APPEND xCONFIG --disable-asm) | ||
16 | endif() | ||
17 | |||
18 | ExternalProject_Add(lzo | ||
19 | URL http://files.pacien.net/tmp/lzo-2.10.tar.gz | 18 | URL http://files.pacien.net/tmp/lzo-2.10.tar.gz |
20 | URL_HASH SHA1=4924676a9bae5db58ef129dc1cebce3baa3c4b5d | 19 | URL_HASH SHA1=4924676a9bae5db58ef129dc1cebce3baa3c4b5d |
21 | CONFIGURE_COMMAND <SOURCE_DIR>/configure ${xCONFIG} --disable-shared | 20 | CONFIGURE_COMMAND <SOURCE_DIR>/configure ${xCONFIG} --disable-shared |
@@ -24,7 +23,7 @@ ExternalProject_Add(lzo | |||
24 | rm -r <BINARY_DIR> | 23 | rm -r <BINARY_DIR> |
25 | ) | 24 | ) |
26 | 25 | ||
27 | ExternalProject_Add(libressl | 26 | ExternalProject_Add( libressl |
28 | URL http://files.pacien.net/tmp/libressl-2.5.4.tar.gz | 27 | URL http://files.pacien.net/tmp/libressl-2.5.4.tar.gz |
29 | URL_HASH SHA256=107a5b522fbb8318d4c3be668075e5e607296f0a9255d71674caa94571336efa | 28 | URL_HASH SHA256=107a5b522fbb8318d4c3be668075e5e607296f0a9255d71674caa94571336efa |
30 | CONFIGURE_COMMAND <SOURCE_DIR>/configure ${xCONFIG} --disable-shared | 29 | CONFIGURE_COMMAND <SOURCE_DIR>/configure ${xCONFIG} --disable-shared |
@@ -34,7 +33,7 @@ ExternalProject_Add(libressl | |||
34 | rm -r <BINARY_DIR> | 33 | rm -r <BINARY_DIR> |
35 | ) | 34 | ) |
36 | 35 | ||
37 | ExternalProject_Add(tinc | 36 | ExternalProject_Add( tinc |
38 | DEPENDS lzo libressl | 37 | DEPENDS lzo libressl |
39 | URL http://files.pacien.net/tmp/tinc-1.1pre15-SNAPSHOT.tar.gz | 38 | URL http://files.pacien.net/tmp/tinc-1.1pre15-SNAPSHOT.tar.gz |
40 | CONFIGURE_COMMAND autoreconf -fsi <SOURCE_DIR> && | 39 | CONFIGURE_COMMAND autoreconf -fsi <SOURCE_DIR> && |
@@ -45,8 +44,10 @@ ExternalProject_Add(tinc | |||
45 | --disable-readline | 44 | --disable-readline |
46 | BUILD_COMMAND make -j4 -C src | 45 | BUILD_COMMAND make -j4 -C src |
47 | INSTALL_COMMAND make -C src install DESTDIR=${CMAKE_CURRENT_BINARY_DIR} && | 46 | INSTALL_COMMAND make -C src install DESTDIR=${CMAKE_CURRENT_BINARY_DIR} && |
48 | ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tinc ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtinc.so && | 47 | ${CMAKE_COMMAND} -E copy |
49 | ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tincd ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtincd.so && | 48 | ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tinc ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtinc.so && |
49 | ${CMAKE_COMMAND} -E copy | ||
50 | ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tincd ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtincd.so && | ||
50 | rm -r <BINARY_DIR> | 51 | rm -r <BINARY_DIR> |
51 | ) | 52 | ) |
52 | 53 | ||