@ -87,12 +87,6 @@ endfunction()
if ( WITH_LTO )
set ( flto "-flto" )
else ( )
set ( flto "" )
endif ( )
set ( cross_host "" )
set ( cross_rc "" )
if ( CMAKE_CROSSCOMPILING )
@ -142,6 +136,18 @@ if(ANDROID)
set ( deps_ar "${CMAKE_ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/${android_toolchain_prefix}-${android_toolchain_suffix}-ar" )
endif ( )
set ( deps_CFLAGS "-O2" )
set ( deps_CXXFLAGS "-O2" )
if ( WITH_LTO )
set ( deps_CFLAGS "${deps_CFLAGS} -flto" )
endif ( )
if ( APPLE )
set ( deps_CFLAGS "${deps_CFLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}" )
set ( deps_CXXFLAGS "${deps_CXXFLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}" )
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
# t a r g e t n a m e s u f f i x e d w i t h ` _ e x t e r n a l ` . I t s u p p e r - c a s e v a l u e i s u s e d t o g e t t h e d o w n l o a d d e t a i l s
@ -150,7 +156,7 @@ endif()
set ( build_def_DEPENDS "" )
set ( build_def_PATCH_COMMAND "" )
set ( build_def_CONFIGURE_COMMAND ./configure ${ cross_host } --disable-shared --prefix= ${ DEPS_DESTDIR } --with-pic
" C C = $ { d e p s _ c c } " " C X X = $ { d e p s _ c x x } " " C F L A G S = -O 2 $ { f l t o } " " C X X F L A G S = -O 2 $ { f l t o } " $ { c r o s s _ r c } )
" C C = $ { d e p s _ c c } " " C X X = $ { d e p s _ c x x } " " C F L A G S = ${ d e p s _ C F L A G S } " " C X X F L A G S = ${ d e p s _ C X X F L A G S } " $ { c r o s s _ r c } )
set ( build_def_BUILD_COMMAND make )
set ( build_def_INSTALL_COMMAND make install )
set ( build_def_BUILD_BYPRODUCTS ${ DEPS_DESTDIR } /lib/lib___TARGET___.a ${ DEPS_DESTDIR } /include/___TARGET___.h )
@ -199,7 +205,7 @@ 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 } $ { o p e n s s l _ e x t r a _ o p t s } n o - 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 } "
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 = ${ d e p s _ C F L A G S } "
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
B U I L D _ B Y P R O D U C T S
$ { D E P S _ D E S T D I R } / l i b / l i b s s l . a $ { D E P S _ D E S T D I R } / l i b / l i b c r y p t o . a
@ -219,7 +225,7 @@ set(OPENSSL_VERSION 1.1.1)
build_external ( expat
C O N F I G U R E _ C O M M A N D . / c o n f i g u r e $ { c r o s s _ h o s t } - - p r e f i x = $ { D E P S _ D E S T D I R } - - e n a b l e - s t a t i c
- - d i s a b l e - s h a r e d - - w i t h - p i c - - w i t h o u t - e x a m p l e s - - w i t h o u t - t e s t s - - w i t h o u t - d o c b o o k - - w i t h o u t - x m l w f
" C C = $ { d e p s _ c c } " " C F L A G S = -O 2 $ { f l t o } "
" C C = $ { d e p s _ c c } " " C F L A G S = ${ d e p s _ C F L A G S } "
)
add_static_target ( expat expat_external libexpat.a )
@ -230,7 +236,7 @@ build_external(unbound
- - e n a b l e - s t a t i c - - w i t h - l i b u n b o u n d - o n l y - - w i t h - p i c
- - $ < I F : $ < B O O L : $ { W I T H _ L T O } > , e n a b l e , d i s a b l e > - f l t o - - w i t h - s s l = $ { D E P S _ D E S T D I R }
- - w i t h - l i b e x p a t = $ { D E P S _ D E S T D I R }
" C C = $ { d e p s _ c c } " " C F L A G S = -O 2 $ { f l t o } "
" C C = $ { d e p s _ c c } " " C F L A G S = ${ d e p s _ C F L A G S } "
)
add_static_target ( libunbound unbound_external libunbound.a )
if ( NOT WIN32 )
@ -242,7 +248,7 @@ endif()
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 } " )
- - 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 = ${ d e p s _ C F L A G S } " )
add_static_target ( sodium sodium_external libsodium.a )
build_external ( sqlite3 )
@ -260,7 +266,7 @@ build_external(zmq
C O N F I G U R E _ C O M M A N D . / c o n f i g u r e $ { c r o s s _ h o s t } - - p r e f i x = $ { D E P S _ D E S T D I R } - - e n a b l e - s t a t i c - - d i s a b l e - s h a r e d
- - d i s a b l e - c u r v e - k e y g e n - - e n a b l e - c u r v e - - d i s a b l e - d r a f t s - - d i s a b l e - l i b u n w i n d - - w i t h - l i b s o d i u m
- - w i t h o u t - p g m - - w i t h o u t - n o r m - - w i t h o u t - v m c i - - w i t h o u t - d o c s - - w i t h - p i c - - d i s a b l e - W e r r o r
" C C = $ { d e p s _ c c } " " C X X = $ { d e p s _ c x x } " " C F L A G S = -O 2 - f s t a c k - p r o t e c t o r $ { f l t o } " " C X X F L A G S = - O 2 - f s t a c k - p r o t e c t o r $ { f l t o } "
" C C = $ { d e p s _ c c } " " C X X = $ { d e p s _ c x x } " " C F L A G S = ${ d e p s _ C F L A G S } - f s t a c k - p r o t e c t o r " " C X X F L A G S = $ { d e p s _ C X X F L A G S } - f s t a c k - p r o t e c t o r "
" s o d i u m _ C F L A G S = - I $ { D E P S _ D E S T D I R } / i n c l u d e " " s o d i u m _ L I B S = - L $ { D E P S _ D E S T D I R } / l i b - l s o d i u m "
)
add_static_target ( libzmq zmq_external libzmq.a )