-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
66 lines (58 loc) · 2.07 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
64
65
66
cmake_minimum_required(VERSION 2.8.12)
project(simple-dict-server C)
SET(CMAKE_BUILD_TYPE "Release")
add_definitions(-DLISTEN_ON_IPV6)
#add_definitions(-DDEBUG)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions("-DCPUBIT64")
ELSE()
add_definitions("-DCPUBIT32")
ENDIF()
if(DEFINED ENV{DEBUG})
message("compile in debug mode")
add_definitions(-DDEBUG)
endif()
if(DEFINED ENV{DICTKEYSZ})
message("custom dict key size: $ENV{DICTKEYSZ}")
add_definitions(-DDICTKEYSZ=$ENV{DICTKEYSZ})
endif()
if(DEFINED ENV{DICTDATSZ})
message("custom dict data size: $ENV{DICTDATSZ}")
add_definitions(-DDICTDATSZ=$ENV{DICTDATSZ})
endif()
if(DEFINED ENV{CRYPTO_SUMTABLE})
message("custom suntable: $ENV{CRYPTO_SUMTABLE}")
add_definitions(-DCRYPTO_SUMTABLE=$ENV{CRYPTO_SUMTABLE})
endif()
if(DEFINED ENV{THREADCNT})
message("custom suntable: $ENV{THREADCNT}")
add_definitions(-DTHREADCNT=$ENV{THREADCNT})
endif()
if(DEFINED ENV{MAXWAITSEC})
message("custom suntable: $ENV{MAXWAITSEC}")
add_definitions(-DMAXWAITSEC=$ENV{MAXWAITSEC})
endif()
if(DEFINED ENV{DICTPOOLBIT})
message("custom suntable: $ENV{DICTPOOLBIT}")
add_definitions(-DDICTPOOLBIT=$ENV{DICTPOOLBIT})
endif()
include_directories("/usr/local/include")
link_directories("/usr/local/lib")
#在编译选项中加入c99支持
add_compile_options(-std=gnu99)
message(STATUS "optional:-std=gnu99")
add_executable(simple-dict-server server.c)
add_executable(simple-dict-client client.c)
add_executable(cfgwriter cfgwriter.c)
add_executable(printall printall.c)
#add_executable(migrate migrate.c)
#add_executable(migratenew migratenew.c)
target_link_libraries(simple-dict-server scrypto libspb.a pthread)
target_link_libraries(simple-dict-client scrypto libspb.a pthread)
target_link_libraries(cfgwriter libspb.a)
target_link_libraries(printall libspb.a)
#target_link_libraries(migrate libspb.a)
#target_link_libraries(migratenew libspb.a)
INSTALL(TARGETS simple-dict-server RUNTIME DESTINATION bin)
#INSTALL(TARGETS simple-dict-client RUNTIME DESTINATION bin)
#INSTALL(TARGETS cfgwriter RUNTIME DESTINATION bin)