-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
44 lines (33 loc) · 1.21 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
cmake_minimum_required(VERSION 2.8.6)
# Enable folder grouping of projects in IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (NOT CMAKE_BUILD_TYPE)
message(WARNING "No build type selected, defaulting to Debug")
set(CMAKE_BUILD_TYPE "Debug")
endif()
project(forker)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack")
set(warning_flags "-Wall \
-Wsign-compare \
-Wclobbered \
-Wempty-body \
-Wignored-qualifiers \
-Wsign-compare \
-Wtype-limits \
-Wunused-but-set-parameter \
-Wconversion \
-Winit-self \
-Wno-unused-function")
set(CMAKE_CXX_FLAGS_DEBUG "${warning_flags} \
-O0 \
-ggdb \
-D_FORTIFY_SOURCE=2")
set(CMAKE_CXX_FLAGS_RELEASE "${warning_flags} \
-O2 \
-DNDEBUG \
-U_FORTIFY_SOURCE")
set(target forker)
add_executable(${target} forker.c)
target_link_libraries(${target}
pthread
)