summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--main/src/main/cpp/CMakeLists.txt4
m---------main/src/main/cpp/lz40
-rw-r--r--main/src/main/cpp/lz4.cmake7
4 files changed, 13 insertions, 1 deletions
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
+Subproject cadf5cd5f9289a9dc8bc60d2357452573908e72
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")