2022-06-28 08:31:05 +08:00
|
|
|
fdb_find_sources(FDBCLIENT_SRCS)
|
2022-06-28 09:00:40 +08:00
|
|
|
list(APPEND FDBCLIENT_SRCS
|
|
|
|
sha1/SHA1.cpp
|
|
|
|
libb64/cdecode.c
|
|
|
|
libb64/cencode.c)
|
2018-05-04 06:48:10 +08:00
|
|
|
|
2022-06-24 04:37:35 +08:00
|
|
|
message(STATUS "FDB version is ${FDB_VERSION}")
|
|
|
|
message(STATUS "FDB package name is ${FDB_PACKAGE_NAME}")
|
|
|
|
|
2019-04-18 03:10:51 +08:00
|
|
|
set(options_srcs ${CMAKE_CURRENT_BINARY_DIR}/FDBOptions.g.cpp)
|
2018-05-04 06:48:10 +08:00
|
|
|
|
2022-06-24 08:05:36 +08:00
|
|
|
make_directory(${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/)
|
|
|
|
vexillographer_compile(TARGET fdboptions_vex LANG cpp OUT ${CMAKE_CURRENT_BINARY_DIR}/FDBOptions.g
|
2019-02-05 13:25:10 +08:00
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FDBOptions.g.h ${CMAKE_CURRENT_BINARY_DIR}/FDBOptions.g.cpp)
|
2018-05-04 06:48:10 +08:00
|
|
|
|
2022-06-24 08:05:36 +08:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/FDBOptions.g.h
|
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/FDBOptions.g.h
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/FDBOptions.g.h ${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/FDBOptions.g.h)
|
|
|
|
|
|
|
|
vexillographer_compile(TARGET fdboptions_c LANG c OUT ${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/fdb_c_options.g.h
|
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/fdb_c_options.g.h)
|
|
|
|
|
|
|
|
add_custom_target(fdboptions DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/FDBOptions.g.h)
|
|
|
|
add_dependencies(fdboptions fdboptions_c)
|
|
|
|
|
2022-06-24 08:45:26 +08:00
|
|
|
################################################################################
|
|
|
|
# Build information
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/BuildFlags.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/BuildFlags.h)
|
|
|
|
|
|
|
|
|
2020-10-23 00:40:27 +08:00
|
|
|
set(BUILD_AZURE_BACKUP OFF CACHE BOOL "Build Azure backup client")
|
|
|
|
if(BUILD_AZURE_BACKUP)
|
|
|
|
add_compile_definitions(BUILD_AZURE_BACKUP)
|
|
|
|
set(FDBCLIENT_SRCS
|
|
|
|
${FDBCLIENT_SRCS}
|
2022-06-28 08:31:05 +08:00
|
|
|
azure_backup/BackupContainerAzureBlobStore.actor.cpp)
|
2020-10-11 11:10:12 +08:00
|
|
|
|
2020-10-23 00:40:27 +08:00
|
|
|
configure_file(azurestorage.cmake azurestorage-download/CMakeLists.txt)
|
2020-10-11 11:10:12 +08:00
|
|
|
|
2020-10-23 00:40:27 +08:00
|
|
|
execute_process(
|
|
|
|
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
|
|
|
|
RESULT_VARIABLE results
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/azurestorage-download
|
|
|
|
)
|
2020-10-11 11:10:12 +08:00
|
|
|
|
2020-10-23 00:40:27 +08:00
|
|
|
if(results)
|
|
|
|
message(FATAL_ERROR "Configuration step for AzureStorage has Failed. ${results}")
|
|
|
|
endif()
|
2020-10-11 11:10:12 +08:00
|
|
|
|
2020-10-23 00:40:27 +08:00
|
|
|
execute_process(
|
|
|
|
COMMAND ${CMAKE_COMMAND} --build . --config Release
|
|
|
|
RESULT_VARIABLE results
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/azurestorage-download
|
|
|
|
)
|
2020-10-11 11:10:12 +08:00
|
|
|
|
2020-10-23 00:40:27 +08:00
|
|
|
if(results)
|
|
|
|
message(FATAL_ERROR "Build step for AzureStorage has Failed. ${results}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_subdirectory(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/azurestorage-src
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/azurestorage-build
|
|
|
|
)
|
|
|
|
endif()
|
2020-10-11 11:10:12 +08:00
|
|
|
|
2022-03-02 07:11:12 +08:00
|
|
|
|
|
|
|
if(WITH_AWS_BACKUP)
|
|
|
|
add_compile_definitions(BUILD_AWS_BACKUP)
|
|
|
|
|
|
|
|
set(FDBCLIENT_SRCS
|
|
|
|
${FDBCLIENT_SRCS}
|
|
|
|
FDBAWSCredentialsProvider.h)
|
|
|
|
|
|
|
|
include(awssdk)
|
|
|
|
endif()
|
|
|
|
|
2019-04-18 03:10:51 +08:00
|
|
|
add_flow_target(STATIC_LIBRARY NAME fdbclient SRCS ${FDBCLIENT_SRCS} ADDL_SRCS ${options_srcs})
|
2022-06-28 08:31:05 +08:00
|
|
|
target_include_directories(fdbclient PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include")
|
2022-06-24 04:37:35 +08:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/versions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/fdbclient/versions.h)
|
2021-09-22 02:35:55 +08:00
|
|
|
add_dependencies(fdbclient fdboptions)
|
2021-06-04 06:10:04 +08:00
|
|
|
target_link_libraries(fdbclient PUBLIC fdbrpc msgpack)
|
2021-07-24 08:18:13 +08:00
|
|
|
|
|
|
|
# Create a separate fdbclient library with sampling enabled. This lets
|
|
|
|
# fdbserver retain sampling functionality in client code while disabling
|
|
|
|
# sampling for pure clients.
|
|
|
|
add_flow_target(STATIC_LIBRARY NAME fdbclient_sampling SRCS ${FDBCLIENT_SRCS} ADDL_SRCS ${options_srcs})
|
2021-09-22 02:35:55 +08:00
|
|
|
add_dependencies(fdbclient_sampling fdboptions)
|
2021-07-24 08:18:13 +08:00
|
|
|
target_link_libraries(fdbclient_sampling PUBLIC fdbrpc_sampling msgpack)
|
|
|
|
target_compile_definitions(fdbclient_sampling PRIVATE -DENABLE_SAMPLING)
|
2021-08-21 00:32:56 +08:00
|
|
|
if(WIN32)
|
|
|
|
add_dependencies(fdbclient_sampling_actors fdbclient_actors)
|
|
|
|
endif()
|
2021-07-24 08:18:13 +08:00
|
|
|
|
2020-10-23 00:40:27 +08:00
|
|
|
if(BUILD_AZURE_BACKUP)
|
2021-06-04 06:10:04 +08:00
|
|
|
target_link_libraries(fdbclient PRIVATE curl uuid azure-storage-lite)
|
2021-07-24 08:18:13 +08:00
|
|
|
target_link_libraries(fdbclient_sampling PRIVATE curl uuid azure-storage-lite)
|
2020-10-23 00:40:27 +08:00
|
|
|
endif()
|
2022-03-02 07:11:12 +08:00
|
|
|
|
|
|
|
if(BUILD_AWS_BACKUP)
|
|
|
|
target_link_libraries(fdbclient PUBLIC awssdk_target)
|
|
|
|
target_link_libraries(fdbclient_sampling PUBLIC awssdk_target)
|
|
|
|
endif()
|