-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
50 lines (40 loc) · 986 Bytes
/
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
cmake_minimum_required(VERSION 3.30)
project(palladium VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose build type (Debug, Release.)" FORCE)
endif()
add_compile_options(
-Wall
-Wextra
-Wpedantic
)
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(
-Wshadow
-Wnon-virtual-dtor
-Wold-style-cast
-Wcast-align
-Woverloaded-virtual
-Wnull-dereference
-Wdouble-promotion
-Wformat=2
-fsanitize=address
-g
)
link_libraries(-fsanitize=address)
endif()
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options(
-O3
)
endif()
add_executable("${CMAKE_PROJECT_NAME}" $<TARGET_OBJECTS:OBJECT_LIB>)
add_subdirectory(src)
enable_testing()
add_subdirectory(tests)