Commit 7a174bc3 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5778 only build static versions of many utilities


git-svn-id: file:///svn/toku/tokudb@50988 c7de825b-a66e-492c-adef-691d508d4ae1
parent c0f791cb
......@@ -90,30 +90,18 @@ target_link_libraries(ft LINK_PUBLIC z)
target_link_libraries(ft_static LINK_PRIVATE lzma)
## build the bins in this directory
set(bins
ftdump
tdb_logprint
tdb-recover
ftverify
)
foreach(bin ${bins})
add_executable(${bin} ${bin})
add_dependencies(${bin} install_tdb_h)
target_link_libraries(${bin} ft ${LIBTOKUPORTABILITY})
add_executable(${bin}_static ${bin})
add_dependencies(${bin}_static install_tdb_h)
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)
foreach(tool ftdump tdb_logprint tdb-recover ftverify)
add_executable(${tool} ${tool})
add_dependencies(${tool} install_tdb_h)
target_link_libraries(${tool} ft_static util_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
add_common_options_to_binary_targets(${tool})
endforeach(tool)
# link in math.h library just for this tool.
target_link_libraries(ftverify m)
target_link_libraries(ftverify_static m)
install(
TARGETS ftdump_static
TARGETS ftdump
DESTINATION bin
)
......
......@@ -104,17 +104,15 @@ if(BUILD_TESTING OR BUILD_FT_TESTS)
add_test(ft/bnc-insert-benchmark bnc-insert-benchmark 100 4096000 1000)
configure_file(run_ftdump_test.sh . COPYONLY)
foreach(dump ftdump ftdump_static)
add_executable(ft-test-for-${dump} ft-test)
target_link_libraries(ft-test-for-${dump} ft ${LIBTOKUPORTABILITY})
add_common_options_to_binary_targets(ft-test-for-${dump})
set_property(TARGET ft-test-for-${dump} APPEND PROPERTY
COMPILE_DEFINITIONS "__SRCFILE__=\"ft-test-for-${dump}\";TOKUSVNROOT=\"${TOKU_SVNROOT}\"")
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "ft-test-for-${dump}.ft_handle")
add_executable(ft-test-for-ftdump ft-test)
target_link_libraries(ft-test-for-ftdump ft ${LIBTOKUPORTABILITY})
add_common_options_to_binary_targets(ft-test-for-ftdump)
set_property(TARGET ft-test-for-ftdump APPEND PROPERTY
COMPILE_DEFINITIONS "__SRCFILE__=\"ft-test-for-ftdump\";TOKUSVNROOT=\"${TOKU_SVNROOT}\"")
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "ft-test-for-ftdump.ft_handle")
add_test(
NAME ft/${dump}-test
COMMAND run_ftdump_test.sh $<TARGET_FILE:ft-test-for-${dump}> "ft-test-for-${dump}.ft_handle" $<TARGET_FILE:${dump}>)
endforeach(dump)
NAME ft/ftdump-test
COMMAND run_ftdump_test.sh $<TARGET_FILE:ft-test-for-ftdump> "ft-test-for-ftdump.ft_handle" $<TARGET_FILE:ftdump>)
foreach(test ${tests})
if(NOT "${test}" MATCHES "dir[.].*")
......
......@@ -631,7 +631,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
foreach(recover_test ${recover_tests})
get_filename_component(base ${recover_test} NAME_WE)
add_test(NAME ydb/${recover_test}
COMMAND run_recover_test.sh $<TARGET_FILE:${base}.tdb> "dir.${base}.tdb" $<TARGET_FILE:tdb-recover> $<TARGET_FILE:tokudb_dump_static>)
COMMAND run_recover_test.sh $<TARGET_FILE:${base}.tdb> "dir.${base}.tdb" $<TARGET_FILE:tdb-recover> $<TARGET_FILE:tokudb_dump>)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "dir.${base}.tdb" "dir.${base}.tdb.recover")
endforeach(recover_test)
......
......@@ -122,7 +122,7 @@ do_abort_delete_first_or_last(int N,
r=db->close(db, 0); CKERR(r);
r=env->close(env, 0); CKERR(r);
#if defined(TOKUDB) && defined(__unix__)
r=system("../../utils/tokudb_dump_static -h " ENVDIR " foo.db > " DEV_NULL_FILE);
r=system("../../utils/tokudb_dump -h " ENVDIR " foo.db > " DEV_NULL_FILE);
CKERR(r);
#endif
}
......
......@@ -4,15 +4,10 @@ set(utils tokudb_gen tokudb_load tokudb_dump)
foreach(util ${utils})
add_executable(${util} ${util})
set_target_properties(${util} PROPERTIES
COMPILE_DEFINITIONS "IS_TDB=1;USE_TDB=1;TDB_IS_STATIC=0")
target_link_libraries(${util} ${LIBTOKUDB} ${LIBTOKUPORTABILITY})
add_executable(${util}_static ${util})
set_target_properties(${util}_static PROPERTIES
COMPILE_DEFINITIONS "IS_TDB=1;USE_TDB=1;TDB_IS_STATIC=1")
target_link_libraries(${util}_static ${LIBTOKUDB}_static ft_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
target_link_libraries(${util} ${LIBTOKUDB}_static ft_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
add_common_options_to_binary_targets(${util} ${util}_static)
add_common_options_to_binary_targets(${util})
if(BDB_FOUND)
add_executable(${util}.bdb ${util})
......
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