-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (45 loc) · 1.01 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.13...3.25)
project(neo DESCRIPTION "a matrix inspired screensaver")
set(NEO_BIN_DIR "${CMAKE_SOURCE_DIR}/bin"
CACHE STRING "${PROJECT_NAME} binary directory.")
set(NEO_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include"
CACHE STRING "${PROJECT_NAME} include directory.")
set(COMMON_FLAGS
-std=c++2a
)
set(WARNING_FLAGS
-Wall
-Wextra
-Werror
-pedantic
)
set(DEBUG_FLAGS
${COMMON_FLAGS}
${WARNING_FLAGS}
-O0
-g3
-ggdb
-fno-omit-frame-pointer
-fsanitize=address
)
set(RELEASE_FLAGS
${COMMON_FLAGS}
-O2
)
add_compile_options(
"$<$<CONFIG:Release>:${RELEASE_FLAGS}>"
"$<$<CONFIG:Debug>:${DEBUG_FLAGS}>"
)
add_link_options(
"$<$<CONFIG:Debug>:-fsanitize=address>"
)
add_subdirectory(docs)
add_subdirectory(src)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
option(PACKAGE_TESTS "Build Unit Tests" OFF)
if(PACKAGE_TESTS)
enable_testing()
include(GoogleTest)
add_subdirectory(tests)
endif()
endif()