Commit Graph

229 Commits

Author SHA1 Message Date
Jason Rhinelander
c5faa86926 cmake refactor
Refactors many things in cmake to improve and simplify:

- don't use variable indirection for target names; target names are
*already* a variable of sorts.  (e.g. ${UTIL_LIB} is now just
lokinet-util).  cmake/basic_definitions.cmake is now gone.

- fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather
than shoving a bunch of flag hacks through link_libraries and
add_compile_options.  This also now enables LTO when building a shared
library (because previously the -flto hacks were only turned on in the
static code for some reason).

- build liblokinet as *either* shared library or static library, but not
both.  Building both makes things more complicated because they had
different names (lokinet-shared or lokinet-static) and seems pointless:
you generally want one or the other.  Now there is just the liblokinet
target, which will be shared or static depending on the value of
BUILD_SHARED_LIBS.

- Simplify lokinet-cryptography AVX2 code: just build *one* library, and
add in the additional AVX2 files when possible, rather than building two
and needing to merge them.

- Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK.
It makes no sense to use one of these (_RUNTIME) on Windows and the
other on non-Windows when they appear to try to do the same thing.

- remove a bunch of annotations from `endif(FOO)` -> `endif()`.

- move all the tuntap compilation code (including OS-specific source
file selection) into vendor/CMakeLists.txt and build tuntap as an
intermediate OBJECT library rather than keeping a global variable in 5
different files.

- move release motto define to root cmake; it made no sense being
duplicated in both unix.cmake and win32.cmake

- fix add_log_tag to not stomp on any existing source compile flags with
its definition.  Also use proper compile definition property instead of
cramming it into compile flags.

- make optimization/linker flags less hacky.  There's no reason for us
to force particular optimization flags because the cmake build type
already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3).  Not doing
that also silences a bunch of cmake warnings because it thinks "-O0 -g3"
etc.  are link libraries (which is reasonable: that's what the code was
telling cmake they are).

- sets the default build type to RelWithDebInfo which gives us `-O2 -g`
if you don't specify a build type.

- Move PIC up (so that the things loaded in unix.cmake, notably libuv,
have it set).

