mirror of
https://github.com/CPunch/Laika.git
synced 2024-10-05 17:12:48 +00:00
CPunch
dd173ee422
- LAIKAPKT_HANDSHAKE_REQ now only sends the bot's pub key a shared key is generated using the other peer's pub key, allowing for fully encrypted packet bodies, (packet ID is left in plain-text) - laikaS_startOutPacket(), laikaS_endOutPacket(), laikaS_startInPacket() & laikaS_endInPacket() have been added. - laikaS_setSecure() has been added to turn on/off encrypted packets. - genKey now generates kx keypairs - major refactoring for relevant packet handlers - variadic packets have been temporarily disabled
42 lines
1.4 KiB
CMake
42 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.10)
|
|
|
|
set(LIB_INCLUDEDIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
|
|
# DO NOT USE THESE KEYS, TESTING ONLY
|
|
if(NOT LAIKA_PUBKEY)
|
|
set(LAIKA_PUBKEY "40d5534aca77d1f5ec2bbe79dd9d0f52a78148918f95814404cefe97c34c5c27")
|
|
endif ()
|
|
|
|
if(NOT LAIKA_PRIVKEY)
|
|
set(LAIKA_PRIVKEY "90305aa77023d1c1e03265c3b6af046eb58d6ec8ba650b0dffed01379feab8cc")
|
|
endif ()
|
|
|
|
# version details
|
|
set(LAIKA_VERSION_MAJOR 0)
|
|
set(LAIKA_VERSION_MINOR 0)
|
|
|
|
project(LaikaLib VERSION ${LAIKA_VERSION_MAJOR}.${LAIKA_VERSION_MINOR})
|
|
|
|
message(STATUS "Building config file")
|
|
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)
|
|
find_package(Sodium)
|
|
|
|
# compile LaikaLib library
|
|
file(GLOB_RECURSE LIBSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c)
|
|
add_library(LaikaLib STATIC ${LIBSOURCE})
|
|
target_link_libraries(LaikaLib PRIVATE ${sodium_LIBRARY_RELEASE})
|
|
|
|
# add the version definitions and the 'DEBUG' preprocessor definition if we're compiling as Debug
|
|
target_compile_definitions(LaikaLib PUBLIC "$<$<CONFIG:Debug>:DEBUG>")
|
|
|
|
# add include directory
|
|
target_include_directories(LaikaLib PUBLIC ${LIB_INCLUDEDIR} ${sodium_INCLUDE_DIR})
|
|
|
|
# set library name
|
|
set_target_properties(LaikaLib PROPERTIES OUTPUT_NAME laika-${LAIKA_VERSION_MAJOR}.${LAIKA_VERSION_MINOR})
|