1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-10-04 15:20:07 +00:00

Vendored LibSodium to make compilation easier

This commit is contained in:
2022-03-13 21:48:09 -05:00
parent e1ce053aa8
commit 76c5899ed5
4 changed files with 12 additions and 4 deletions

View File

@@ -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>")