Skip to content

Commit

Permalink
Merge pull request #340 from tplavcic/tokudb-fixes
Browse files Browse the repository at this point in the history
Contributed fixes from bugs #1510085 and #1510092
  • Loading branch information
georgelorchpercona committed Nov 16, 2015
2 parents e93af93 + 9551761 commit cc7b178
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 15 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
if (CMAKE_PROJECT_NAME STREQUAL TokuDB)
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
endif()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")

project(TokuDB)
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions buildheader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/bash
out=$1; shift
exec \"$@\" >$out")

add_executable(make_tdb make_tdb)
add_executable(make_tdb make_tdb.cc)
set_property(TARGET make_tdb APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/db.h"
Expand All @@ -26,4 +26,4 @@ if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
DESTINATION include
COMPONENT tokukv_headers
)
endif ()
endif ()
2 changes: 1 addition & 1 deletion cmake_modules/FindValgrind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h)
find_program(VALGRIND_PROGRAM NAMES valgrind)

find_package_handle_standard_args(VALGRIND DEFAULT_MSG
find_package_handle_standard_args(Valgrind DEFAULT_MSG
VALGRIND_INCLUDE_DIR
VALGRIND_PROGRAM)

Expand Down
3 changes: 2 additions & 1 deletion cmake_modules/TokuMergeLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ MACRO(TOKU_MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
ENDIF()
ENDFOREACH()
IF(OSLIBS)
LIST(REMOVE_DUPLICATES OSLIBS)
# REMOVE_DUPLICATES destroys the order of the libs so disabled
# LIST(REMOVE_DUPLICATES OSLIBS)
TARGET_LINK_LIBRARIES(${TARGET} LINK_PUBLIC ${OSLIBS})
ENDIF()

Expand Down
5 changes: 3 additions & 2 deletions cmake_modules/TokuSetupCTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ macro(real_executable_name filename_input out)
execute_process(
COMMAND which ${filename}
RESULT_VARIABLE res
ERROR_QUIET
OUTPUT_VARIABLE full_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT(res))
Expand Down Expand Up @@ -59,7 +60,7 @@ macro(hostname out)
COMMAND hostname
OUTPUT_VARIABLE fullhostname
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} ${fullhostname})
string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} "${fullhostname}")
endmacro(hostname)

## gather machine info
Expand Down Expand Up @@ -150,5 +151,5 @@ if (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
option(RUN_STRESS_TESTS "If set, run the stress tests." OFF)
option(RUN_PERF_TESTS "If set, run the perf tests." OFF)

configure_file(CTestCustom.cmake . @ONLY)
configure_file(CTestCustom.cmake.in CTestCustom.cmake @ONLY)
endif (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
3 changes: 2 additions & 1 deletion cmake_modules/TokuThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (APPLE)
list(APPEND xz_configure_opts --disable-assembler)
endif ()

list(APPEND xz_configure_opts CC=${CMAKE_C_COMPILER})
list(APPEND xz_configure_opts "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL drd)
list(APPEND xz_configure_opts --enable-debug)
endif ()
Expand All @@ -68,6 +68,7 @@ ExternalProject_Add(build_lzma
CONFIGURE_COMMAND
"<SOURCE_DIR>/configure" ${xz_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
"--libdir=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/lib"
BUILD_COMMAND
${SUBMAKE_COMMAND} -C src/liblzma
INSTALL_COMMAND
Expand Down
2 changes: 1 addition & 1 deletion ft/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(BUILD_TESTING OR BUILD_FT_TESTS)
add_test(ft/logcursor-bw echo "logcursor-bw must be run manually (needs logs to iterate over).")

foreach(test ${tests})
add_executable(${test} ${test})
add_executable(${test} ${test}.cc)
target_link_libraries(${test} ft ${LIBTOKUPORTABILITY})
set_target_properties(${test} PROPERTIES POSITION_INDEPENDENT_CODE ON)
add_space_separated_property(TARGET ${test} COMPILE_FLAGS -fvisibility=hidden)
Expand Down
2 changes: 1 addition & 1 deletion locktree/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if(BUILD_TESTING)
foreach(src ${srcs})
get_filename_component(base ${src} NAME_WE)

add_executable(${base} ${base})
add_executable(${base} ${base}.cc)
add_space_separated_property(TARGET ${base} COMPILE_FLAGS -fvisibility=hidden)
target_link_libraries(${base} locktree ft ${LIBTOKUPORTABILITY})
add_locktree_test(${base})
Expand Down
2 changes: 1 addition & 1 deletion portability/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if(BUILD_TESTING)

foreach(src ${srcs})
get_filename_component(test ${src} NAME_WE)
add_executable(${test} ${test})
add_executable(${test} ${test}.cc)
target_link_libraries(${test} ${LIBTOKUPORTABILITY})
set_target_properties(${test} PROPERTIES POSITION_INDEPENDENT_CODE ON)
add_space_separated_property(TARGET ${test} COMPILE_FLAGS -fvisibility=hidden)
Expand Down
4 changes: 2 additions & 2 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)

## #5138 only reproduces when using the static library.
list(REMOVE_ITEM tdb_bins test-5138.tdb)
add_executable(test-5138.tdb test-5138)
add_executable(test-5138.tdb test-5138.cc)
target_link_libraries(test-5138.tdb ${LIBTOKUDB}_static z ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
add_space_separated_property(TARGET test-5138.tdb COMPILE_FLAGS -fvisibility=hidden)
add_ydb_test(test-5138.tdb)
add_ydb_test(rollback-inconsistency.tdb)
foreach(bin ${tdb_bins})
get_filename_component(base ${bin} NAME_WE)

add_executable(${base}.tdb ${base})
add_executable(${base}.tdb ${base}.cc)
# Some of the symbols in util may not be exported properly by
# libtokudb.so.
# We link the test with util directly so that the test code itself can use
Expand Down
2 changes: 1 addition & 1 deletion tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPR

set(tools tokudb_dump tokuftdump tokuft_logprint tdb-recover ftverify ba_replay)
foreach(tool ${tools})
add_executable(${tool} ${tool})
add_executable(${tool} ${tool}.cc)
add_dependencies(${tool} install_tdb_h)
target_link_libraries(${tool} ${LIBTOKUDB}_static ft_static z lzma snappy ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})

Expand Down
2 changes: 1 addition & 1 deletion util/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if(BUILD_TESTING)
endforeach(src)

foreach(test ${tests})
add_executable(${test} ${test})
add_executable(${test} ${test}.cc)
target_link_libraries(${test} util ${LIBTOKUPORTABILITY})
endforeach(test)

Expand Down

0 comments on commit cc7b178

Please sign in to comment.