From 249508632b0367a1a0cbcb64cf5abf3c3eccbc47 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 25 Apr 2018 13:11:46 +0200 Subject: Add lz4 to the build --- .gitmodules | 3 +++ main/src/main/cpp/CMakeLists.txt | 4 +++- main/src/main/cpp/lz4 | 1 + main/src/main/cpp/lz4.cmake | 7 +++++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 160000 main/src/main/cpp/lz4 create mode 100644 main/src/main/cpp/lz4.cmake diff --git a/.gitmodules b/.gitmodules index 522c88a7..7b202530 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "main/src/main/cpp/asio"] path = main/src/main/cpp/asio url = ../../chriskohlhoff/asio/ +[submodule "main/src/main/cpp/lz4"] + path = main/src/main/cpp/lz4 + url = ../../lz4/lz4.git diff --git a/main/src/main/cpp/CMakeLists.txt b/main/src/main/cpp/CMakeLists.txt index bdeff5bf..2b776f6b 100644 --- a/main/src/main/cpp/CMakeLists.txt +++ b/main/src/main/cpp/CMakeLists.txt @@ -16,6 +16,7 @@ OPTION(ENABLE_TESTING "" OFF) #add_subdirectory(lzo) include(tools.cmake) include(lzo.cmake) +include(lz4.cmake) include(openssl.cmake) # Super hacky way to determine flavour @@ -61,13 +62,14 @@ if (NOT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} MATCHES "build/intermediates/cmake/.*n target_compile_definitions(ovpn3 PRIVATE -DHAVE_CONFIG_H -DHAVE_LZO + -DHAVE_LZ4 -DASIO_STANDALONE -DUSE_ASIO -DUSE_MBEDTLS -DGIT_VERSION_STRING=\"${OPENVPN3_GIT}\" -DNO_ROUTE_EXCLUDE_EMULATION ) - target_link_libraries(ovpn3 mbedtls mbedx509 mbedcrypto lzo) + target_link_libraries(ovpn3 mbedtls mbedx509 mbedcrypto lzo lz4) else() message ("Not budiling OpenVPN for output dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") endif() diff --git a/main/src/main/cpp/lz4 b/main/src/main/cpp/lz4 new file mode 160000 index 00000000..cadf5cd5 --- /dev/null +++ b/main/src/main/cpp/lz4 @@ -0,0 +1 @@ +Subproject commit cadf5cd5f9289a9dc8bc60d2357452573908e729 diff --git a/main/src/main/cpp/lz4.cmake b/main/src/main/cpp/lz4.cmake new file mode 100644 index 00000000..d5e618c6 --- /dev/null +++ b/main/src/main/cpp/lz4.cmake @@ -0,0 +1,7 @@ +set(lz4_srcs + lz4.c + ) + +PREPEND(lz4_src_with_path "lz4/lib/" ${lz4_srcs}) +add_library(lz4 ${lz4_src_with_path}) +target_include_directories(lz4 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/lz4/lib") -- cgit v1.2.3