-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
98 lines (77 loc) · 2.35 KB
/
Copy pathCMakeLists.txt
File metadata and controls
98 lines (77 loc) · 2.35 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
cmake_minimum_required(VERSION 3.29)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(FREYR_ASSERTIONS
"Enables freyr assertions for debugging purposes (Always off on Release builds)" OFF)
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
option(FREYR_PROFILING "Enables perfetto profiling" ON)
option(FREYR_BUILD_EXAMPLES "Build freyr examples" ON)
option(FREYR_BUILD_TESTS "Build freyr tests" ON)
option(FREYR_BUILD_BENCHMARKS "Build freyr benchmarks" ON)
else()
option(FREYR_PROFILING "Enables perfetto profiling" OFF)
option(FREYR_BUILD_EXAMPLES "Build freyr examples" OFF)
option(FREYR_BUILD_TESTS "Build freyr tests" OFF)
option(FREYR_BUILD_BENCHMARKS "Build freyr benchmarks" OFF)
endif ()
include(FetchContent)
fetchcontent_declare(
skirnir
GIT_REPOSITORY "https://github.com/gilmar-sales/Skirnir.git"
GIT_TAG "v0.16.1"
GIT_SHALLOW TRUE
)
fetchcontent_makeavailable(skirnir)
if (FREYR_PROFILING)
add_subdirectory(vendor/perfetto)
endif (FREYR_PROFILING)
project(freyr LANGUAGES C CXX VERSION 0.26.6)
if (FREYR_BUILD_EXAMPLES)
add_subdirectory(examples)
endif (FREYR_BUILD_EXAMPLES)
if (FREYR_BUILD_TESTS)
enable_testing()
include(CTest)
add_subdirectory(test)
endif (FREYR_BUILD_TESTS)
if (FREYR_BUILD_BENCHMARKS)
add_subdirectory(benchmarks)
endif (FREYR_BUILD_BENCHMARKS)
file(GLOB_RECURSE FREYR_SOURCE
src/**.cpp
include/**.hpp
)
add_library(freyr ${FREYR_SOURCE})
add_library(freyr::freyr ALIAS freyr)
target_link_libraries(freyr PUBLIC skirnir)
target_include_directories(freyr PUBLIC
$<BUILD_INTERFACE:${freyr_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_compile_features(freyr PUBLIC cxx_std_23)
if (FREYR_ASSERTIONS)
target_compile_definitions(freyr PUBLIC FREYR_ASSERTIONS=1)
endif (FREYR_ASSERTIONS)
if (FREYR_PROFILING)
target_compile_definitions(freyr PUBLIC FREYR_PROFILING=1)
target_link_libraries(freyr PUBLIC perfetto)
endif (FREYR_PROFILING)
file(GLOB_RECURSE FREYR_TYPES
src/Types/*.hpp
)
target_precompile_headers(
freyr
PUBLIC
<cstdint>
<bitset>
<functional>
<list>
<vector>
<mutex>
<memory>
<thread>
<type_traits>
<condition_variable>
<utility>
<Freyr/Pch.hpp>
)