-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
39 lines (30 loc) · 1.2 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
cmake_minimum_required(VERSION 2.8)
project(llb)
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)
set(AUTHOR "Andrea Giacomo Baldan")
set(LICENSE "BSD2 license")
# Executable
add_executable(llb ${SOURCES} include/llb_internal.h)
if (APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/opt/openssl/include")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/opt/openssl/include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/opt/openssl/lib")
endif (APPLE)
if (DEBUG)
message(STATUS "Configuring build for debug")
TARGET_LINK_LIBRARIES(llb 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(llb pthread ssl crypto)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused -Werror -pedantic \
-Wno-unused-result -std=c11 -O3")
endif (DEBUG)