46 lines
1.2 KiB
CMake
46 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(weaseldb VERSION 0.0.1)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
endif()
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
toml11
|
|
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
|
|
GIT_TAG be08ba2be2a964edcdb3d3e3ea8d100abc26f286 # v4.4.0
|
|
)
|
|
FetchContent_MakeAvailable(toml11)
|
|
|
|
FetchContent_Declare(
|
|
doctest
|
|
GIT_REPOSITORY https://github.com/doctest/doctest.git
|
|
GIT_TAG 1da23a3e8119ec5cce4f9388e91b065e20bf06f5 # v2.4.12
|
|
)
|
|
FetchContent_MakeAvailable(doctest)
|
|
|
|
include_directories(src)
|
|
|
|
set(SOURCES src/main.cpp src/config.cpp)
|
|
|
|
add_executable(weaseldb ${SOURCES})
|
|
target_link_libraries(weaseldb Threads::Threads toml11::toml11)
|
|
|
|
enable_testing()
|
|
|
|
add_executable(test_arena_allocator tests/test_arena_allocator.cpp)
|
|
target_link_libraries(test_arena_allocator doctest::doctest)
|
|
target_include_directories(test_arena_allocator PRIVATE src)
|
|
|
|
add_test(NAME arena_allocator_tests COMMAND test_arena_allocator)
|