mirror of
https://github.com/CPunch/Laika.git
synced 2024-12-27 05:10:06 +00:00
Vendored LibSodium to make compilation easier
This commit is contained in:
parent
e1ce053aa8
commit
76c5899ed5
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "cmake-modules/libsodium"]
|
||||
path = cmake-modules/libsodium
|
||||
url = https://github.com/robinlinden/libsodium-cmake.git
|
@ -32,6 +32,12 @@ if(RAWCMAKEBUILDTYPE STREQUAL "debug")
|
||||
add_link_options(-fsanitize=address)
|
||||
endif ()
|
||||
|
||||
# include libsodium
|
||||
set(SODIUM_DISABLE_TESTS ON)
|
||||
set(SODIUM_MINIMAL ON)
|
||||
set(SODIUM_STATIC ON)
|
||||
add_subdirectory(cmake-modules/libsodium)
|
||||
|
||||
# compile laikalib, tools, cnc & bot
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(tools)
|
||||
|
1
cmake-modules/libsodium
Submodule
1
cmake-modules/libsodium
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a606dc79ed346b7c9db6df9ceedd1c3361afcf95
|
@ -14,6 +14,7 @@ endif ()
|
||||
# version details
|
||||
set(LAIKA_VERSION_MAJOR 0)
|
||||
set(LAIKA_VERSION_MINOR 1)
|
||||
set(SODIUM_DISABLE_TESTS ON)
|
||||
|
||||
project(LaikaLib VERSION ${LAIKA_VERSION_MAJOR}.${LAIKA_VERSION_MINOR})
|
||||
|
||||
@ -23,13 +24,10 @@ configure_file(${LIB_INCLUDEDIR}/lconfig.h.in ${LIB_INCLUDEDIR}/lconfig.h)
|
||||
# Put CMake targets (ALL_BUILD/ZERO_CHECK) into a folder
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
set(sodium_USE_STATIC_LIBS ON)
|
||||
find_package(Sodium)
|
||||
|
||||
# compile LaikaLib library
|
||||
file(GLOB_RECURSE LIBSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c ${CMAKE_CURRENT_SOURCE_DIR}/vendor/**.c)
|
||||
add_library(LaikaLib STATIC ${LIBSOURCE})
|
||||
target_link_libraries(LaikaLib PRIVATE ${sodium_LIBRARY_RELEASE})
|
||||
target_link_libraries(LaikaLib PRIVATE sodium)
|
||||
|
||||
# add the version definitions and the 'DEBUG' preprocessor definition if we're compiling as Debug
|
||||
target_compile_definitions(LaikaLib PUBLIC "$<$<CONFIG:Debug>:DEBUG>")
|
||||
|
Loading…
Reference in New Issue
Block a user