Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
# cmake bits to do a full static build, downloading and building all dependencies.
# Most of these are CACHE STRINGs so that you can override them using -DWHATEVER during cmake
# invocation to override.
set ( LOCAL_MIRROR "" CACHE STRING "local mirror path/URL for lib downloads" )
2020-10-24 20:35:29 +02:00
set ( OPENSSL_VERSION 1.1.1h CACHE STRING "openssl version" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( OPENSSL_MIRROR ${ LOCAL_MIRROR } https://www.openssl.org/source CACHE STRING "openssl download mirror(s)" )
set ( OPENSSL_SOURCE openssl- ${ OPENSSL_VERSION } .tar.gz )
2020-10-24 20:35:29 +02:00
set ( OPENSSL_HASH SHA256=5c9ca8774bd7b03e5784f26ae9e9e6d749c9da2438545077e6b3d755a06595d9
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
C A C H E S T R I N G " o p e n s s l s o u r c e h a s h " )
2020-10-24 20:35:29 +02:00
set ( EXPAT_VERSION 2.2.10 CACHE STRING "expat version" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
string ( REPLACE "." "_" EXPAT_TAG "R_${EXPAT_VERSION}" )
set ( EXPAT_MIRROR ${ LOCAL_MIRROR } https://github.com/libexpat/libexpat/releases/download/ ${ EXPAT_TAG }
C A C H E S T R I N G " e x p a t d o w n l o a d mirror ( s ) " )
set ( EXPAT_SOURCE expat- ${ EXPAT_VERSION } .tar.xz )
2020-10-24 20:35:29 +02:00
set ( EXPAT_HASH SHA512=a8e0c8a9cf7e6fbacdc6e709f3c99c533ab550fba52557d24259bb8b360f9697624c7500c0e9886fa57ee2b529aadd0d1835d66fe8112e15c20df75cd3eb090f
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
C A C H E S T R I N G " e x p a t s o u r c e h a s h " )
2020-10-24 20:35:29 +02:00
set ( UNBOUND_VERSION 1.12.0 CACHE STRING "unbound version" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( UNBOUND_MIRROR ${ LOCAL_MIRROR } https://nlnetlabs.nl/downloads/unbound CACHE STRING "unbound download mirror(s)" )
set ( UNBOUND_SOURCE unbound- ${ UNBOUND_VERSION } .tar.gz )
2020-10-24 20:35:29 +02:00
set ( UNBOUND_HASH SHA256=5b9253a97812f24419bf2e6b3ad28c69287261cf8c8fa79e3e9f6d3bf7ef5835
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
C A C H E S T R I N G " u n b o u n d s o u r c e h a s h " )
2020-09-16 16:17:45 +02:00
set ( BOOST_VERSION 1.74.0 CACHE STRING "boost version" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( BOOST_MIRROR ${ LOCAL_MIRROR } https://dl.bintray.com/boostorg/release/ ${ BOOST_VERSION } /source
C A C H E S T R I N G " b o o s t d o w n l o a d mirror ( s ) " )
string ( REPLACE "." "_" BOOST_VERSION_ ${ BOOST_VERSION } )
set ( BOOST_SOURCE boost_ ${ BOOST_VERSION_ } .tar.bz2 )
2020-09-16 16:17:45 +02:00
set ( BOOST_HASH SHA256=83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
C A C H E S T R I N G " b o o s t s o u r c e h a s h " )
set ( NCURSES_VERSION 6.2 CACHE STRING "ncurses version" )
set ( NCURSES_MIRROR ${ LOCAL_MIRROR } http://ftpmirror.gnu.org/gnu/ncurses
C A C H E S T R I N G " n c u r s e s d o w n l o a d mirror ( s ) " )
set ( NCURSES_SOURCE ncurses- ${ NCURSES_VERSION } .tar.gz )
set ( NCURSES_HASH SHA512=4c1333dcc30e858e8a9525d4b9aefb60000cfc727bc4a1062bace06ffc4639ad9f6e54f6bdda0e3a0e5ea14de995f96b52b3327d9ec633608792c99a1e8d840d
C A C H E S T R I N G " n c u r s e s s o u r c e h a s h " )
set ( READLINE_VERSION 8.0 CACHE STRING "readline version" )
set ( READLINE_MIRROR ${ LOCAL_MIRROR } http://ftpmirror.gnu.org/gnu/readline
C A C H E S T R I N G " r e a d l i n e d o w n l o a d mirror ( s ) " )
set ( READLINE_SOURCE readline- ${ READLINE_VERSION } .tar.gz )
set ( READLINE_HASH SHA512=41759d27bc3a258fefd7f4ff3277fa6ab9c21abb7b160e1a75aa8eba547bd90b288514e76264bd94fb0172da8a4faa54aab2c07b68a0356918ecf7f1969e866f
C A C H E S T R I N G " r e a d l i n e s o u r c e h a s h " )
2020-09-16 16:17:45 +02:00
set ( SQLITE3_VERSION 3330000 CACHE STRING "sqlite3 version" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( SQLITE3_MIRROR ${ LOCAL_MIRROR } https://www.sqlite.org/2020
C A C H E S T R I N G " s q l i t e 3 d o w n l o a d mirror ( s ) " )
set ( SQLITE3_SOURCE sqlite-autoconf- ${ SQLITE3_VERSION } .tar.gz )
2020-09-16 16:17:45 +02:00
set ( SQLITE3_HASH SHA512=c0d79d4012a01f12128ab5044b887576a130663245b85befcc0ab82ad3a315dd1e7f54b6301f842410c9c21b73237432c44a1d7c2fe0e0709435fec1f1a20a11
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
C A C H E S T R I N G " s q l i t e 3 s o u r c e h a s h " )
set ( EUDEV_VERSION 3.2.9 CACHE STRING "eudev version" )
set ( EUDEV_MIRROR ${ LOCAL_MIRROR } https://github.com/gentoo/eudev/archive/
C A C H E S T R I N G " e u d e v d o w n l o a d mirror ( s ) " )
set ( EUDEV_SOURCE v ${ EUDEV_VERSION } .tar.gz )
set ( EUDEV_HASH SHA512=33ee9849875fc381fc1bd9eef9119b96ed4014719ccf96f88c957e2c53ae6c46152bc0623e5efc99579a4063ab25251ed63ffe69441bca3b0074398cffda7747
C A C H E S T R I N G " e u d e v s o u r c e h a s h " )
set ( LIBUSB_VERSION 1.0.23 CACHE STRING "libusb version" )
set ( LIBUSB_MIRROR ${ LOCAL_MIRROR } https://github.com/libusb/libusb/releases/download/v ${ LIBUSB_VERSION }
C A C H E S T R I N G " l i b u s b d o w n l o a d mirror ( s ) " )
set ( LIBUSB_SOURCE libusb- ${ LIBUSB_VERSION } .tar.bz2 )
set ( LIBUSB_HASH SHA256=db11c06e958a82dac52cf3c65cb4dd2c3f339c8a988665110e0d24d19312ad8d
C A C H E S T R I N G " l i b u s b s o u r c e h a s h " )
set ( HIDAPI_VERSION 0.9.0 CACHE STRING "hidapi version" )
set ( HIDAPI_MIRROR ${ LOCAL_MIRROR } https://github.com/libusb/hidapi/archive
C A C H E S T R I N G " h i d a p i d o w n l o a d mirror ( s ) " )
set ( HIDAPI_SOURCE hidapi- ${ HIDAPI_VERSION } .tar.gz )
set ( HIDAPI_HASH SHA512=d9f28d394b78daece7d2dfb946e62349a56b388b3a06241585c6fad5a4e24dc914723de6c0f12a9e51cd23fb245f6b5ac9b3721319646d5ba5912bbe0a3f9a52
C A C H E S T R I N G " h i d a p i s o u r c e h a s h " )
2020-09-16 16:17:45 +02:00
set ( PROTOBUF_VERSION 3.13.0 CACHE STRING "protobuf version" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( PROTOBUF_MIRROR ${ LOCAL_MIRROR } https://github.com/protocolbuffers/protobuf/releases/download/v ${ PROTOBUF_VERSION }
C A C H E S T R I N G " p r o t o b u f mirror ( s ) " )
set ( PROTOBUF_SOURCE protobuf-cpp- ${ PROTOBUF_VERSION } .tar.gz )
2020-09-16 16:17:45 +02:00
set ( PROTOBUF_HASH SHA512=89a3d6207d14cc9afbd50a514a7c0f781c0e530bdbbe720e7e2f645301cdf59fb6772d5a95aea4a35ebcb2e17a738d8fdba8314fbc3aa6f34a97427ccf0c7342
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
C A C H E S T R I N G " p r o t o b u f s o u r c e h a s h " )
set ( SODIUM_VERSION 1.0.18 CACHE STRING "libsodium version" )
set ( SODIUM_MIRROR ${ LOCAL_MIRROR }
h t t p s : / / d o w n l o a d . l i b s o d i u m . o r g / l i b s o d i u m / r e l e a s e s
h t t p s : / / g i t h u b . c o m / j e d i s c t 1 / l i b s o d i u m / r e l e a s e s / d o w n l o a d / $ { S O D I U M _ V E R S I O N } - R E L E A S E
C A C H E S T R I N G " l i b s o d i u m mirror ( s ) " )
set ( SODIUM_SOURCE libsodium- ${ SODIUM_VERSION } .tar.gz )
set ( SODIUM_HASH SHA512=17e8638e46d8f6f7d024fe5559eccf2b8baf23e143fadd472a7d29d228b186d86686a5e6920385fe2020729119a5f12f989c3a782afbd05a8db4819bb18666ef
C A C H E S T R I N G " l i b s o d i u m s o u r c e h a s h " )
2020-09-16 16:17:45 +02:00
set ( ZMQ_VERSION 4.3.3 CACHE STRING "libzmq version" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( ZMQ_MIRROR ${ LOCAL_MIRROR } https://github.com/zeromq/libzmq/releases/download/v ${ ZMQ_VERSION }
C A C H E S T R I N G " l i b z m q mirror ( s ) " )
set ( ZMQ_SOURCE zeromq- ${ ZMQ_VERSION } .tar.gz )
2020-09-16 16:17:45 +02:00
set ( ZMQ_HASH SHA512=4c18d784085179c5b1fcb753a93813095a12c8d34970f2e1bfca6499be6c9d67769c71c68b7ca54ff181b20390043170e89733c22f76ff1ea46494814f7095b1
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
C A C H E S T R I N G " l i b z m q s o u r c e h a s h " )
2020-08-04 00:15:51 +02:00
set ( ZLIB_VERSION 1.2.11 CACHE STRING "zlib version" )
set ( ZLIB_MIRROR ${ LOCAL_MIRROR } https://zlib.net
C A C H E S T R I N G " z l i b mirror ( s ) " )
set ( ZLIB_SOURCE zlib- ${ ZLIB_VERSION } .tar.gz )
set ( ZLIB_HASH SHA512=73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae
C A C H E S T R I N G " z l i b s o u r c e h a s h " )
2020-09-16 16:17:45 +02:00
set ( CURL_VERSION 7.72.0 CACHE STRING "curl version" )
2020-08-04 00:15:51 +02:00
set ( CURL_MIRROR ${ LOCAL_MIRROR } https://curl.haxx.se/download https://curl.askapache.com
C A C H E S T R I N G " c u r l mirror ( s ) " )
set ( CURL_SOURCE curl- ${ CURL_VERSION } .tar.xz )
2020-09-16 16:17:45 +02:00
set ( CURL_HASH SHA256=0ded0808c4d85f2ee0db86980ae610cc9d165e9ca9da466196cc73c346513713
2020-08-04 00:15:51 +02:00
C A C H E S T R I N G " c u r l s o u r c e h a s h " )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
include ( ExternalProject )
set ( DEPS_DESTDIR ${ CMAKE_BINARY_DIR } /static-deps )
set ( DEPS_SOURCEDIR ${ CMAKE_BINARY_DIR } /static-deps-sources )
include_directories ( BEFORE SYSTEM ${ DEPS_DESTDIR } /include )
file ( MAKE_DIRECTORY ${ DEPS_DESTDIR } /include )
set ( deps_cc "${CMAKE_C_COMPILER}" )
set ( deps_cxx "${CMAKE_CXX_COMPILER}" )
2020-10-24 20:29:47 +02:00
if ( ANDROID )
if ( NOT ANDROID_TOOLCHAIN_NAME )
message ( FATAL_ERROR "ANDROID_TOOLCHAIN_NAME not set; did you run with the proper android toolchain options?" )
endif ( )
if ( CMAKE_ANDROID_ARCH_ABI MATCHES x86_64 )
set ( android_clang x86_64-linux-android ${ ANDROID_PLATFORM_LEVEL } -clang )
set ( openssl_machine x86_64 )
elseif ( CMAKE_ANDROID_ARCH_ABI MATCHES x86 )
set ( android_clang i686-linux-android ${ ANDROID_PLATFORM_LEVEL } -clang )
set ( openssl_machine i686 )
elseif ( CMAKE_ANDROID_ARCH_ABI MATCHES armeabi-v7a )
set ( android_clang armv7a-linux-androideabi ${ ANDROID_PLATFORM_LEVEL } -clang )
set ( openssl_machine armv7 )
elseif ( CMAKE_ANDROID_ARCH_ABI MATCHES arm64-v8a )
set ( android_clang aarch64-linux-android ${ ANDROID_PLATFORM_LEVEL } -clang )
set ( openssl_machine aarch64 )
else ( )
message ( FATAL_ERROR "Don't know how to build for android arch abi ${CMAKE_ANDROID_ARCH_ABI}" )
endif ( )
set ( deps_cc "${ANDROID_TOOLCHAIN_ROOT}/bin/${android_clang}" )
set ( deps_cxx "${deps_cc}++" )
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
if ( CMAKE_C_COMPILER_LAUNCHER )
set ( deps_cc "${CMAKE_C_COMPILER_LAUNCHER} ${deps_cc}" )
endif ( )
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 } )
list ( APPEND expanded "${mirror}/${source_file}" )
endforeach ( )
set ( ${ output } "${expanded}" PARENT_SCOPE )
endfunction ( )
function ( add_static_target target ext_target libname )
add_library ( ${ target } STATIC IMPORTED GLOBAL )
add_dependencies ( ${ target } ${ ext_target } )
set_target_properties ( ${ target } PROPERTIES
I M P O R T E D _ L O C A T I O N $ { D E P S _ D E S T D I R } / l i b / $ { l i b n a m e }
)
endfunction ( )
if ( USE_LTO )
set ( flto "-flto" )
else ( )
set ( flto "" )
endif ( )
set ( cross_host "" )
2020-10-24 20:29:47 +02:00
set ( cross_extra "" )
if ( ANDROID )
set ( cross_host "--host=${CMAKE_LIBRARY_ARCHITECTURE}" )
set ( cross_extra "LD=${ANDROID_TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}-ld" "RANLIB=${CMAKE_RANLIB}" "AR=${CMAKE_AR}" )
elseif ( CMAKE_CROSSCOMPILING )
2020-10-30 17:33:23 +01:00
if ( APPLE )
set ( cross_host "--host=${APPLE_TARGET_TRIPLE}" )
else ( )
set ( cross_host "--host=${ARCH_TRIPLET}" )
if ( ARCH_TRIPLET MATCHES mingw AND CMAKE_RC_COMPILER )
set ( cross_extra "WINDRES=${CMAKE_RC_COMPILER}" )
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
endif ( )
endif ( )
2020-10-24 20:29:47 +02:00
2020-10-15 01:09:03 +02:00
set ( deps_CFLAGS "-O2 ${flto}" )
set ( deps_CXXFLAGS "-O2 ${flto}" )
2020-10-30 17:33:23 +01:00
set ( deps_noarch_CFLAGS "${deps_CFLAGS}" )
set ( deps_noarch_CXXFLAGS "${deps_CXXFLAGS}" )
2020-10-15 01:09:03 +02:00
if ( APPLE )
2020-10-30 17:33:23 +01:00
foreach ( lang C CXX )
string ( APPEND deps_ ${ lang } FLAGS " ${CMAKE_${lang}_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT} ${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}${CMAKE_OSX_DEPLOYMENT_TARGET}" )
set ( deps_noarch_ ${ lang } FLAGS "${deps_${lang}FLAGS}" )
foreach ( arch ${ CMAKE_OSX_ARCHITECTURES } )
string ( APPEND deps_ ${ lang } FLAGS " -arch ${arch}" )
endforeach ( )
endforeach ( )
2020-10-15 01:09:03 +02:00
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
# 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
# (from the variables set above). The following options are supported and passed through to
# ExternalProject_Add if specified. If omitted, these defaults are used:
set ( build_def_DEPENDS "" )
set ( build_def_PATCH_COMMAND "" )
set ( build_def_CONFIGURE_COMMAND ./configure ${ cross_host } --disable-shared --prefix= ${ DEPS_DESTDIR } --with-pic
2020-10-24 20:29:47 +02:00
" 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 _ e x t r a } )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
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 )
2020-10-30 17:33:23 +01:00
set ( build_dep_TARGET_SUFFIX "" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
function ( build_external target )
2020-10-30 17:33:23 +01:00
set ( options TARGET_SUFFIX DEPENDS PATCH_COMMAND CONFIGURE_COMMAND BUILD_COMMAND INSTALL_COMMAND BUILD_BYPRODUCTS )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
cmake_parse_arguments ( PARSE_ARGV 1 arg "" "" "${options}" )
foreach ( o ${ options } )
if ( NOT DEFINED arg_ ${ o } )
set ( arg_ ${ o } ${ build_def_${o } } )
endif ( )
endforeach ( )
string ( REPLACE ___TARGET___ ${ target } arg_BUILD_BYPRODUCTS "${arg_BUILD_BYPRODUCTS}" )
string ( TOUPPER "${target}" prefix )
expand_urls ( urls ${ ${prefix } _SOURCE} ${ ${prefix } _MIRROR} )
2020-10-30 17:33:23 +01:00
ExternalProject_Add ( "${target}${arg_TARGET_SUFFIX}_external"
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
D E P E N D S $ { a r g _ D E P E N D S }
B U I L D _ I N _ S O U R C E O N
P R E F I X $ { D E P S _ S O U R C E D I R }
U R L $ { u r l s }
U R L _ H A S H $ { $ { p r e f i x } _ H A S H }
D O W N L O A D _ N O _ P R O G R E S S O N
P A T C H _ C O M M A N D $ { a r g _ P A T C H _ C O M M A N D }
C O N F I G U R E _ C O M M A N D $ { a r g _ C O N F I G U R E _ C O M M A N D }
B U I L D _ C O M M A N D $ { a r g _ B U I L D _ C O M M A N D }
I N S T A L L _ C O M M A N D $ { a r g _ I N S T A L L _ C O M M A N D }
B U I L D _ B Y P R O D U C T S $ { a r g _ B U I L D _ B Y P R O D U C T S }
)
endfunction ( )
2020-08-04 00:15:51 +02:00
build_external ( zlib
2020-10-26 23:16:59 +01:00
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 } " " C F L A G S = $ { d e p s _ C F L A G S } - f P I C " $ { c r o s s _ e x t r a } . / c o n f i g u r e - - p r e f i x = $ { D E P S _ D E S T D I R } - - s t a t i c
2020-08-04 00:15:51 +02:00
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 z . a
$ { D E P S _ D E S T D I R } / i n c l u d e / z l i b . h
)
add_static_target ( zlib zlib_external libz.a )
2020-10-30 17:33:23 +01:00
set ( openssl_configure ./config )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( openssl_system_env "" )
2020-10-30 17:33:23 +01:00
set ( openssl_cc "${deps_cc}" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
if ( CMAKE_CROSSCOMPILING )
if ( ARCH_TRIPLET STREQUAL x86_64-w64-mingw32 )
set ( openssl_system_env SYSTEM=MINGW64 RC= ${ CMAKE_RC_COMPILER } )
elseif ( ARCH_TRIPLET STREQUAL i686-w64-mingw32 )
set ( openssl_system_env SYSTEM=MINGW64 RC= ${ CMAKE_RC_COMPILER } )
2020-10-24 20:29:47 +02:00
elseif ( ANDROID )
set ( openssl_system_env SYSTEM=Linux MACHINE= ${ openssl_machine } ${ cross_extra } )
set ( openssl_extra_opts no-asm )
2020-10-30 17:33:23 +01:00
elseif ( IOS )
get_filename_component ( apple_toolchain "${CMAKE_C_COMPILER}" DIRECTORY )
get_filename_component ( apple_sdk "${CMAKE_OSX_SYSROOT}" NAME )
if ( NOT ${ apple_toolchain } MATCHES Xcode OR NOT ${ apple_sdk } MATCHES "iPhone(OS|Simulator)" )
message ( FATAL_ERROR "didn't find your toolchain and sdk correctly from ${CMAKE_C_COMPILER}/${CMAKE_OSX_SYSROOT}: found toolchain=${apple_toolchain}, sdk=${apple_sdk}" )
endif ( )
set ( openssl_system_env CROSS_COMPILE= ${ apple_toolchain } / CROSS_TOP= ${ CMAKE_DEVELOPER_ROOT } CROSS_SDK= ${ apple_sdk } )
set ( openssl_configure ./Configure iphoneos-cross )
set ( openssl_cc "clang" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
endif ( )
endif ( )
build_external ( openssl
2020-10-30 17:33:23 +01:00
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 = $ { o p e n s s l _ c c } $ { o p e n s s l _ s y s t e m _ e n v } $ { o p e n s s l _ c o n f i g u r e }
2020-10-24 20:29:47 +02:00
- - 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
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
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
2020-10-15 01:09:03 +02:00
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 - d y n a m i c " C F L A G S = $ { d e p s _ C F L A G S } "
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
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
$ { D E P S _ D E S T D I R } / i n c l u d e / o p e n s s l / s s l . h $ { D E P S _ D E S T D I R } / i n c l u d e / o p e n s s l / c r y p t o . h
)
add_static_target ( OpenSSL::SSL openssl_external libssl.a )
add_static_target ( OpenSSL::Crypto openssl_external libcrypto.a )
set ( OPENSSL_INCLUDE_DIR ${ DEPS_DESTDIR } /include )
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
2020-10-15 01:09:03 +02:00
" C C = $ { d e p s _ c c } " " C F L A G S = $ { d e p s _ C F L A G S } "
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
)
add_static_target ( expat expat_external libexpat.a )
2020-11-03 17:14:04 +01:00
set ( unbound_extra )
if ( APPLE AND IOS )
# I have no idea why this is necessary: without this it runs `clang -E` which should work, but
# doesn't because... hurray ios is wonderful?
set ( unbound_extra CPP=cpp )
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
build_external ( unbound
D E P E N D S o p e n s s l _ e x t e r n a l e x p a t _ e x t e r n a l
2020-10-24 20:29:47 +02:00
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 } $ { c r o s s _ e x t r a } - - p r e f i x = $ { D E P S _ D E S T D I R } - - d i s a b l e - s h a r e d
2020-10-30 17:33:23 +01:00
- - 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 - - d i s a b l e - g o s t
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
- - $ < I F : $ < B O O L : $ { U S E _ 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 }
2020-11-03 17:14:04 +01:00
" C C = $ { d e p s _ c c } " " C F L A G S = $ { d e p s _ C F L A G S } " $ { u n b o u n d _ e x t r a }
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
)
add_static_target ( libunbound unbound_external libunbound.a )
if ( WIN32 )
set_target_properties ( libunbound PROPERTIES INTERFACE_LINK_LIBRARIES "ws2_32;crypt32;iphlpapi" )
endif ( )
set ( boost_threadapi "pthread" )
set ( boost_bootstrap_cxx "CXX=${deps_cxx}" )
set ( boost_toolset "" )
set ( boost_extra "" )
if ( USE_LTO )
list ( APPEND boost_extra "lto=on" )
endif ( )
if ( CMAKE_CROSSCOMPILING )
set ( boost_bootstrap_cxx "" ) # need to use our native compiler to bootstrap
if ( ARCH_TRIPLET MATCHES mingw )
set ( boost_threadapi win32 )
list ( APPEND boost_extra "target-os=windows" )
if ( ARCH_TRIPLET MATCHES x86_64 )
list ( APPEND boost_extra "address-model=64" )
else ( )
list ( APPEND boost_extra "address-model=32" )
endif ( )
2020-10-24 20:35:08 +02:00
elseif ( ANDROID )
set ( boost_bootstrap_cxx "CXX=c++" )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
endif ( )
endif ( )
if ( CMAKE_CXX_COMPILER_ID STREQUAL GNU )
set ( boost_toolset gcc )
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$" )
set ( boost_toolset clang )
else ( )
message ( FATAL_ERROR "don't know how to build boost with ${CMAKE_CXX_COMPILER_ID}" )
endif ( )
2020-10-30 17:33:23 +01:00
if ( IOS )
set ( boost_arch_flags )
foreach ( arch ${ CMAKE_OSX_ARCHITECTURES } )
string ( APPEND boost_arch_flags " -arch ${arch}" )
endforeach ( )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /user-config.bjam " using darwin : : ${ deps_cxx } :
< a r c h i t e c t u r e > a r m
< t a r g e t - o s > i p h o n e
< c o m p i l e f l a g s > \ " - f P I C $ { b o o s t _ a r c h _ f l a g s } $ { C M A K E _ C X X _ O S X _ D E P L O Y M E N T _ T A R G E T _ F L A G } $ { C M A K E _ O S X _ D E P L O Y M E N T _ T A R G E T } - i s y s r o o t $ { C M A K E _ O S X _ S Y S R O O T } \ "
< t h r e a d i n g > m u l t i
; " )
else ( )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /user-config.bjam "using ${boost_toolset} : : ${deps_cxx} ;" )
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( boost_patch_commands "" )
2020-10-30 17:33:23 +01:00
if ( IOS )
set ( boost_patch_commands PATCH_COMMAND patch -p1 -i ${ PROJECT_SOURCE_DIR } /utils/build_scripts/boost-darwin-libtool-path.patch )
elseif ( APPLE AND BOOST_VERSION VERSION_LESS 1.74.0 )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
set ( boost_patch_commands PATCH_COMMAND patch -p1 -d tools/build -i ${ PROJECT_SOURCE_DIR } /utils/build_scripts/boostorg-build-pr560-macos-build-fix.patch )
endif ( )
2020-10-15 01:40:22 +02:00
set ( boost_buildflags "cxxflags=-fPIC" )
2020-10-30 17:33:23 +01:00
if ( IOS )
set ( boost_buildflags )
elseif ( APPLE )
2020-10-15 04:04:53 +02:00
set ( boost_buildflags "cxxflags=-fPIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}" "cflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}" )
2020-10-15 01:40:22 +02:00
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
build_external ( boost
# PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/user-config.bjam tools/build/src/user-config.jam
$ { b o o s t _ p a t c h _ c o m m a n d s }
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 $ { b o o s t _ b o o t s t r a p _ c x x }
. / b o o t s t r a p . s h - - w i t h o u t - i c u - - p r e f i x = $ { D E P S _ D E S T D I R } - - w i t h - t o o l s e t = $ { b o o s t _ t o o l s e t }
2020-10-22 23:44:11 +02:00
- - w i t h - l i b r a r i e s = p r o g r a m _ o p t i o n s , s y s t e m , t h r e a d , s e r i a l i z a t i o n
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
B U I L D _ C O M M A N D t r u e
I N S T A L L _ C O M M A N D
. / b 2 - d 0 v a r i a n t = r e l e a s e l i n k = s t a t i c r u n t i m e - l i n k = s t a t i c o p t i m i z a t i o n = s p e e d $ { b o o s t _ e x t r a }
2020-10-15 01:40:22 +02:00
t h r e a d i n g = m u l t i t h r e a d a p i = $ { b o o s t _ t h r e a d a p i } $ { b o o s t _ b u i l d f l a g s } c x x s t d = 1 4 v i s i b i l i t y = g l o b a l
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
- - d i s a b l e - i c u - - u s e r - c o n f i g = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / u s e r - c o n f i g . b j a m
i n s t a l l
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 b o o s t _ p r o g r a m _ o p t i o n s . a
$ { D E P S _ D E S T D I R } / l i b / l i b b o o s t _ s e r i a l i z a t i o n . a
$ { D E P S _ D E S T D I R } / l i b / l i b b o o s t _ s y s t e m . a
$ { D E P S _ D E S T D I R } / l i b / l i b b o o s t _ t h r e a d . a
$ { D E P S _ D E S T D I R } / i n c l u d e / b o o s t / v e r s i o n . h p p
)
add_library ( boost_core INTERFACE )
add_dependencies ( boost_core INTERFACE boost_external )
target_include_directories ( boost_core SYSTEM INTERFACE ${ DEPS_DESTDIR } /include )
add_library ( Boost::boost ALIAS boost_core )
2020-10-22 23:44:11 +02:00
foreach ( boostlib program_options serialization system thread )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
add_static_target ( Boost:: ${ boostlib } boost_external libboost_ ${ boostlib } .a )
target_link_libraries ( Boost:: ${ boostlib } INTERFACE boost_core )
endforeach ( )
set ( Boost_FOUND ON )
set ( Boost_VERSION ${ BOOST_VERSION } )
2020-10-30 17:33:23 +01:00
build_external ( sqlite3
B U I L D _ C O M M A N D t r u e
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 - i n c l u d e H E A D E R S i n s t a l l - l i b L T L I B R A R I E S )
2020-06-29 03:06:09 +02:00
add_static_target ( sqlite3 sqlite3_external libsqlite3.a )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
2020-10-30 17:33:23 +01:00
if ( NOT ( WIN32 OR ANDROID OR IOS ) )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
build_external ( ncurses
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 } - - w i t h o u t - d e b u g - - w i t h o u t - a d a
- - w i t h o u t - c x x - b i n d i n g - - w i t h o u t - c x x - - w i t h o u t - t i c l i b - - w i t h o u t - t i c - - w i t h o u t - p r o g s
- - w i t h o u t - t e s t s - - w i t h o u t - t a c k - - w i t h o u t - m a n p a g e s - - w i t h - t e r m l i b - - d i s a b l e - t i c - d e p e n d s
- - d i s a b l e - b i g - s t r i n g s - - d i s a b l e - e x t - c o l o r s - - e n a b l e - p c - f i l e s - - w i t h o u t - s h a r e d - - w i t h o u t - p t h r e a d
- - d i s a b l e - r p a t h - - d i s a b l e - c o l o r f g b g - - d i s a b l e - e x t - m o u s e - - d i s a b l e - s y m l i n k s - - e n a b l e - w a r n i n g s
- - e n a b l e - a s s e r t i o n s - - w i t h - d e f a u l t - t e r m i n f o - d i r = / e t c / _ t e r m i n f o _
- - w i t h - t e r m i n f o - d i r s = / e t c / _ t e r m i n f o _ - - d i s a b l e - p c - f i l e s - - e n a b l e - d a t a b a s e - - e n a b l e - s p - f u n c s
2020-10-15 01:09:03 +02:00
- - d i s a b l e - t e r m - d r i v e r - - e n a b l e - i n t e r o p - - e n a b l e - w i d e c " C C = $ { C M A K E _ C _ C O M P I L E R } " " C F L A G S = $ { d e p s _ C F L A G S } - f P I C "
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
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 . l i b s
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 n c u r s e s w . a
$ { D E P S _ D E S T D I R } / l i b / l i b t i n f o w . a
$ { D E P S _ D E S T D I R } / i n c l u d e / n c u r s e s w
$ { D E P S _ D E S T D I R } / i n c l u d e / n c u r s e s w / t e r m c a p . h
$ { D E P S _ D E S T D I R } / i n c l u d e / n c u r s e s w / n c u r s e s . h
)
add_static_target ( ncurses_tinfo ncurses_external libtinfow.a )
2020-10-02 06:02:48 +02:00
if ( FALSE ) # not working reliably
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
build_external ( readline
D E P E N D S n c u r s e s _ e x t e r n a l
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 } - - d i s a b l e - s h a r e d - - w i t h - c u r s e s
2020-10-15 01:09:03 +02:00
" C C = $ { d e p s _ c c } " " C F L A G S = $ { d e p s _ C F L A G S } - f P I C "
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
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 r e a d l i n e . a
$ { D E P S _ D E S T D I R } / i n c l u d e / r e a d l i n e
$ { D E P S _ D E S T D I R } / i n c l u d e / r e a d l i n e / r e a d l i n e . h
)
add_static_target ( readline readline_external libreadline.a )
set_target_properties ( readline PROPERTIES
I N T E R F A C E _ L I N K _ L I B R A R I E S n c u r s e s _ t i n f o
I N T E R F A C E _ C O M P I L E _ D E F I N I T I O N S H A V E _ R E A D L I N E )
2020-10-02 06:02:48 +02:00
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
endif ( )
2020-10-30 17:33:23 +01:00
if ( APPLE OR WIN32 OR ANDROID OR IOS )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
add_library ( libudev INTERFACE )
set ( maybe_eudev "" )
else ( )
build_external ( eudev
C O N F I G U R E _ C O M M A N D a u t o r e c o n f - i v f & & . / 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 } - - d i s a b l e - s h a r e d - - d i s a b l e - i n t r o s p e c t i o n
2020-10-15 01:09:03 +02:00
- - d i s a b l e - p r o g r a m s - - d i s a b l e - m a n p a g e s - - d i s a b l e - h w d b - - 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 } "
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
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 u d e v . a
$ { D E P S _ D E S T D I R } / i n c l u d e / l i b u d e v . h
)
add_static_target ( libudev eudev_external libudev.a )
set ( maybe_eudev "eudev_external" )
endif ( )
2020-10-30 17:33:23 +01:00
if ( NOT ( ANDROID OR IOS ) )
2020-10-24 20:29:47 +02:00
build_external ( libusb
C O N F I G U R E _ C O M M A N D a u t o r e c o n f - i v f & & . / 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 } - - d i s a b l e - s h a r e d - - d i s a b l e - u d e v - - w i t h - p i 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 } "
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 u s b - 1 . 0 . a
$ { D E P S _ D E S T D I R } / i n c l u d e / l i b u s b - 1 . 0
$ { D E P S _ D E S T D I R } / i n c l u d e / l i b u s b - 1 . 0 / l i b u s b . h
)
add_static_target ( libusb_vendor libusb_external libusb-1.0.a )
set_target_properties ( libusb_vendor PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${ DEPS_DESTDIR } /include/libusb-1.0 )
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
2020-10-30 17:33:23 +01:00
if ( ANDROID OR IOS )
2020-10-24 20:29:47 +02:00
set ( HIDAPI_FOUND FALSE )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
else ( )
2020-10-24 20:29:47 +02:00
if ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
set ( hidapi_libusb_lib libhidapi-libusb.a )
set ( hidapi_lib_byproducts ${ DEPS_DESTDIR } /lib/libhidapi-libusb.a ${ DEPS_DESTDIR } /lib/libhidapi-hidraw.a )
else ( )
set ( hidapi_libusb_lib libhidapi.a )
set ( hidapi_lib_byproducts ${ DEPS_DESTDIR } /lib/libhidapi.a )
endif ( )
build_external ( hidapi
D E P E N D S $ { m a y b e _ e u d e v } l i b u s b _ e x t e r n a l
C O N F I G U R E _ C O M M A N D a u t o r e c o n f - i v f & & . / 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 } - - d i s a b l e - s h a r e d - - 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 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 _ e x t r a }
" l i b u d e v _ 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 " " l i b u d e v _ L I B S = - L $ { D E P S _ D E S T D I R } / l i b - l u d e v "
" l i b u s b _ 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 / l i b u s b - 1 . 0 " " l i b u s b _ L I B S = - L $ { D E P S _ D E S T D I R } / l i b - l u s b - 1 . 0 "
B U I L D _ B Y P R O D U C T S
$ { h i d a p i _ l i b _ b y p r o d u c t s }
$ { D E P S _ D E S T D I R } / i n c l u d e / h i d a p i
$ { D E P S _ D E S T D I R } / i n c l u d e / h i d a p i / h i d a p i . h
)
set ( HIDAPI_FOUND TRUE )
add_static_target ( hidapi_libusb hidapi_external ${ hidapi_libusb_lib } )
set ( hidapi_links "libusb_vendor;libudev" )
if ( WIN32 )
list ( APPEND hidapi_links setupapi )
endif ( )
set_target_properties ( hidapi_libusb PROPERTIES
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { h i d a p i _ l i n k s } "
I N T E R F A C E _ C O M P I L E _ D E F I N I T I O N S H A V E _ H I D A P I )
2020-06-23 02:18:01 +02:00
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
2020-10-24 20:29:47 +02:00
set ( protobuf_extra "" )
if ( ANDROID )
set ( protobuf_extra "LDFLAGS=-llog" )
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
build_external ( protobuf
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 } - - d i s a b l e - s h a r e d - - p r e f i x = $ { D E P S _ D E S T D I R } - - w i t h - p i c
2020-10-15 01:09:03 +02:00
" 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 } "
2020-10-24 20:29:47 +02:00
$ { c r o s s _ e x t r a } $ { p r o t o b u f _ e x t r a }
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
" C P P = $ { d e p s _ c c } - E " " C X X C P P = $ { d e p s _ c x x } - E "
" C C _ F O R _ B U I L D = $ { d e p s _ c c } " " C X X _ F O R _ B U I L D = $ { d e p s _ c x x } " # Thanks Google for making people hunt for undocumented magic variables
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 p r o t o b u f - l i t e . a
$ { D E P S _ D E S T D I R } / l i b / l i b p r o t o b u f . a
$ { D E P S _ D E S T D I R } / l i b / l i b p r o t o c . a
$ { D E P S _ D E S T D I R } / i n c l u d e / g o o g l e / p r o t o b u f
)
add_static_target ( protobuf_lite protobuf_external libprotobuf-lite.a )
add_static_target ( protobuf_bloated protobuf_external libprotobuf.a )
build_external ( sodium )
add_static_target ( sodium sodium_external libsodium.a )
2020-09-16 18:14:24 +02:00
if ( ZMQ_VERSION VERSION_LESS 4.3.4 AND CMAKE_CROSSCOMPILING AND ARCH_TRIPLET MATCHES mingw )
set ( zmq_patch PATCH_COMMAND patch -p1 -i ${ PROJECT_SOURCE_DIR } /utils/build_scripts/libzmq-mingw-closesocket.patch )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
endif ( )
2020-10-30 17:33:23 +01:00
set ( zmq_cross_host "${cross_host}" )
if ( IOS AND cross_host MATCHES "-ios$" )
# zmq doesn't like "-ios" for the host, so replace it with -darwin
string ( REGEX REPLACE "-ios$" "-darwin" zmq_cross_host ${ cross_host } )
endif ( )
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
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 }
2020-10-30 17:33:23 +01:00
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 $ { z m q _ 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
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
- - 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
2020-10-15 01:09:03 +02:00
" C C = $ { d e p s _ c c } " " C X X = $ { d e p s _ c x x } " " C F L A G S = - f s t a c k - p r o t e c t o r $ { d e p s _ C F L A G S } " " C X X F L A G S = - f s t a c k - p r o t e c t o r $ { d e p s _ C X X F L A G S } "
2020-10-24 20:29:47 +02:00
$ { c r o s s _ e x t r a }
Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:
cmake .. -DBUILD_STATIC_DEPS=ON
which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.). It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.
Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance. It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.
This works on Linux, Mac, and Windows.
Some random comments on this commit (for preserving history):
- Don't use target_link_libraries on imported targets. Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.
- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium. Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.
- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to. Thanks Google.
- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-11 20:19:44 +02:00
" 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 )
set ( libzmq_link_libs "sodium" )
if ( CMAKE_CROSSCOMPILING AND ARCH_TRIPLET MATCHES mingw )
list ( APPEND libzmq_link_libs iphlpapi )
endif ( )
2020-06-24 21:21:55 +02:00
set_target_properties ( libzmq PROPERTIES
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { l i b z m q _ l i n k _ l i b s } "
I N T E R F A C E _ C O M P I L E _ D E F I N I T I O N S " Z M Q _ S T A T I C " )
2020-08-04 00:15:51 +02:00
2020-11-03 18:14:11 +01:00
set ( curl_extra )
2020-08-04 00:15:51 +02:00
if ( WIN32 )
set ( curl_ssl_opts --without-ssl --with-schannel )
elseif ( APPLE )
set ( curl_ssl_opts --without-ssl --with-secure-transport )
2020-10-30 17:33:23 +01:00
if ( IOS )
2020-11-03 18:14:11 +01:00
# This CPP crap shouldn't be necessary but is because Apple's toolchain is trash
set ( curl_extra "LDFLAGS=-L${DEPS_DESTDIR}/lib -isysroot ${CMAKE_OSX_SYSROOT}" CPP=cpp )
2020-10-30 17:33:23 +01:00
endif ( )
2020-08-04 00:15:51 +02:00
else ( )
set ( curl_ssl_opts --with-ssl= ${ DEPS_DESTDIR } )
2020-11-03 18:14:11 +01:00
set ( curl_extra "LIBS=-pthread" )
2020-08-04 00:15:51 +02:00
endif ( )
2020-10-30 17:33:23 +01:00
set ( curl_arches default )
set ( curl_lib_outputs )
if ( IOS )
# On iOS things get a little messy: curl won't build a multi-arch library (with `clang -arch arch1
# -arch arch2`) so we have to build them separately then glue them together if we're building
# multiple.
set ( curl_arches ${ CMAKE_OSX_ARCHITECTURES } )
list ( GET curl_arches 0 curl_arch0 )
list ( LENGTH CMAKE_OSX_ARCHITECTURES num_arches )
endif ( )
foreach ( curl_arch ${ curl_arches } )
set ( curl_target_suffix "" )
set ( curl_prefix "${DEPS_DESTDIR}" )
if ( curl_arch STREQUAL "default" )
set ( curl_cflags_extra "" )
elseif ( IOS )
set ( cflags_extra " -arch ${curl_arch}" )
if ( num_arches GREATER 1 )
set ( curl_target_suffix "-${curl_arch}" )
set ( curl_prefix "${DEPS_DESTDIR}/tmp/${curl_arch}" )
endif ( )
else ( )
message ( FATAL_ERROR "unexpected curl_arch=${curl_arch}" )
endif ( )
build_external ( curl
T A R G E T _ S U F F I X $ { c u r l _ t a r g e t _ s u f f i x }
D E P E N D S o p e n s s l _ e x t e r n a l z l i b _ e x t e r n a l
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 } $ { c r o s s _ e x t r a } - - p r e f i x = $ { c u r l _ p r e f i x } - - d i s a b l e - s h a r e d
- - e n a b l e - s t a t i c - - d i s a b l e - a r e s - - d i s a b l e - f t p - - d i s a b l e - l d a p - - d i s a b l e - l a p s - - d i s a b l e - r t s p
- - d i s a b l e - d i c t - - d i s a b l e - t e l n e t - - d i s a b l e - t f t p - - d i s a b l e - p o p 3 - - d i s a b l e - i m a p - - d i s a b l e - s m b
- - d i s a b l e - s m t p - - d i s a b l e - g o p h e r - - d i s a b l e - m a n u a l - - d i s a b l e - l i b c u r l - o p t i o n - - e n a b l e - h t t p
- - e n a b l e - i p v 6 - - d i s a b l e - t h r e a d e d - r e s o l v e r - - d i s a b l e - p t h r e a d s - - d i s a b l e - v e r b o s e - - d i s a b l e - s s p i
- - e n a b l e - c r y p t o - a u t h - - d i s a b l e - n t l m - w b - - d i s a b l e - t l s - s r p - - d i s a b l e - u n i x - s o c k e t s - - d i s a b l e - c o o k i e s
- - e n a b l e - h t t p - a u t h - - e n a b l e - d o h - - d i s a b l e - m i m e - - e n a b l e - d a t e p a r s e - - d i s a b l e - n e t r c - - w i t h o u t - l i b i d n 2
- - d i s a b l e - p r o g r e s s - m e t e r - - w i t h o u t - b r o t l i - - w i t h - z l i b = $ { D E P S _ D E S T D I R } $ { c u r l _ s s l _ o p t s }
- - w i t h o u t - l i b m e t a l i n k - - w i t h o u t - l i b r t m p - - d i s a b l e - v e r s i o n e d - s y m b o l s - - e n a b l e - h i d d e n - s y m b o l s
- - w i t h o u t - z s h - f u n c t i o n s - d i r - - w i t h o u t - f i s h - f u n c t i o n s - d i r
2020-11-03 18:14:11 +01:00
" C C = $ { d e p s _ c c } " " C F L A G S = $ { d e p s _ n o a r c h _ C F L A G S } $ { c f l a g s _ e x t r a } " $ { c u r l _ e x t r a }
2020-10-30 17:33:23 +01:00
B U I L D _ C O M M A N D t r u e
I N S T A L L _ C O M M A N D m a k e - C l i b i n s t a l l & & m a k e - C i n c l u d e i n s t a l l
B U I L D _ B Y P R O D U C T S
$ { c u r l _ p r e f i x } / l i b / l i b c u r l . a
$ { c u r l _ p r e f i x } / i n c l u d e / c u r l / c u r l . h
)
list ( APPEND curl_lib_targets curl ${ curl_target_suffix } _external )
list ( APPEND curl_lib_outputs ${ curl_prefix } /lib/libcurl.a )
endforeach ( )
message ( STATUS "TARGETS: ${curl_lib_targets}" )
if ( IOS AND num_arches GREATER 1 )
# We are building multiple architectures for different iOS devices, so we need to glue the
# separate libraries into one. (Normally multiple -arch values passed to clang does this for us,
# but curl refuses to build that way).
add_custom_target ( curl_external
C O M M A N D l i p o $ { c u r l _ l i b _ o u t p u t s } - c r e a t e - o u t p u t $ { D E P S _ D E S T D I R } / l i b c u r l . a
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ d i r e c t o r y $ { D E P S _ D E S T D I R } / t m p / $ { c u r l _ a r c h 0 } / i n c l u d e / c u r l $ { D E P S _ D E S T D I R } / i n c l u d e / c u r l
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 c u r l . a $ { D E P S _ D E S T D I R } / i n c l u d e / c u r l / c u r l . h
D E P E N D S $ { c u r l _ l i b _ t a r g e t s } )
endif ( )
2020-08-04 00:15:51 +02:00
add_static_target ( CURL::libcurl curl_external libcurl.a )
set ( libcurl_link_libs zlib )
if ( CMAKE_CROSSCOMPILING AND ARCH_TRIPLET MATCHES mingw )
list ( APPEND libcurl_link_libs crypt32 )
elseif ( APPLE )
list ( APPEND libcurl_link_libs "-framework Security" )
endif ( )
set_target_properties ( CURL::libcurl PROPERTIES
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { l i b c u r l _ l i n k _ l i b s } "
I N T E R F A C E _ C O M P I L E _ D E F I N I T I O N S " C U R L _ S T A T I C L I B " )