Commit ea138039 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5592 fix linking of util, again...

git-svn-id: file:///svn/toku/tokudb@48823 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2ae2bf7e
......@@ -8,7 +8,7 @@ set_source_files_properties(
PROPERTIES GENERATED TRUE)
add_executable(logformat logformat.cc)
target_link_libraries(logformat ${LIBTOKUPORTABILITY} util)
target_link_libraries(logformat ${LIBTOKUPORTABILITY})
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc"
......@@ -84,8 +84,8 @@ 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 lzma ${LIBTOKUPORTABILITY})
target_link_libraries(ft LINK_PUBLIC z util)
target_link_libraries(ft LINK_PRIVATE util_static lzma ${LIBTOKUPORTABILITY})
target_link_libraries(ft LINK_PUBLIC z)
target_link_libraries(ft_static LINK_PRIVATE lzma)
## build the bins in this directory
......@@ -102,7 +102,7 @@ foreach(bin ${bins})
add_executable(${bin}_static ${bin})
add_dependencies(${bin}_static install_tdb_h)
target_link_libraries(${bin}_static ft_static z lzma ${LIBTOKUPORTABILITY}_static util_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
target_link_libraries(${bin}_static ft_static util_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
add_common_options_to_binary_targets(${bin} ${bin}_static)
endforeach(bin)
......
......@@ -5436,6 +5436,7 @@ int toku_ft_layer_init(void) {
r = toku_portability_init();
if (r) { goto exit; }
partitioned_counters_init();
status_init();
toku_checkpoint_init();
toku_ft_serialize_layer_init();
......@@ -5449,6 +5450,7 @@ void toku_ft_layer_destroy(void) {
toku_ft_serialize_layer_destroy();
toku_checkpoint_destroy();
status_destroy();
partitioned_counters_destroy();
//Portability must be cleaned up last
toku_portability_destroy();
}
......
......@@ -16,7 +16,6 @@ add_library(${LIBTOKUPORTABILITY}_static STATIC ${tokuportability_srcs})
maybe_add_gcov_to_libraries(${LIBTOKUPORTABILITY} ${LIBTOKUPORTABILITY}_static)
set_property(TARGET ${LIBTOKUPORTABILITY} ${LIBTOKUPORTABILITY}_static APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
set_target_properties(${LIBTOKUPORTABILITY}_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(${LIBTOKUPORTABILITY} LINK_PRIVATE util_static)
target_link_libraries(${LIBTOKUPORTABILITY} LINK_PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
set_property(SOURCE file memory os_malloc portability toku_assert toku_rwlock APPEND PROPERTY
......
......@@ -48,13 +48,11 @@
int
toku_portability_init(void) {
int r = toku_memory_startup();
partitioned_counters_init();
return r;
}
void
toku_portability_destroy(void) {
partitioned_counters_destroy();
toku_memory_shutdown();
}
......
......@@ -26,7 +26,7 @@ if(BUILD_TESTING)
foreach(test ${tests})
add_executable(${test} ${test})
target_link_libraries(${test} ${LIBTOKUPORTABILITY} util)
target_link_libraries(${test} ${LIBTOKUPORTABILITY})
set_target_properties(${test} PROPERTIES POSITION_INDEPENDENT_CODE ON)
if(HAVE_CLOCK_REALTIME)
target_link_libraries(${test} rt)
......
......@@ -20,14 +20,14 @@ set(tokudb_srcs
## make the shared library
add_library(${LIBTOKUDB} SHARED ${tokudb_srcs})
add_dependencies(${LIBTOKUDB} install_tdb_h generate_log_code)
target_link_libraries(${LIBTOKUDB} LINK_PRIVATE lock_tree_static range_tree_static ft_static lzma ${LIBTOKUPORTABILITY} util_static)
target_link_libraries(${LIBTOKUDB} LINK_PRIVATE lock_tree_static range_tree_static ft_static util_static lzma ${LIBTOKUPORTABILITY})
target_link_libraries(${LIBTOKUDB} LINK_PUBLIC z)
## make the static library
add_library(tokudb_static_conv STATIC ${tokudb_srcs})
add_dependencies(tokudb_static_conv install_tdb_h generate_log_code)
set_target_properties(tokudb_static_conv PROPERTIES POSITION_INDEPENDENT_CODE ON)
set(tokudb_source_libs tokudb_static_conv lock_tree_static range_tree_static ft_static lzma ${LIBTOKUPORTABILITY} util_static z ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
set(tokudb_source_libs tokudb_static_conv lock_tree_static range_tree_static ft_static util_static lzma ${LIBTOKUPORTABILITY} z ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
merge_static_libs(${LIBTOKUDB}_static ${LIBTOKUDB}_static "${tokudb_source_libs}")
## add a version script and set -fvisibility=hidden for the shared library
......
......@@ -7,7 +7,7 @@ if(BUILD_TESTING)
foreach(test ${tests})
add_executable(${test} ${test})
target_link_libraries(${test} ${LIBTOKUPORTABILITY} util)
target_link_libraries(${test} util ${LIBTOKUPORTABILITY})
endforeach(test)
add_helgrind_test(util/helgrind_test_partitioned_counter $<TARGET_FILE:test_partitioned_counter>)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment