Commit Graph

34 Commits (36193564065f0a6c199e79438b8783de7bfd9f96)

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
Stephen Shelton 273270916e
The Great Wall of Blame
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.

Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
4 years ago
Jeff Becker 1fbafab9b2
remove unused file 5 years ago
jeff 58a25602f5 more fixes, implemenmt missing functions 5 years ago
jeff d80633a975 typo fix 5 years ago
jeff 043bf505bc typofix 5 years ago
jeff 9a49c77647 cast 5 years ago
jeff bcf792d772 more fixups 5 years ago
jeff 4c584dd2da pass template arguments in, fix typo 5 years ago
jeff 7823fd5084 typofix 5 years ago
jeff 6202baf5b1 fix cmakelists.txt file paths 5 years ago
jeff c26b67c379 finish wiring up jni shizz 5 years ago
jeff 313898999d initial jni wrapper stuff 5 years ago
Jeff Becker 43cb62af16
fix android compile, have makefile pull in libuv for cmake on android 5 years ago
Jeff Becker 909e0399d6
make android compile 5 years ago
Jeff Becker 3da6551e82
make android compile 5 years ago
Michael 67b5d48095
Replace usage of new/delete with unique_ptr/stack allocation 5 years ago
Michael 85dde7b6b0
Move remaining include/llarp headers to llarp/ 6 years ago
Jeff Becker 7e4d74cbfc
add initial jni stuff for lokinet android. i fucking hate android so god damn much. 6 years ago
Jeff Becker b323665140
update android jni 6 years ago
Jeff Becker f1cca956f9
make android compile again 6 years ago
Jeff Becker ff07fb1184 ensure config 6 years ago
Jeff Becker fe489b0280 god damnit 6 years ago
Jeff Becker 145d32a051 another attempt 6 years ago
Jeff Becker c3092bf474 jni fixes 6 years ago
Jeff Becker 3a4ca9badf snytax error 6 years ago
Jeff Becker a2e339a8ce make it compile 6 years ago
Jeff Becker 464d373f74 update native call 6 years ago
Jeff Becker f93f40693e fix function name 6 years ago
Jeff Becker 458fd9a388 typo fix 6 years ago
Jeff Becker b16a76afbe more android 6 years ago
Jeff Becker d186fea9f5 fix build 6 years ago
Jeff Becker 863ef1f71e more android code 6 years ago
Jeff Becker b8fb220b3b add jni files 6 years ago