-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (23 loc) · 896 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
cmake_minimum_required(VERSION 2.8)
project(zen)
set (VERSION 0.0.6)
OPTION(DEBUG "add debug flags" OFF)
add_definitions("-D_DEFAULT_SOURCE")
find_package(OpenSSL REQUIRED)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
include_directories(include)
file(GLOB SOURCES src/*.c)
# Executable
add_executable(zen ${SOURCES} include/zen_internal.h)
if (DEBUG)
message(STATUS "Configuring build for debug")
TARGET_LINK_LIBRARIES(zen pthread ssl crypto)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused -Werror -pedantic \
-Wno-unused-result -std=c11 -ggdb -fsanitize=address \
-fsanitize=undefined -fno-omit-frame-pointer -pg")
else (DEBUG)
message(STATUS "Configuring build for production")
TARGET_LINK_LIBRARIES(zen pthread ssl crypto)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused -Werror -pedantic \
-Wno-unused-result -std=c11 -O3")
endif (DEBUG)