blob: da8d0f41d8fd2aef1e5229011d2d702d018a9573 (
plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
## generate log_code.cc, log_print.cc, log_header.cc
set_source_files_properties(
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
"${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
PROPERTIES GENERATED TRUE)
add_executable(logformat logformat.cc)
target_link_libraries(logformat ${LIBTOKUPORTABILITY}_static)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_print.cc"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
COMMAND $<TARGET_FILE:logformat> .
DEPENDS logformat
)
add_custom_target(
generate_log_code
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc" "${CMAKE_CURRENT_BINARY_DIR}/log_print.cc" "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
)
set(FT_SOURCES
background_job_manager
block_allocator
block_table
bndata
cachetable
checkpoint
compress
dbufio
fifo
ft
ft-cachetable-wrappers
ft-flusher
ft-hot-flusher
ftloader
ftloader-callback
ft_msg
ft_node-serialize
ft-node-deserialize
ft-ops
ft-serialize
ft-test-helpers
ft-verify
key
leafentry
le-cursor
logcursor
logfilemgr
logger
log_upgrade
minicron
pqueue
queue
quicklz
recover
rollback
rollback-apply
rollback-ct-callbacks
rollback_log_node_cache
roll
sub_block
txn
txn_child_manager
txn_manager
ule
xids
ybt
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
)
add_library(ft SHARED ${FT_SOURCES})
add_library(ft_static STATIC ${FT_SOURCES})
## we're going to link this into libtokudb.so so it needs to have PIC
set_target_properties(ft_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
maybe_add_gcov_to_libraries(ft ft_static)
## depend on other generated targets
add_dependencies(ft install_tdb_h generate_log_code build_lzma)
add_dependencies(ft_static install_tdb_h generate_log_code build_lzma)
## link with lzma (which should be static) and link dependers with zlib
target_link_libraries(ft LINK_PRIVATE util_static lzma ${LIBTOKUPORTABILITY})
target_link_libraries(ft LINK_PUBLIC ${ZLIB_LIBRARY} )
target_link_libraries(ft_static LINK_PRIVATE lzma)
## build the bins in this directory
foreach(tool tokuftdump tdb_logprint tdb-recover ftverify)
add_executable(${tool} ${tool}.cc)
add_dependencies(${tool} install_tdb_h)
target_link_libraries(${tool} ft_static util_static ${ZLIB_LIBRARY} lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
add_space_separated_property(TARGET ${tool} COMPILE_FLAGS -fvisibility=hidden)
endforeach(tool)
# link in math.h library just for this tool.
target_link_libraries(ftverify m)
install(
TARGETS tokuftdump
COMPONENT Server
DESTINATION ${INSTALL_BINDIR}
)
add_subdirectory(tests)
|