2022-09-23 06:17:04 +08:00
|
|
|
include(AddFdbTest)
|
2022-06-28 09:20:18 +08:00
|
|
|
fdb_find_sources(FDBCLI_SRCS)
|
|
|
|
|
|
|
|
add_flow_target(EXECUTABLE NAME fdbcli SRCS ${FDBCLI_SRCS})
|
|
|
|
target_include_directories(fdbcli PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include")
|
2023-03-31 06:23:12 +08:00
|
|
|
target_link_libraries(fdbcli PRIVATE fdbclient metacluster SimpleOpt)
|
2022-09-08 23:27:57 +08:00
|
|
|
if (USE_UBSAN)
|
|
|
|
# The intent is to put typeinfo symbols in the dynamic symbol table so that
|
|
|
|
# the types in fdbcli and external libfdb_c clients agree for ubsan's vptr
|
|
|
|
# check. This would not be a good idea for the normal build, or if we ever
|
|
|
|
# start testing old libfdb_c's that are ubsan-instrumented.
|
|
|
|
target_link_options(fdbcli PRIVATE "-rdynamic")
|
|
|
|
endif()
|
2018-05-04 07:06:30 +08:00
|
|
|
|
2019-02-07 11:27:38 +08:00
|
|
|
if(NOT WIN32)
|
2022-06-28 09:20:18 +08:00
|
|
|
target_link_libraries(fdbcli PRIVATE linenoise)
|
2019-02-07 11:27:38 +08:00
|
|
|
endif()
|
|
|
|
|
2021-01-26 08:09:32 +08:00
|
|
|
if(NOT OPEN_FOR_IDE)
|
|
|
|
if(GENERATE_DEBUG_PACKAGES)
|
|
|
|
fdb_install(TARGETS fdbcli DESTINATION bin COMPONENT clients)
|
|
|
|
else()
|
|
|
|
add_custom_target(prepare_fdbcli_install ALL DEPENDS strip_only_fdbcli)
|
|
|
|
fdb_install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/bin/fdbcli DESTINATION bin COMPONENT clients)
|
|
|
|
endif()
|
2020-05-22 04:39:55 +08:00
|
|
|
endif()
|
2022-09-23 06:17:04 +08:00
|
|
|
|
|
|
|
if (NOT WIN32 AND NOT OPEN_FOR_IDE)
|
|
|
|
add_dependencies(fdbcli external_client)
|
|
|
|
|
|
|
|
add_fdbclient_test(
|
|
|
|
NAME single_process_fdbcli_tests
|
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/fdbcli/tests/fdbcli_tests.py
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
@CLUSTER_FILE@
|
|
|
|
)
|
|
|
|
add_fdbclient_test(
|
|
|
|
NAME multi_process_fdbcli_tests
|
|
|
|
PROCESS_NUMBER 5
|
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/fdbcli/tests/fdbcli_tests.py
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
@CLUSTER_FILE@
|
|
|
|
5
|
|
|
|
)
|
|
|
|
add_fdbclient_test(
|
|
|
|
NAME single_process_external_client_fdbcli_tests
|
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/fdbcli/tests/fdbcli_tests.py
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
@CLUSTER_FILE@
|
|
|
|
--external-client-library ${CMAKE_BINARY_DIR}/bindings/c/libfdb_c_external.so
|
|
|
|
)
|
|
|
|
add_fdbclient_test(
|
|
|
|
NAME multi_process_external_client_fdbcli_tests
|
|
|
|
PROCESS_NUMBER 5
|
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/fdbcli/tests/fdbcli_tests.py
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
@CLUSTER_FILE@
|
|
|
|
5
|
|
|
|
--external-client-library ${CMAKE_BINARY_DIR}/bindings/c/libfdb_c_external.so
|
|
|
|
)
|
2023-01-27 05:04:22 +08:00
|
|
|
|
|
|
|
add_multi_fdbclient_test(
|
|
|
|
NAME metacluster_fdbcli_tests
|
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/fdbcli/tests/metacluster_fdbcli_tests.py
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
)
|
2022-09-23 06:17:04 +08:00
|
|
|
endif()
|