-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (50 loc) · 1.09 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
56
57
58
59
60
cmake_minimum_required(VERSION 3.10)
project(assignment-test)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(DEBUG_BUILD "Build in debug mode" OFF)
# general settings
set(BINARY assignment-test)
set(BIN_DIR ${CMAKE_SOURCE_DIR}/out)
set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third-party)
# add cmocka
include(${THIRD_PARTY_DIR}/FetchCMocka.cmake)
# include dirs
set(INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/src
${THIRD_PARTY_DIR}/cmocka/include
)
# libraries
set(LIBRARIES
cmocka-static
)
# options for bin
if(${DEBUG_BUILD})
set(BIN_COMPILE_OPTIONS
-DDEBUG_BUILD
-O0
-g
)
else()
set(BIN_COMPILE_OPTIONS
-OFast
)
endif()
set(BIN_COMPILE_OPTIONS
${BIN_COMPILE_OPTIONS}
-std=c17
-Wall
-Werror
-Wextra
-Wpedantic
-Wconversion
-Wcast-align
-Wno-unused # TODO reintroduce this and make UNUSED macro available?
-Wshadow
-Wformat-security
-Wmissing-prototypes
-Wmissing-format-attribute
-D_ASSIGNMENT_RUNNING_TESTS
)
include(submissions/wraps.cmake)
include(submissions/submission.cmake)
add_subdirectory(src)