-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
43 lines (35 loc) · 1.32 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
cmake_minimum_required(VERSION 3.10)
project(rask)
if (APPLE)
include_directories(/usr/local/include)
find_library(
CONFUSE_LIB
NAMES confuse libconfuse
HINTS /usr/local/lib
NO_DEFAULT_PATH
)
message(STATUS "CONFUSE_LIB: [${CONFUSE_LIB}]")
endif()
add_library(logging srclib/logging/logging.c)
add_library(string srclib/string/string.c)
add_library(socket srclib/socket/socket.c)
target_link_libraries(socket logging)
add_library(execute_scripts srclib/execute_scripts/execute_scripts.c)
target_link_libraries(execute_scripts logging)
add_library(dynamic_buffer srclib/dynamic_buffer/dynamic_buffer.c)
target_link_libraries(dynamic_buffer logging)
add_executable(rask src/server.c src/connection_handler.c srclib/picohttpparser/picohttpparser.c src/thread_pool.c src/config_parser.c src/request.c src/response.c)
target_link_libraries(rask logging)
target_link_libraries(rask string)
target_link_libraries(rask socket)
target_link_libraries(rask execute_scripts)
target_link_libraries(rask dynamic_buffer)
find_package(Threads REQUIRED)
target_link_libraries(rask ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(rask m)
if (APPLE)
target_link_libraries(rask ${CONFUSE_LIB})
else()
target_link_libraries(rask confuse)
endif()
target_compile_options(rask PRIVATE -Wall -Wextra -pedantic -O3)