-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
56 lines (45 loc) · 1.42 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
CHECK_FUNCTION_EXISTS(lseek64 HAVE_LSEEK64)
IF(HAVE_LSEEK64)
ADD_DEFINITIONS("-DHAVE_LSEEK64")
ENDIF()
CHECK_FUNCTION_EXISTS(powl HAVE_POWL)
IF(NOT HAVE_POWL)
ADD_DEFINITIONS("-Dpowl=pow")
ENDIF()
IF(DEFINED ENV{Q4M_SYNC_METHOD})
SET(SYNC_METHOD $ENV{Q4M_SYNC_METHOD})
ELSE()
IF(APPLE)
SET(SYNC_METHOD "FCNTL")
ELSE()
CHECK_FUNCTION_EXISTS(fdatasync HAVE_FDATASYNC)
IF(HAVE_FDATASYNC)
SET(SYNC_METHOD "FDATASYNC")
ELSE()
SET(SYNC_METHOD "FSYNC")
ENDIF()
ENDIF()
ENDIF()
IF(SYNC_METHOD MATCHES "SKIP")
ADD_DEFINITIONS("-DFDATASYNC_SKIP")
ELSE()
ADD_DEFINITIONS("-DFDATASYNC_USE_${SYNC_METHOD}")
ENDIF()
# FIXME port the logic from configure.in
CHECK_INCLUDE_FILES(limits.h HAVE_LIMIT_H)
CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_PHTREAD_MUTEX_TIMEDLOCK)
ADD_DEFINITIONS("-DQ4M_USE_MT_PWRITE=1")
IF(DEFINED ENV{Q4M_USE_MMAP})
ADD_DEFINITIONS("-DQ4M_USE_MMAP=1")
ENDIF()
IF(DEFINED ENV{Q4M_DELETE_METHOD})
SET(DELETE_METHOD $ENV{Q4M_DELETE_METHOD})
ELSE()
SET(DELETE_METHOD "Q4M_DELETE_SERIAL_PWRITE")
ENDIF()
ADD_DEFINITIONS("-DQ4M_VERSION_HEX=0x0009")
ADD_DEFINITIONS("-DQ4M_USING_CMAKE")
SET(Q4M_SOURCES src/queue_cond.cc src/ha_queue.cc)
INCLUDE_DIRECTORIES(SYSTEM ${BOOST_PATCHES_DIR} ${BOOST_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/q4m/src)
MYSQL_ADD_PLUGIN(queue ${Q4M_SOURCES} STORAGE_ENGINE MODULE_ONLY MODULE_OUTPUT_NAME "libqueue_engine")