-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathCMakeLists.txt
64 lines (54 loc) · 1.79 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
61
62
63
if(NOT MSVC)
set(CMAKE_CXX_COMPILER_NAMES g++ clang++ icpc c++ cxx)
endif()
project(reckless LANGUAGES CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
################################################################################
# Options
################################################################################
option(RECKLESS_BUILD_EXAMPLES "Build the examples" OFF)
################################################################################
# Add Flags
################################################################################
set(CMAKE_CXX_STANDARD 11)
if(MSVC)
add_compile_options(/W4 /O3)
else()
add_compile_options(-Wall -Wextra -O3 -g)
endif()
################################################################################
# Build Libraries
################################################################################
include_directories("reckless/include")
include_directories("performance_log/include")
set (SRC_LIST
reckless/src/output_buffer.cpp
reckless/src/ntoa.cpp
reckless/src/template_formatter.cpp
reckless/src/writer.cpp
reckless/src/basic_log.cpp
reckless/src/policy_log.cpp
reckless/src/file_writer.cpp
reckless/src/fd_writer.cpp
reckless/src/mpsc_ring_buffer.cpp
reckless/src/platform.cpp
reckless/src/lockless_cv.cpp
)
if(WIN32)
set (SRC_LIST ${SRC_LIST}
reckless/src/spsc_event_win32.cpp
reckless/src/crash_handler_win32.cpp
)
else()
set (SRC_LIST ${SRC_LIST}
reckless/src/crash_handler_unix.cpp
)
endif()
add_library(reckless STATIC ${SRC_LIST})
################################################################################
# Build Examples
################################################################################
if (RECKLESS_BUILD_EXAMPLES)
message (STATUS "Making example applications")
add_subdirectory(examples)
endif ()