-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
40 lines (34 loc) · 1.14 KB
/
CMakeLists.txt
File metadata and controls
40 lines (34 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 3.21)
project(rift)
if (NOT TARGET fmt OR NOT TARGET GeodeResult)
if (NOT COMMAND CPMAddPackage)
include(cmake/CPM.cmake)
endif ()
if (NOT TARGET fmt)
CPMAddPackage("gh:fmtlib/fmt#12.1.0")
endif ()
if (NOT TARGET GeodeResult)
CPMAddPackage("gh:geode-sdk/result@1.3.5")
endif ()
endif ()
set(CMAKE_CXX_STANDARD 20)
file(GLOB_RECURSE RIFT_SOURCES "src/*.cpp")
add_library(rift STATIC ${RIFT_SOURCES})
target_include_directories(rift PUBLIC include)
target_link_libraries(rift fmt GeodeResult)
# Allows an easier conversion of rift::Value to JSON and vice versa
if (RIFT_INCLUDE_MATJSON OR TARGET mat-json)
if (NOT TARGET mat-json)
CPMAddPackage("gh:geode-sdk/json@3.2.2")
endif ()
target_compile_definitions(rift PUBLIC RIFT_INCLUDE_MATJSON)
target_link_libraries(rift mat-json)
endif ()
# Tests
option(RIFT_BUILD_TESTS "Build tests" OFF)
option(RIFT_BUILD_BENCHMARKS "Build benchmarks" OFF)
option(RIFT_BUILD_FUZZERS "Build fuzzers" OFF)
if (RIFT_BUILD_TESTS)
add_executable(rift_test test/main.cpp)
target_link_libraries(rift_test rift)
endif ()