Commit Graph

34 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
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.
2020-04-07 12:38:56 -06:00
Jeff Becker
1fbafab9b2
remove unused file 2019-10-09 09:25:29 -04:00
jeff
58a25602f5 more fixes, implemenmt missing functions 2019-10-09 09:08:38 -04:00
jeff
d80633a975 typo fix 2019-10-09 08:43:25 -04:00
jeff
043bf505bc typofix 2019-10-09 08:42:05 -04:00
jeff
9a49c77647 cast 2019-10-09 08:41:34 -04:00
jeff
bcf792d772 more fixups 2019-10-09 08:40:40 -04:00
jeff
4c584dd2da pass template arguments in, fix typo 2019-10-09 08:16:57 -04:00
jeff
7823fd5084 typofix 2019-10-09 08:13:40 -04:00
jeff
6202baf5b1 fix cmakelists.txt file paths 2019-10-09 08:13:04 -04:00
jeff
c26b67c379 finish wiring up jni shizz 2019-10-08 10:52:01 -04:00
jeff
313898999d initial jni wrapper stuff 2019-10-07 06:05:12 -04:00
Jeff Becker
43cb62af16
fix android compile, have makefile pull in libuv for cmake on android 2019-07-24 11:25:40 -04:00
Jeff Becker
909e0399d6
make android compile 2019-07-24 10:17:54 -04:00
Jeff Becker
3da6551e82
make android compile 2019-04-08 11:54:19 -04:00
Michael
67b5d48095
Replace usage of new/delete with unique_ptr/stack allocation 2019-02-11 16:24:05 +00:00
Michael
85dde7b6b0
Move remaining include/llarp headers to llarp/ 2018-12-12 02:53:02 +00:00
Jeff Becker
7e4d74cbfc
add initial jni stuff for lokinet android. i fucking hate android so god damn much. 2018-11-26 17:46:22 -05:00
Jeff Becker
b323665140
update android jni 2018-11-26 09:31:52 -05:00
Jeff Becker
f1cca956f9
make android compile again 2018-11-06 09:06:09 -05:00
Jeff Becker
ff07fb1184 ensure config 2018-08-06 14:43:23 +10:00
Jeff Becker
fe489b0280 god damnit 2018-08-06 14:24:25 +10:00
Jeff Becker
145d32a051 another attempt 2018-08-06 14:23:08 +10:00
Jeff Becker
c3092bf474 jni fixes 2018-08-06 14:20:00 +10:00
Jeff Becker
3a4ca9badf snytax error 2018-08-06 11:54:24 +10:00
Jeff Becker
a2e339a8ce make it compile 2018-08-06 11:52:46 +10:00
Jeff Becker
464d373f74 update native call 2018-08-06 11:48:15 +10:00
Jeff Becker
f93f40693e fix function name 2018-08-06 10:14:39 +10:00
Jeff Becker
458fd9a388 typo fix 2018-08-06 10:13:08 +10:00
Jeff Becker
b16a76afbe more android 2018-08-06 10:12:19 +10:00
Jeff Becker
d186fea9f5 fix build 2018-08-06 10:07:32 +10:00
Jeff Becker
863ef1f71e more android code 2018-08-06 10:06:00 +10:00
Jeff Becker
b8fb220b3b add jni files 2018-08-06 09:49:23 +10:00