2013-04-17 00:00:25 -04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2013-04-17 00:00:59 -04:00
|
|
|
## generate log_code.cc, log_print.cc, log_header.cc
|
2013-04-17 00:00:47 -04:00
|
|
|
set_source_files_properties(
|
2013-04-17 00:00:59 -04:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
|
2013-04-17 00:00:54 -04:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
|
2013-04-17 00:00:47 -04:00
|
|
|
PROPERTIES GENERATED TRUE)
|
2013-04-17 00:00:25 -04:00
|
|
|
|
2013-04-17 00:00:59 -04:00
|
|
|
add_executable(logformat logformat.cc)
|
2013-04-17 00:00:25 -04:00
|
|
|
target_link_libraries(logformat ${LIBTOKUPORTABILITY})
|
|
|
|
|
|
|
|
add_custom_command(
|
2013-04-17 00:00:59 -04:00
|
|
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc"
|
|
|
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_print.cc"
|
2013-04-17 00:00:30 -04:00
|
|
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
|
|
|
|
COMMAND $<TARGET_FILE:logformat> .
|
2013-04-17 00:00:30 -04:00
|
|
|
DEPENDS logformat
|
2013-04-17 00:00:30 -04:00
|
|
|
)
|
2013-04-17 00:00:41 -04:00
|
|
|
add_custom_target(
|
|
|
|
generate_log_code
|
2013-04-17 00:00:59 -04:00
|
|
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc" "${CMAKE_CURRENT_BINARY_DIR}/log_print.cc" "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
|
2013-04-17 00:00:41 -04:00
|
|
|
)
|
2013-04-17 00:00:25 -04:00
|
|
|
|
2013-04-17 00:00:35 -04:00
|
|
|
set(FT_SOURCES
|
2013-04-17 00:00:59 -04:00
|
|
|
background_job_manager
|
|
|
|
block_allocator
|
|
|
|
block_table
|
|
|
|
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
|
|
|
|
kibbutz
|
|
|
|
leafentry
|
|
|
|
le-cursor
|
|
|
|
logcursor
|
|
|
|
logfilemgr
|
|
|
|
logger
|
|
|
|
log_upgrade
|
|
|
|
memarena
|
|
|
|
mempool
|
|
|
|
minicron
|
|
|
|
omt
|
|
|
|
partitioned_counter
|
|
|
|
pqueue
|
|
|
|
queue
|
|
|
|
quicklz
|
|
|
|
recover
|
|
|
|
rollback
|
|
|
|
rollback-apply
|
|
|
|
rollback-ct-callbacks
|
|
|
|
roll
|
|
|
|
sort
|
|
|
|
sub_block
|
|
|
|
threadpool
|
|
|
|
txn
|
|
|
|
txn_manager
|
|
|
|
ule
|
|
|
|
x1764
|
|
|
|
xids
|
|
|
|
ybt
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
|
2013-04-17 00:00:25 -04:00
|
|
|
)
|
|
|
|
|
2013-04-17 00:00:35 -04:00
|
|
|
add_library(ft SHARED ${FT_SOURCES})
|
2013-04-17 00:01:07 -04:00
|
|
|
add_library(ft_objects OBJECT ${FT_SOURCES})
|
2013-04-17 00:00:27 -04:00
|
|
|
## we're going to link this into libtokudb.so so it needs to have PIC
|
2013-04-17 00:01:07 -04:00
|
|
|
set_target_properties(ft_objects PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
add_library(ft_static STATIC $<TARGET_OBJECTS:ft_objects>)
|
2013-04-17 00:01:07 -04:00
|
|
|
maybe_add_gcov_to_libraries(ft ft_static)
|
2013-04-17 00:00:25 -04:00
|
|
|
|
|
|
|
## depend on other generated targets
|
2013-04-17 00:00:59 -04:00
|
|
|
add_dependencies(ft install_tdb_h generate_log_code build_lzma)
|
2013-04-17 00:01:07 -04:00
|
|
|
add_dependencies(ft_objects install_tdb_h generate_log_code build_lzma)
|
2013-04-17 00:00:25 -04:00
|
|
|
|
2013-04-17 00:00:49 -04:00
|
|
|
## link with lzma (which should be static) and link dependers with zlib
|
2013-04-17 00:00:49 -04:00
|
|
|
target_link_libraries(ft LINK_PRIVATE lzma ${LIBTOKUPORTABILITY})
|
|
|
|
target_link_libraries(ft LINK_PUBLIC z)
|
2013-04-17 00:00:49 -04:00
|
|
|
target_link_libraries(ft_static LINK_PRIVATE lzma)
|
2013-04-17 00:00:25 -04:00
|
|
|
|
2013-04-17 00:00:27 -04:00
|
|
|
if (CMAKE_C_COMPILER_ID STREQUAL Intel)
|
2013-04-17 00:00:49 -04:00
|
|
|
target_link_libraries(ft LINK_PRIVATE -nodefaultlibs)
|
2013-04-17 00:00:26 -04:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
## conditionally use cilk
|
|
|
|
if (USE_CILK)
|
2013-04-17 00:00:35 -04:00
|
|
|
set_property(TARGET ft APPEND PROPERTY COMPILE_DEFINITIONS HAVE_CILK=1)
|
|
|
|
set_property(TARGET ft_static APPEND PROPERTY COMPILE_DEFINITIONS HAVE_CILK=1)
|
|
|
|
target_link_libraries(ft cilkrts)
|
|
|
|
target_link_libraries(ft_static cilkrts)
|
2013-04-17 00:00:26 -04:00
|
|
|
endif (USE_CILK)
|
2013-04-17 00:00:25 -04:00
|
|
|
|
|
|
|
## build the bins in this directory
|
|
|
|
set(bins
|
2013-04-17 00:00:35 -04:00
|
|
|
ftdump
|
2013-04-17 00:00:25 -04:00
|
|
|
tdb_logprint
|
|
|
|
tdb-recover
|
2013-04-17 00:00:43 -04:00
|
|
|
ftverify
|
2013-04-17 00:00:25 -04:00
|
|
|
)
|
|
|
|
foreach(bin ${bins})
|
2013-04-17 00:00:59 -04:00
|
|
|
add_executable(${bin} ${bin})
|
2013-04-17 00:00:25 -04:00
|
|
|
add_dependencies(${bin} install_tdb_h)
|
2013-04-17 00:00:35 -04:00
|
|
|
target_link_libraries(${bin} ft ${LIBTOKUPORTABILITY})
|
2013-04-17 00:00:25 -04:00
|
|
|
|
2013-04-17 00:00:59 -04:00
|
|
|
add_executable(${bin}_static ${bin})
|
2013-04-17 00:00:49 -04:00
|
|
|
add_dependencies(${bin}_static install_tdb_h)
|
2013-04-17 00:00:52 -04:00
|
|
|
target_link_libraries(${bin}_static ft_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} dl)
|
2013-04-17 00:00:49 -04:00
|
|
|
|
|
|
|
add_common_options_to_binary_targets(${bin} ${bin}_static)
|
2013-04-17 00:00:25 -04:00
|
|
|
endforeach(bin)
|
|
|
|
|
2013-04-17 00:00:43 -04:00
|
|
|
# link in math.h library just for this tool.
|
|
|
|
target_link_libraries(ftverify m)
|
|
|
|
target_link_libraries(ftverify_static m)
|
|
|
|
|
2013-04-17 00:00:25 -04:00
|
|
|
install(
|
2013-04-17 00:00:35 -04:00
|
|
|
TARGETS ftdump_static
|
2013-04-17 00:00:25 -04:00
|
|
|
DESTINATION bin
|
|
|
|
)
|
|
|
|
|
|
|
|
add_subdirectory(tests)
|