blob: ac84f42bb652707de13827d1d74e1101963cf390 (
plain)
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
|
file(GLOB SOURCES
main.cpp
string_matrix.test.cpp
${CMAKE_SOURCE_DIR}/src/engine/data/vector2.cpp
${CMAKE_SOURCE_DIR}/src/engine/data/bounds.cpp
${CMAKE_SOURCE_DIR}/src/engine/graphics/string_matrix.cpp
)
add_executable(tests ${SOURCES})
target_compile_features(tests PUBLIC cxx_std_20)
target_compile_options(
tests
PRIVATE
-Wall -Wextra -Wpedantic -Wshadow
-Wold-style-cast -Wcast-align -Wno-unused
-Wconversion -Wcast-qual -Wctor-dtor-privacy
-Wdisabled-optimization -Wformat=2 -Winit-self
-Wmissing-declarations -Wmissing-include-dirs
-Woverloaded-virtual -Wredundant-decls
-Wsign-conversion -Wsign-promo
-Wstrict-overflow=5 -Wswitch-default
-Wundef -Werror
-pedantic -fsanitize=address -fno-exceptions
)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(
tests
PRIVATE
-Wlogical-op -Wnoexcept -Wstrict-null-sentinel
)
endif()
target_include_directories(
tests
PRIVATE
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/test"
)
target_link_libraries(tests GSL doctest)
target_link_options(tests PRIVATE -fsanitize=address)
|