forked from Chigau/HINO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (39 loc) · 1.5 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
cmake_minimum_required(VERSION 3.12)
project(HINO LANGUAGES CXX)
add_library(g_options INTERFACE)
add_library(g_warnings INTERFACE)
target_compile_features(g_options INTERFACE cxx_std_20)
if(MSVC)
target_compile_options(g_options
INTERFACE -DNOMINMAX
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE
-D_CRT_SECURE_NO_WARNINGS
/permissive-
)
target_compile_options(g_warnings
INTERFACE /W3)
else()
if(ENABLE_ASAN)
target_compile_options(g_options INTERFACE -fsanitize=address)
target_link_libraries(g_options INTERFACE -fsanitize=address)
endif()
if(NOT ${CMAKE_BUILD_TYPE} MATCHES "Release")
target_compile_options(g_warnings
INTERFACE -Wall
# -Werror someday
-Wextra
-Wshadow
-Wunused
-Wold-style-cast
-Woverloaded-virtual
-Wcast-align
-Wnull-dereference)
endif()
target_link_libraries(g_options INTERFACE stdc++fs)
endif()
add_subdirectory(externals/avcpp EXCLUDE_FROM_ALL)
add_subdirectory(externals/catch EXCLUDE_FROM_ALL)
add_subdirectory(src)
enable_testing()
add_subdirectory(tests)