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