-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (24 loc) · 1.1 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
cmake_minimum_required (VERSION 3.5.1)
project(KeyValueStorage)
include_directories(include)
file(GLOB sources "src/*.c")
list(REMOVE_ITEM sources "${CMAKE_CURRENT_SOURCE_DIR}/src/node.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/hashtable.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/thpool.c")
add_library(node "src/node.c")
add_library(hashtable "src/hashtable.c")
add_library(thpool "src/thpool.c")
add_executable(main ${sources})
add_executable(node_test "test/node_test.c")
add_executable(hashtable_test "test/hash_test.c")
add_executable(thpool_rwlock_test "test/thpool_rwlock_test.c")
add_executable(client_test "test/client_test.c" "src/client.c" "src/server.c")
target_link_libraries(hashtable node)
target_link_libraries(thpool pthread)
target_link_libraries(main hashtable thpool)
target_link_libraries(node_test node)
target_link_libraries(hashtable_test hashtable)
target_link_libraries(thpool_rwlock_test thpool)
target_link_libraries(client_test thpool hashtable)
target_compile_definitions(client_test PUBLIC CLIENT_TEST)
target_compile_options(client_test PRIVATE "-g")