- Add a custom `curl` interface library that carries the correct link
target and include paths for curl (system or bundled).
2020-05-17 23:31:23 -03:00
Jason Rhinelander
5087ba2364 Regex fix 2020-05-17 17:08:11 -03:00
Jeff Becker
06348ced47 fix typo in makefile 2020-05-17 14:54:29 -03:00
Jeff Becker
64157d5d44 track libcurl and libuv with cmake, add libuv submodule 2020-05-17 14:53:28 -03:00
Jeff Becker
04c542b03f
clean up makefile targets to remove some old unused ones 2020-05-15 11:21:52 -04:00
Jeff Becker
3ac2a3defa
add dist source tarball generation and bundle it with gitlab static release 2020-05-15 10:45:11 -04:00
Jeff Becker
1072d9b505
detect travis using environmental vars 2020-05-15 09:12:00 -04:00
Jeff Becker
a7d616843f
add shitty check for running in travis with workarounds because god is dead and travis-ci fucking sucks. 2020-05-15 09:01:47 -04:00
Jason Rhinelander
f8209baf50 Move release motto string into CMakeLists.txt
Right after project() which contains the version, so that version +
motto updates are basically in one place (and so that non-Makefile cmake
invocations get it).
2020-04-19 23:18:48 -03:00
Jason Rhinelander
ebb1950941 Add -DBUILD_PACKAGE=ON to make cpack code opt-in 2020-04-19 23:18:41 -03:00
Jeff
5b1941222b
unscrew travis-ci (#1223)
* update travis ci clang-format to clang-format-9 because we use that now
add python3-dev package becuase something inside ci thinks it has python but really does not

* try using python3.6

* try working around hot garbage that is travis-ci

* add deadsnakes repo for python3.8

* prevent nullptr deference when running in unit tests

* move python3.8 to main dependancy matrix and add python3.8 to homebrew deps

* add deadsnake apt repo

* add deadsnakes and python3.8 back to previous matrix

* dev package for python

* toggle hive build in ci

* dont add pybind11 if not bulding hive

* revert setting pyenv shim for travis ci

* make native builds on by default except for windows ci

* only apply native build being off for windows release target becuase that broke macos
2020-04-18 16:58:41 -03:00
Stephen Shelton
30e7c7f828
Bump clang-format version 8 -> 9 2020-04-07 12:36:43 -06:00
Jeff Becker
83b418b636
make fresh docs every time 2020-04-07 13:16:22 -04:00
Jeff Becker
3d20105646
cleanup unused files and add doc target in wrapper makefile 2020-04-07 13:16:22 -04:00
Jeff
d3091cf9fc
Merge pull request #1167 from tewinget/tooling
RouterHive initial PR
2020-04-07 13:13:02 -04:00
Jeff Becker
aaae6f1ba9
tinker with release scripts to hopefully appease the apple gods. 2020-04-06 10:06:36 -04:00
Jeff Becker
1e5a81846e
turn off optimizations for releases 2020-04-03 13:04:41 -04:00
Jeff Becker
7d8101e177
static link on macos 2020-04-03 10:25:24 -04:00
Jeff Becker
9428689939
fix up cpack for macos 2020-04-03 10:14:19 -04:00
Jeff Becker
81dbe1288d
add mac target for release 2020-04-02 11:25:32 -04:00
Jeff Becker
3b26b8b24d
make gitlab pump out 32 bit installers, no lto for builds as that is cursed for now. 2020-04-02 11:08:08 -04:00
Jeff Becker
9d8e3736bf
update ci for windows installers 2020-04-02 11:08:07 -04:00
Jeff Becker
2190da8c81
cpack win32 2020-04-02 11:08:07 -04:00
Ryan Tharp
24cd9ca57d
fix make static when TOOLCHAIN isn't set 2020-03-17 21:54:38 -07:00
Jeff Becker
21026753d1 makefile tweaks for tommyboi 2020-03-03 19:57:09 -05:00
Jeff Becker
a4141617d7 add build infra for toggling hive builds 2020-03-03 19:57:09 -05:00
Jeff Becker
26c1670af7 make it compile 2020-03-03 19:57:09 -05:00
Jason Rhinelander
84186ce0b8 Always pass XSAN to cmake 2020-02-24 14:27:44 -04:00
Jason Rhinelander
561bfe24c0 Add cmake "check" target to run all tests
Renames the cmake Catch2 test target to "catch" (instead of "check") and
adds a "rungtest" for gtest (because the "gtest" target is already taken
by the gtest library itself), and then repurposes the "check" target to
run both test suite binaries.

Also updates the top-level Makefile to do the same thing, except that
there the gtest target is just "gtest" instead of "rungtest".
2020-02-24 14:27:44 -04:00
Jeff
6f182c4b26
Merge pull request #1077 from majestrate/mock-lokid-rpc-2020-02-02
mock lokid for loopback testnet
2020-02-19 12:01:00 -05:00
Jeff Becker
e35d17764a * add path::Path::UniqueEndpointSet_t
* start using check2 for new unit tests
* unit test for path::Path::UniqueEndpointSet_t
2020-02-14 17:41:31 -04:00
Jason Rhinelander
2b93ccb393 Bump libsodium required version to 1.0.18
We use crypto_core_ed25519_scalar_mul which is only exported by
libsodium >= 1.0.18.
2020-02-02 16:38:48 -04:00
jeff
0c971f4e9d use system packages in venv so system packages override 2020-02-02 11:57:59 -05:00
jeff
88e8b7f98c mock lokid for loopback testnet 2020-02-02 11:32:15 -05:00
Jeff Becker
77213d7fa4
add hashpinned curl tarball for static build 2020-01-07 18:14:25 -05:00
Jeff Becker
2ce592e4af
static link with docs 2020-01-07 18:14:25 -05:00
Jeff Becker
a3addb7950
dont static link for release 2020-01-02 12:25:30 -05:00
Jason Rhinelander
54b644e280 Add -DDOWNLOAD_SODIUM to re-enabled dl&build of sodium
Also supported in the Makefile (e.g. `make DOWNLOAD_SODIUM=ON`)

Also DRYs out the Makefile a little.
2019-12-16 20:52:44 -04:00
Jeff Becker
abf9544ddc
make libuv on win32 work 2019-12-11 16:05:40 -05:00
Jeff
fac0b574a2
Merge pull request #930 from majestrate/master-branch-use-release-builds-2019-11-26
make master build release by default
2019-12-03 13:42:58 -05:00
Jeff Becker
fab87128a4
handle case with no git directory 2019-12-03 13:41:20 -05:00
Jeff Becker
ba0fd223d9 reduce number of jobs we put onto the logic thread 2019-11-29 18:45:06 -04:00
Jeff Becker
29f25e0724
make master build release by default 2019-11-26 06:52:55 -05:00
Jeff Becker
9d0d96b70f
get rid of NON_PC_TARGET 2019-11-05 06:45:49 -05:00
Rick V
83c5e9ace4
manually merge #859 2019-10-30 18:02:34 -05:00
Jeff Becker
22dcb0504b
make format 2019-10-28 10:21:57 -04:00
jeff
7d7c6bf38c Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 2019-10-07 06:08:47 -04:00
Michael
07927746b8
Fix makefile location 2019-10-05 17:49:10 +01:00
jeff
32ed821763 Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 2019-10-01 10:51:28 -04:00
Michael
fadedb4a7b
Distinct ios build 2019-09-30 09:59:34 +01:00