2023-10-06 03:13:46 +00:00
|
|
|
cmake_minimum_required(VERSION 3.25)
|
|
|
|
project(klib CXX)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2023-10-06 06:08:35 +00:00
|
|
|
if(MSVC)
|
|
|
|
add_compile_options("/W4" "$<$<CONFIG:RELEASE>:/O2>")
|
|
|
|
else()
|
|
|
|
add_compile_options("-Wall" "-Wextra" "-Werror" "$<$<CONFIG:RELEASE>:-O3>")
|
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
add_compile_options("-stdlib=libc++")
|
|
|
|
else()
|
|
|
|
# nothing special for gcc at the moment
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
add_compile_options("-DDESKTOP_BUILD")
|
2023-10-06 03:13:46 +00:00
|
|
|
|
|
|
|
add_library(klib STATIC
|
|
|
|
Arena.cc
|
2023-10-09 17:24:40 +00:00
|
|
|
Buffer.cc
|
2023-10-06 06:08:35 +00:00
|
|
|
TLV.cc
|
2023-10-06 06:17:09 +00:00
|
|
|
Dictionary.cc)
|
2023-10-06 03:13:46 +00:00
|
|
|
|
2023-10-06 06:17:09 +00:00
|
|
|
add_executable(tlv_test tlvTest.cc)
|
2023-10-06 03:13:46 +00:00
|
|
|
target_link_libraries(tlv_test klib)
|
2023-10-06 06:08:35 +00:00
|
|
|
|
2023-10-06 06:17:09 +00:00
|
|
|
add_executable(dictionary_test dictionaryTest.cc)
|
|
|
|
target_link_libraries(dictionary_test klib)
|
2023-10-06 06:08:35 +00:00
|
|
|
|
2023-10-09 17:24:40 +00:00
|
|
|
add_executable(buffer_test bufferTest.cc)
|
|
|
|
target_link_libraries(buffer_test klib)
|
|
|
|
|