Commit Graph

5812 Commits (c5faa8692643e970851a52c710365facf0203587)
 

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).
4 years ago
Jason Rhinelander ab4ee954b9 Remove DEBIAN option
This hasn't been used in a long time; the debian packaging lives in
separate branches instead.
4 years ago
Jason Rhinelander a45bec7c4f Removed RPI definition
This was a long-obsolete fix for things that don't matter anymore.
4 years ago
Jason Rhinelander 26ecf23ad8 Silence various warnings 4 years ago
Jason Rhinelander e03dfc751c Remove crypto_noop
It isn't used anywhere, and has bitrotted (it is marked final, but is
missing some required abstract method instances).
4 years ago
Jason Rhinelander 5087ba2364 Regex fix 4 years ago
Jason Rhinelander bc4573c447 Disable empty string SockAddr throw test
The code intentionally no longer throws and handles this as a special
case (resulting in an empty SockAddr).
4 years ago
Jason Rhinelander 0de3a5f11d
Merge pull request #1231 from majestrate/libuv-cmake-submodule-2020-04-20
add libcurl and libuv to cmake out of makefile
4 years ago
Jeff Becker 06348ced47 fix typo in makefile 4 years ago
Jeff Becker bd19dd95e0 revert makefile and travis 4 years ago
Jeff Becker 701175a873 download sodium 4 years ago
Jeff Becker 8497c8b1d4 more travis tweaks 4 years ago
Jeff Becker 9bd537333b fix travis 4 years ago
Jeff Becker 64157d5d44 track libcurl and libuv with cmake, add libuv submodule 4 years ago
Jeff d0a3d6beae
Merge pull request #1270 from majestrate/gpl3-reliecense-2020-05-15
relicense to GPL3
4 years ago
Jeff cc9830e763
update license preamble
change license preamble to exclude control panel text
4 years ago
Jason Rhinelander d04576a2c6
Merge pull request #1269 from majestrate/make-unit-tests-pass-05-15-20
Make unit tests and CI pass
4 years ago
Jeff Becker fc5b28b66f
const correctness 4 years ago
Jeff Becker d91d9152de
change xcode versions in travis to try and make travis stop sucking 4 years ago
Jeff Becker 57a737290c
relicense to GPL3 4 years ago
Jeff Becker 04c542b03f
clean up makefile targets to remove some old unused ones 4 years ago
Jeff Becker 3ac2a3defa
add dist source tarball generation and bundle it with gitlab static release 4 years ago
Jeff Becker 6ea6a4bd25
use -dev package for python in travis 4 years ago
Jeff Becker 39b32a9ccc
move check for std::filesystem and std::optional down 4 years ago
Jeff Becker abc1f67430
check for std::optional as macos can be broke af sometimes 4 years ago
Jeff Becker 5a24d2deef
add check for std::filesystem 4 years ago
Jeff Becker 1072d9b505
detect travis using environmental vars 4 years ago
Jeff Becker e56faba23d
make format 4 years ago
Jeff Becker a7d616843f
add shitty check for running in travis with workarounds because god is dead and travis-ci fucking sucks. 4 years ago
Jeff Becker 1780e86faa
fix up unit tests, make them all pass 4 years ago
Jeff Becker f04407f183
use only 1 uv_async_t for event loop wakeups
flush logic calls in there too as this was causing unit tests to hang
4 years ago
Jeff ad9edc4ecf
Merge pull request #1266 from majestrate/issue-1264-fix-setting-upstream-dns-2020-05-14
default to port 53 in dns section entries
4 years ago
Jeff f7fbfc1b67
Merge pull request #1267 from majestrate/respect-keyfile-in-config-2020-05-14
keyfile was being initialized before being set by configure call.
4 years ago
Stephen Shelton ed31cdaacf
Cosmetic fixes 4 years ago
Jeff Becker 555b9721ce
keyfile was being initialized before being set by configure call.
this made it so that snapps always use ephemeral keys.
this fixes this.
4 years ago
Jeff Becker 09a356a8a4
dont use static local lambda 4 years ago
Jeff Becker edb5c9e873
keyfile was being initialized before being set by configure call.
this made it so that snapps always use ephemeral keys.
this fixes this.
4 years ago
Jeff Becker ebed21c392
DRY 4 years ago
Jeff Becker 3753dfbddb
IpAddresses in dns section config were not defaulting to port 53 when no port was provided.
Fixes #1264
4 years ago
Jeff 25125511e3
Merge pull request #1265 from jagerman/missmatch
Miss Match & ours/theirs
4 years ago
Jason Rhinelander 6686668b48 Annotate netid mismatch message with (theirs)/(ours)
Every time I see this I don't know which one is wrong.  This helps.
4 years ago
Jason Rhinelander dccc663f31 Miss Match demands her name be removed from the code
(i.e. fix speeling mistack: missmatch -> mismatch)
4 years ago
Jeff e6a85d7176
Merge pull request #1263 from jagerman/c++17-niceties
C++17 niceties
4 years ago
Jason Rhinelander e470a6d73e C++17 niceties
- class template argument deduction lets us write `std::unique_lock
  foo{mutex}` instead of `std::unique_lock<mutex_type> foo{mutex}` which
  makes the `unique_lock` and `shared_lock` functions unnecessary.

- Replace GNU-specific warn_unused_result attribute with C++17-standard
  [[nodiscard]]

- Remove pre-C++17 workaround code for fold expressions, void_t
4 years ago
Jeff a5b09c47e1
Merge pull request #1262 from notlesh/bandaids-for-sockaddr-refactor-2020-05-11
Bandaids for sockaddr refactor 2020 05 11
4 years ago
Stephen Shelton 4dd4327f36
IpAddress::toString() support for IPv6 4 years ago
Stephen Shelton 043f993e41
Return stream in operator<<(stream, IpAddress) 4 years ago
Stephen Shelton 0a40892867
Implement SockAddr operator<() and operator==() 4 years ago
Stephen Shelton 1c7d57f207
Don't forget to return 4 years ago
Stephen Shelton c0f58c8159
Properly read in ExitInfo's address 4 years ago