@ -68,6 +68,7 @@ if(CMAKE_CXX_COMPILER_LAUNCHER)
set ( deps_cxx "${CMAKE_CXX_COMPILER_LAUNCHER} ${deps_cxx}" )
endif ( )
function ( expand_urls output source_file )
set ( expanded )
foreach ( mirror ${ ARGN } )
@ -100,6 +101,46 @@ if(CMAKE_CROSSCOMPILING)
set ( cross_rc "WINDRES=${CMAKE_RC_COMPILER}" )
endif ( )
endif ( )
if ( ANDROID )
set ( android_toolchain_suffix linux-android )
set ( android_compiler_suffix linux-android23 )
if ( CMAKE_ANDROID_ARCH_ABI MATCHES x86_64 )
set ( android_machine x86_64 )
set ( cross_host "--host=x86_64-linux-android" )
set ( android_compiler_prefix x86_64 )
set ( android_compiler_suffix linux-android23 )
set ( android_toolchain_prefix x86_64 )
set ( android_toolchain_suffix linux-android )
elseif ( CMAKE_ANDROID_ARCH_ABI MATCHES x86 )
set ( android_machine i686 )
set ( cross_host "--host=i686-linux-android" )
set ( android_compiler_prefix i686 )
set ( android_compiler_suffix linux-android23 )
set ( android_toolchain_prefix i686 )
set ( android_toolchain_suffix linux-android )
elseif ( CMAKE_ANDROID_ARCH_ABI MATCHES armeabi-v7a )
set ( android_machine armv7 )
set ( cross_host "--host=armv7a-linux-androideabi" )
set ( android_compiler_prefix armv7a )
set ( android_compiler_suffix linux-androideabi23 )
set ( android_toolchain_prefix arm )
set ( android_toolchain_suffix linux-androideabi )
elseif ( CMAKE_ANDROID_ARCH_ABI MATCHES arm64-v8a )
set ( android_machine aarch64 )
set ( cross_host "--host=aarch64-linux-android" )
set ( android_compiler_prefix aarch64 )
set ( android_compiler_suffix linux-android23 )
set ( android_toolchain_prefix aarch64 )
set ( android_toolchain_suffix linux-android )
else ( )
message ( FATAL_ERROR "unknown android arch: ${CMAKE_ANDROID_ARCH_ABI}" )
endif ( )
set ( deps_cc "${CMAKE_ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/${android_compiler_prefix}-${android_compiler_suffix}-clang" )
set ( deps_cxx "${CMAKE_ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/${android_compiler_prefix}-${android_compiler_suffix}-clang++" )
set ( deps_ld "${CMAKE_ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/${android_compiler_prefix}-${android_toolchain_suffix}-ld" )
set ( deps_ranlib "${CMAKE_ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/${android_toolchain_prefix}-${android_toolchain_suffix}-ranlib" )
set ( deps_ar "${CMAKE_ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/${android_toolchain_prefix}-${android_toolchain_suffix}-ar" )
endif ( )
# B u i l d s a t a r g e t ; t a k e s t h e t a r g e t name ( e.g. "readline" ) a n d b u i l d s i t i n a n e x t e r n a l p r o j e c t w i t h
@ -149,11 +190,14 @@ if(CMAKE_CROSSCOMPILING)
set ( openssl_system_env SYSTEM=MINGW64 RC= ${ CMAKE_RC_COMPILER } AR= ${ ARCH_TRIPLET } -ar RANLIB= ${ ARCH_TRIPLET } -ranlib )
elseif ( ARCH_TRIPLET STREQUAL i686-w64-mingw32 )
set ( openssl_system_env SYSTEM=MINGW32 RC= ${ CMAKE_RC_COMPILER } AR= ${ ARCH_TRIPLET } -ar RANLIB= ${ ARCH_TRIPLET } -ranlib )
elseif ( ANDROID )
set ( openssl_system_env SYSTEM=Linux MACHINE= ${ android_machine } LD= ${ deps_ld } RANLIB= ${ deps_ranlib } AR= ${ deps_ar } )
set ( openssl_extra_opts no-asm )
endif ( )
endif ( )
build_external ( openssl
C O N F I G U R E _ C O M M A N D $ { C M A K E _ C O M M A N D } - E e n v C C = $ { d e p s _ c c } $ { o p e n s s l _ s y s t e m _ e n v } . / c o n f i g
- - p r e f i x = $ { D E P S _ D E S T D I R } no - s h a r e d n o - c a p i e n g n o - d s o n o - d t l s 1 n o - e c _ n i s t p _ 6 4 _ g c c _ 1 2 8 n o - g o s t
- - p r e f i x = $ { D E P S _ D E S T D I R } ${ o p e n s s l _ e x t r a _ o p t s } no - s h a r e d n o - c a p i e n g n o - d s o n o - d t l s 1 n o - e c _ n i s t p _ 6 4 _ g c c _ 1 2 8 n o - g o s t
n o - h e a r t b e a t s n o - m d 2 n o - r c 5 n o - r d r a n d n o - r f c 3 7 7 9 n o - s c t p n o - s s l - t r a c e n o - s s l 2 n o - s s l 3
n o - s t a t i c - e n g i n e n o - t e s t s n o - w e a k - s s l - c i p h e r s n o - z l i b n o - z l i b - d y n a m i c " C F L A G S = - O 2 $ { f l t o } "
I N S T A L L _ C O M M A N D m a k e i n s t a l l _ s w
@ -197,7 +241,8 @@ endif()
build_external ( sodium )
build_external ( sodium CONFIGURE_COMMAND ./configure ${ cross_host } ${ cross_rc } --prefix= ${ DEPS_DESTDIR } --disable-shared
- - e n a b l e - s t a t i c - - w i t h - p i c " C C = $ { d e p s _ c c } " " C F L A G S = - O 2 $ { f l t o } " )
add_static_target ( sodium sodium_external libsodium.a )
build_external ( sqlite3 )
@ -208,6 +253,7 @@ if(ZMQ_VERSION VERSION_LESS 4.3.4 AND CMAKE_CROSSCOMPILING AND ARCH_TRIPLET MATC
set ( zmq_patch
P A T C H _ C O M M A N D p a t c h - p 1 - i $ { P R O J E C T _ S O U R C E _ D I R } / c o n t r i b / c r o s s / p a t c h e s / l i b z m q - m i n g w - c l o s e s o c k e t . p a t c h )
endif ( )
build_external ( zmq
D E P E N D S s o d i u m _ e x t e r n a l
$ { z m q _ p a t c h }