mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
Apply macosx target BS to static deps
This commit is contained in:
parent
30f77c2f21
commit
68b0f93f5d
|
@ -165,6 +165,13 @@ if(CMAKE_CROSSCOMPILING)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(deps_CFLAGS "-O2 ${flto}")
|
||||||
|
set(deps_CXXFLAGS "-O2 ${flto}")
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
# Builds a target; takes the target name (e.g. "readline") and builds it in an external project with
|
# Builds a target; takes the target name (e.g. "readline") and builds it in an external project with
|
||||||
# target name suffixed with `_external`. Its upper-case value is used to get the download details
|
# target name suffixed with `_external`. Its upper-case value is used to get the download details
|
||||||
|
@ -173,7 +180,7 @@ endif()
|
||||||
set(build_def_DEPENDS "")
|
set(build_def_DEPENDS "")
|
||||||
set(build_def_PATCH_COMMAND "")
|
set(build_def_PATCH_COMMAND "")
|
||||||
set(build_def_CONFIGURE_COMMAND ./configure ${cross_host} --disable-shared --prefix=${DEPS_DESTDIR} --with-pic
|
set(build_def_CONFIGURE_COMMAND ./configure ${cross_host} --disable-shared --prefix=${DEPS_DESTDIR} --with-pic
|
||||||
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=-O2 ${flto}" "CXXFLAGS=-O2 ${flto}" ${cross_rc})
|
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=${deps_CFLAGS}" "CXXFLAGS=${deps_CXXFLAGS}" ${cross_rc})
|
||||||
set(build_def_BUILD_COMMAND make)
|
set(build_def_BUILD_COMMAND make)
|
||||||
set(build_def_INSTALL_COMMAND make install)
|
set(build_def_INSTALL_COMMAND make install)
|
||||||
set(build_def_BUILD_BYPRODUCTS ${DEPS_DESTDIR}/lib/lib___TARGET___.a ${DEPS_DESTDIR}/include/___TARGET___.h)
|
set(build_def_BUILD_BYPRODUCTS ${DEPS_DESTDIR}/lib/lib___TARGET___.a ${DEPS_DESTDIR}/include/___TARGET___.h)
|
||||||
|
@ -208,7 +215,7 @@ endfunction()
|
||||||
|
|
||||||
|
|
||||||
build_external(zlib
|
build_external(zlib
|
||||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env "CC=${deps_cc}" "CFLAGS=-O2 ${flto}" ./configure --prefix=${DEPS_DESTDIR} --static
|
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env "CC=${deps_cc}" "CFLAGS=${deps_CFLAGS}" ./configure --prefix=${DEPS_DESTDIR} --static
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
${DEPS_DESTDIR}/lib/libz.a
|
${DEPS_DESTDIR}/lib/libz.a
|
||||||
${DEPS_DESTDIR}/include/zlib.h
|
${DEPS_DESTDIR}/include/zlib.h
|
||||||
|
@ -229,7 +236,7 @@ build_external(openssl
|
||||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CC=${deps_cc} ${openssl_system_env} ./config
|
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CC=${deps_cc} ${openssl_system_env} ./config
|
||||||
--prefix=${DEPS_DESTDIR} no-shared no-capieng no-dso no-dtls1 no-ec_nistp_64_gcc_128 no-gost
|
--prefix=${DEPS_DESTDIR} no-shared no-capieng no-dso no-dtls1 no-ec_nistp_64_gcc_128 no-gost
|
||||||
no-heartbeats no-md2 no-rc5 no-rdrand no-rfc3779 no-sctp no-ssl-trace no-ssl2 no-ssl3
|
no-heartbeats no-md2 no-rc5 no-rdrand no-rfc3779 no-sctp no-ssl-trace no-ssl2 no-ssl3
|
||||||
no-static-engine no-tests no-weak-ssl-ciphers no-zlib-dynamic "CFLAGS=-O2 ${flto}"
|
no-static-engine no-tests no-weak-ssl-ciphers no-zlib-dynamic "CFLAGS=${deps_CFLAGS}"
|
||||||
INSTALL_COMMAND make install_sw
|
INSTALL_COMMAND make install_sw
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
${DEPS_DESTDIR}/lib/libssl.a ${DEPS_DESTDIR}/lib/libcrypto.a
|
${DEPS_DESTDIR}/lib/libssl.a ${DEPS_DESTDIR}/lib/libcrypto.a
|
||||||
|
@ -245,7 +252,7 @@ set(OPENSSL_VERSION 1.1.1)
|
||||||
build_external(expat
|
build_external(expat
|
||||||
CONFIGURE_COMMAND ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --enable-static
|
CONFIGURE_COMMAND ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --enable-static
|
||||||
--disable-shared --with-pic --without-examples --without-tests --without-docbook --without-xmlwf
|
--disable-shared --with-pic --without-examples --without-tests --without-docbook --without-xmlwf
|
||||||
"CC=${deps_cc}" "CFLAGS=-O2 ${flto}"
|
"CC=${deps_cc}" "CFLAGS=${deps_CFLAGS}"
|
||||||
)
|
)
|
||||||
add_static_target(expat expat_external libexpat.a)
|
add_static_target(expat expat_external libexpat.a)
|
||||||
|
|
||||||
|
@ -256,7 +263,7 @@ build_external(unbound
|
||||||
--enable-static --with-libunbound-only --with-pic
|
--enable-static --with-libunbound-only --with-pic
|
||||||
--$<IF:$<BOOL:${USE_LTO}>,enable,disable>-flto --with-ssl=${DEPS_DESTDIR}
|
--$<IF:$<BOOL:${USE_LTO}>,enable,disable>-flto --with-ssl=${DEPS_DESTDIR}
|
||||||
--with-libexpat=${DEPS_DESTDIR}
|
--with-libexpat=${DEPS_DESTDIR}
|
||||||
"CC=${deps_cc}" "CFLAGS=-O2 ${flto}"
|
"CC=${deps_cc}" "CFLAGS=${deps_CFLAGS}"
|
||||||
)
|
)
|
||||||
add_static_target(libunbound unbound_external libunbound.a)
|
add_static_target(libunbound unbound_external libunbound.a)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
@ -350,7 +357,7 @@ if (NOT WIN32)
|
||||||
--disable-rpath --disable-colorfgbg --disable-ext-mouse --disable-symlinks --enable-warnings
|
--disable-rpath --disable-colorfgbg --disable-ext-mouse --disable-symlinks --enable-warnings
|
||||||
--enable-assertions --with-default-terminfo-dir=/etc/_terminfo_
|
--enable-assertions --with-default-terminfo-dir=/etc/_terminfo_
|
||||||
--with-terminfo-dirs=/etc/_terminfo_ --disable-pc-files --enable-database --enable-sp-funcs
|
--with-terminfo-dirs=/etc/_terminfo_ --disable-pc-files --enable-database --enable-sp-funcs
|
||||||
--disable-term-driver --enable-interop --enable-widec "CC=${CMAKE_C_COMPILER}" "CFLAGS=-O2 -fPIC ${flto}"
|
--disable-term-driver --enable-interop --enable-widec "CC=${CMAKE_C_COMPILER}" "CFLAGS=${deps_CFLAGS} -fPIC"
|
||||||
INSTALL_COMMAND make install.libs
|
INSTALL_COMMAND make install.libs
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
${DEPS_DESTDIR}/lib/libncursesw.a
|
${DEPS_DESTDIR}/lib/libncursesw.a
|
||||||
|
@ -367,7 +374,7 @@ if (NOT WIN32)
|
||||||
build_external(readline
|
build_external(readline
|
||||||
DEPENDS ncurses_external
|
DEPENDS ncurses_external
|
||||||
CONFIGURE_COMMAND ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --disable-shared --with-curses
|
CONFIGURE_COMMAND ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --disable-shared --with-curses
|
||||||
"CC=${deps_cc}" "CFLAGS=-fPIC ${flto}"
|
"CC=${deps_cc}" "CFLAGS=${deps_CFLAGS} -fPIC"
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
${DEPS_DESTDIR}/lib/libreadline.a
|
${DEPS_DESTDIR}/lib/libreadline.a
|
||||||
${DEPS_DESTDIR}/include/readline
|
${DEPS_DESTDIR}/include/readline
|
||||||
|
@ -388,7 +395,7 @@ if(APPLE OR WIN32)
|
||||||
else()
|
else()
|
||||||
build_external(eudev
|
build_external(eudev
|
||||||
CONFIGURE_COMMAND autoreconf -ivf && ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --disable-shared --disable-introspection
|
CONFIGURE_COMMAND autoreconf -ivf && ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --disable-shared --disable-introspection
|
||||||
--disable-programs --disable-manpages --disable-hwdb --with-pic "CC=${deps_cc}" "CFLAGS=-O2 ${flto}"
|
--disable-programs --disable-manpages --disable-hwdb --with-pic "CC=${deps_cc}" "CFLAGS=${deps_CFLAGS}"
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
${DEPS_DESTDIR}/lib/libudev.a
|
${DEPS_DESTDIR}/lib/libudev.a
|
||||||
${DEPS_DESTDIR}/include/libudev.h
|
${DEPS_DESTDIR}/include/libudev.h
|
||||||
|
@ -401,7 +408,7 @@ endif()
|
||||||
|
|
||||||
build_external(libusb
|
build_external(libusb
|
||||||
CONFIGURE_COMMAND autoreconf -ivf && ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --disable-shared --disable-udev --with-pic
|
CONFIGURE_COMMAND autoreconf -ivf && ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --disable-shared --disable-udev --with-pic
|
||||||
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=-O2 ${flto}" "CXXFLAGS=-O2 ${flto}"
|
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=${deps_CFLAGS}" "CXXFLAGS=${deps_CXXFLAGS}"
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
${DEPS_DESTDIR}/lib/libusb-1.0.a
|
${DEPS_DESTDIR}/lib/libusb-1.0.a
|
||||||
${DEPS_DESTDIR}/include/libusb-1.0
|
${DEPS_DESTDIR}/include/libusb-1.0
|
||||||
|
@ -422,7 +429,7 @@ endif()
|
||||||
build_external(hidapi
|
build_external(hidapi
|
||||||
DEPENDS ${maybe_eudev} libusb_external
|
DEPENDS ${maybe_eudev} libusb_external
|
||||||
CONFIGURE_COMMAND autoreconf -ivf && ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --disable-shared --enable-static --with-pic
|
CONFIGURE_COMMAND autoreconf -ivf && ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --disable-shared --enable-static --with-pic
|
||||||
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=-O2 ${flto}" "CXXFLAGS=-O2 ${flto}"
|
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=${deps_CFLAGS}" "CXXFLAGS=${deps_CXXFLAGS}"
|
||||||
"libudev_CFLAGS=-I${DEPS_DESTDIR}/include" "libudev_LIBS=-L${DEPS_DESTDIR}/lib -ludev"
|
"libudev_CFLAGS=-I${DEPS_DESTDIR}/include" "libudev_LIBS=-L${DEPS_DESTDIR}/lib -ludev"
|
||||||
"libusb_CFLAGS=-I${DEPS_DESTDIR}/include/libusb-1.0" "libusb_LIBS=-L${DEPS_DESTDIR}/lib -lusb-1.0"
|
"libusb_CFLAGS=-I${DEPS_DESTDIR}/include/libusb-1.0" "libusb_LIBS=-L${DEPS_DESTDIR}/lib -lusb-1.0"
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
|
@ -445,7 +452,7 @@ set_target_properties(hidapi_libusb PROPERTIES
|
||||||
build_external(protobuf
|
build_external(protobuf
|
||||||
CONFIGURE_COMMAND
|
CONFIGURE_COMMAND
|
||||||
./configure ${cross_host} --disable-shared --prefix=${DEPS_DESTDIR} --with-pic
|
./configure ${cross_host} --disable-shared --prefix=${DEPS_DESTDIR} --with-pic
|
||||||
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=-O2 ${flto}" "CXXFLAGS=-O2 ${flto}"
|
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=${deps_CFLAGS}" "CXXFLAGS=${deps_CXXFLAGS}"
|
||||||
"CPP=${deps_cc} -E" "CXXCPP=${deps_cxx} -E"
|
"CPP=${deps_cc} -E" "CXXCPP=${deps_cxx} -E"
|
||||||
"CC_FOR_BUILD=${deps_cc}" "CXX_FOR_BUILD=${deps_cxx}" # Thanks Google for making people hunt for undocumented magic variables
|
"CC_FOR_BUILD=${deps_cc}" "CXX_FOR_BUILD=${deps_cxx}" # Thanks Google for making people hunt for undocumented magic variables
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
|
@ -472,7 +479,7 @@ build_external(zmq
|
||||||
CONFIGURE_COMMAND ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --enable-static --disable-shared
|
CONFIGURE_COMMAND ./configure ${cross_host} --prefix=${DEPS_DESTDIR} --enable-static --disable-shared
|
||||||
--disable-curve-keygen --enable-curve --disable-drafts --disable-libunwind --with-libsodium
|
--disable-curve-keygen --enable-curve --disable-drafts --disable-libunwind --with-libsodium
|
||||||
--without-pgm --without-norm --without-vmci --without-docs --with-pic --disable-Werror
|
--without-pgm --without-norm --without-vmci --without-docs --with-pic --disable-Werror
|
||||||
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=-O2 -fstack-protector ${flto}" "CXXFLAGS=-O2 -fstack-protector ${flto}"
|
"CC=${deps_cc}" "CXX=${deps_cxx}" "CFLAGS=-fstack-protector ${deps_CFLAGS}" "CXXFLAGS=-fstack-protector ${deps_CXXFLAGS}"
|
||||||
"sodium_CFLAGS=-I${DEPS_DESTDIR}/include" "sodium_LIBS=-L${DEPS_DESTDIR}/lib -lsodium"
|
"sodium_CFLAGS=-I${DEPS_DESTDIR}/include" "sodium_LIBS=-L${DEPS_DESTDIR}/lib -lsodium"
|
||||||
)
|
)
|
||||||
add_static_target(libzmq zmq_external libzmq.a)
|
add_static_target(libzmq zmq_external libzmq.a)
|
||||||
|
@ -510,7 +517,7 @@ build_external(curl
|
||||||
--disable-progress-meter --without-brotli --with-zlib=${DEPS_DESTDIR} ${curl_ssl_opts}
|
--disable-progress-meter --without-brotli --with-zlib=${DEPS_DESTDIR} ${curl_ssl_opts}
|
||||||
--without-libmetalink --without-librtmp --disable-versioned-symbols --enable-hidden-symbols
|
--without-libmetalink --without-librtmp --disable-versioned-symbols --enable-hidden-symbols
|
||||||
--without-zsh-functions-dir --without-fish-functions-dir
|
--without-zsh-functions-dir --without-fish-functions-dir
|
||||||
"CC=${deps_cc}" "CFLAGS=-O2 ${flto}" ${curl_LIBS}
|
"CC=${deps_cc}" "CFLAGS=${deps_CFLAGS}" ${curl_LIBS}
|
||||||
BUILD_BYPRODUCTS
|
BUILD_BYPRODUCTS
|
||||||
${DEPS_DESTDIR}/lib/libcurl.a
|
${DEPS_DESTDIR}/lib/libcurl.a
|
||||||
${DEPS_DESTDIR}/include/curl/curl.h
|
${DEPS_DESTDIR}/include/curl/curl.h
|
||||||
|
|
Loading…
Reference in a new issue