2024-06-16 21:07:45 +08:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2024-06-11 19:13:30 +08:00
|
|
|
|
|
|
|
set(tile_VERSION_MAJOR 0)
|
|
|
|
set(tile_VERSION_MINOR 1)
|
|
|
|
set(tile_VERSION_PATCH 0)
|
2024-07-27 12:53:30 +08:00
|
|
|
set(tile_VERSION_BUILD $ENV{BUILD_NUMBER})
|
|
|
|
if (NOT tile_VERSION_BUILD)
|
|
|
|
set(tile_VERSION_BUILD "0")
|
|
|
|
endif()
|
2024-06-11 19:13:30 +08:00
|
|
|
project(
|
|
|
|
tile
|
2024-07-27 12:53:30 +08:00
|
|
|
VERSION ${tile_VERSION_MAJOR}.${tile_VERSION_MINOR}.${tile_VERSION_PATCH}.${tile_VERSION_BUILD}
|
2024-06-13 15:10:38 +08:00
|
|
|
LANGUAGES C CXX)
|
2024-06-11 19:13:30 +08:00
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
|
|
|
option(TILE_BUILD_TESTS "Build tests" OFF)
|
|
|
|
option(TILE_BUILD_BENCHMARKS "Build tests" OFF)
|
|
|
|
option(TILE_WITH_OPENSSL "Build with openssl" OFF)
|
|
|
|
option(TILE_BUILD_SHARED "Build shared library" ON)
|
|
|
|
option(TILE_BUILD_STATIC "Build static library" ON)
|
|
|
|
|
2024-06-17 22:46:00 +08:00
|
|
|
# set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "time")
|
|
|
|
# set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "time")
|
|
|
|
|
2024-06-17 15:28:32 +08:00
|
|
|
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
2024-06-16 21:07:45 +08:00
|
|
|
set(TILE_BUILD_TESTS ON)
|
|
|
|
set(TILE_BUILD_BENCHMARKS ON)
|
|
|
|
endif()
|
|
|
|
|
2024-06-11 19:13:30 +08:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
2024-06-17 14:22:34 +08:00
|
|
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gz")
|
|
|
|
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gz")
|
2024-06-11 19:13:30 +08:00
|
|
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_C_FLAGS
|
2024-06-11 23:34:48 +08:00
|
|
|
# "${CMAKE_CXX_FLAGS} -static") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
|
|
|
|
# -fsanitize=address ") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address
|
|
|
|
# ")
|
2024-06-11 19:13:30 +08:00
|
|
|
|
|
|
|
set(WHOLE_ARCHIVE_PREFIX "-Wl,-force_load")
|
|
|
|
# set(NO_WHOLE_ARCHIVE_PREFIX "")
|
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
2024-06-17 14:22:34 +08:00
|
|
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gz")
|
|
|
|
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gz")
|
2024-06-11 19:13:30 +08:00
|
|
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_C_FLAGS
|
|
|
|
# "${CMAKE_CXX_FLAGS} -static")
|
|
|
|
|
|
|
|
set(WHOLE_ARCHIVE_PREFIX "-Wl,-force_load,")
|
|
|
|
# set(NO_WHOLE_ARCHIVE_PREFIX "")
|
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2024-07-03 18:30:06 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gz")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gz")
|
2024-06-14 16:19:06 +08:00
|
|
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
|
|
|
|
# set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
|
2024-06-11 19:13:30 +08:00
|
|
|
|
2024-06-16 00:46:50 +08:00
|
|
|
set(STATIC_BINARY_FLAGS "-static-libgcc -static-libstdc++")
|
2024-06-11 19:13:30 +08:00
|
|
|
set(WHOLE_ARCHIVE_PREFIX "-Wl,--whole-archive")
|
|
|
|
set(WHOLE_ARCHIVE_SUFFIX "-Wl,--no-whole-archive")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# extern int getifaddrs(struct ifaddrs **ifap); extern void freeifaddrs(struct
|
|
|
|
# ifaddrs *ifa);
|
|
|
|
include(CheckSymbolExists)
|
|
|
|
include(cmake/BuildInfo.cmake)
|
|
|
|
|
|
|
|
check_symbol_exists("getifaddrs" "ifaddrs.h" TILE_HAVE_GETIFADDRS)
|
|
|
|
check_symbol_exists("freeifaddrs" "ifaddrs.h" TILE_HAVE_FREEIFADDRS)
|
|
|
|
|
2024-06-17 14:40:36 +08:00
|
|
|
find_package(Git REQUIRED)
|
|
|
|
|
2024-06-11 19:13:30 +08:00
|
|
|
get_git_commit_hash(GIT_COMMIT_HASH)
|
|
|
|
get_git_commit_date(GIT_COMMIT_DATE)
|
|
|
|
get_git_commit_subject(GIT_COMMIT_SUBJECT)
|
|
|
|
|
2024-06-16 00:46:50 +08:00
|
|
|
set(THIRD_PARTY_INCLUDE_DIRS
|
2024-06-20 21:17:12 +08:00
|
|
|
# "third_party/json" "third_party/inja"
|
|
|
|
"third_party/sigslot"
|
2024-06-16 00:46:50 +08:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include")
|
2024-06-14 12:51:04 +08:00
|
|
|
include_directories(${THIRD_PARTY_INCLUDE_DIRS})
|
2024-06-11 19:13:30 +08:00
|
|
|
add_subdirectory("third_party/zlib")
|
2024-06-20 21:17:12 +08:00
|
|
|
add_subdirectory("third_party/jsoncpp")
|
2024-06-11 19:13:30 +08:00
|
|
|
add_subdirectory("third_party/fmt")
|
|
|
|
add_subdirectory("third_party/googletest")
|
|
|
|
add_subdirectory("third_party/gflags")
|
|
|
|
set(GFLAGS_USE_TARGET_NAMESPACE ON)
|
|
|
|
set(gflags_DIR "${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags")
|
|
|
|
add_subdirectory("third_party/glog")
|
2024-06-14 16:08:40 +08:00
|
|
|
add_subdirectory("third_party/context")
|
2024-06-11 19:13:30 +08:00
|
|
|
|
|
|
|
set(CURL_DISABLE_TESTS ON)
|
2024-06-16 00:46:50 +08:00
|
|
|
set(CURL_CA_PATH
|
|
|
|
"none"
|
|
|
|
CACHE STRING "" FORCE)
|
2024-06-11 19:13:30 +08:00
|
|
|
set(CURL_ENABLE_SSL
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(USE_LIBIDN2
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(CURL_USE_LIBPSL
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(CURL_USE_LIBSSH
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(CURL_USE_LIBSSH2
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(CURL_USE_GSSAPI
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(CURL_USE_RTMP
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(USE_OPENSSL_QUIC
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(USE_MSH3
|
|
|
|
OFF
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(CURL_DISABLE_LDAP
|
|
|
|
ON
|
|
|
|
CACHE BOOL "" FORCE)
|
|
|
|
set(ZLIB_FOUND ON)
|
|
|
|
set(ZLIB_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib")
|
|
|
|
set(ZLIB_LIBRARIES zlib)
|
|
|
|
add_subdirectory("third_party/curl")
|
|
|
|
# add_subdirectory("third_party/date")
|
|
|
|
if(TILE_WITH_OPENSSL)
|
|
|
|
add_subdirectory("third_party/openssl-cmake")
|
|
|
|
list(APPEND TILE_LINK_LIBS ssl crypto)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file("tile/base/config.h.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/tile/base/config.h" @ONLY)
|
|
|
|
# file(GLOB zlib_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib/zlib/*.c")
|
|
|
|
set(TILE_SRCS
|
|
|
|
"tile/base/buffer/builtin_buffer_block.cc"
|
|
|
|
"tile/base/buffer/compression_output_stream.cc"
|
|
|
|
"tile/base/buffer/polymorphic_buffer.cc"
|
|
|
|
"tile/base/buffer.cc"
|
|
|
|
"tile/base/chrono.cc"
|
|
|
|
"tile/base/compression.cc"
|
|
|
|
"tile/base/compression/compression.cc"
|
|
|
|
"tile/base/compression/gzip.cc"
|
|
|
|
"tile/base/compression/util.cc"
|
|
|
|
"tile/base/demangle.cc"
|
|
|
|
"tile/base/encoding/base64.cc"
|
|
|
|
"tile/base/encoding/detail/hex_chars.cc"
|
|
|
|
"tile/base/encoding/hex.cc"
|
|
|
|
"tile/base/encoding/percent.cc"
|
2024-07-03 18:30:06 +08:00
|
|
|
"tile/base/exposed_var.cc"
|
2024-06-11 19:13:30 +08:00
|
|
|
"tile/base/internal/background_task_host.cc"
|
|
|
|
"tile/base/internal/background_task_host.h"
|
|
|
|
"tile/base/internal/case_insensitive_hash_map.h"
|
|
|
|
"tile/base/internal/curl.cc"
|
|
|
|
"tile/base/internal/curl.h"
|
|
|
|
"tile/base/internal/early_init.h"
|
|
|
|
"tile/base/internal/index_alloc.cc"
|
|
|
|
"tile/base/internal/logging.cc"
|
|
|
|
"tile/base/internal/logging.h"
|
|
|
|
"tile/base/internal/thread_pool.cc"
|
|
|
|
"tile/base/internal/time_keeper.cc"
|
|
|
|
"tile/base/internal/time_keeper.h"
|
|
|
|
"tile/base/net/endpoint.cc"
|
|
|
|
"tile/base/object_pool/disabled.cc"
|
|
|
|
"tile/base/object_pool/global.cc"
|
|
|
|
"tile/base/object_pool/thread_local.cc"
|
|
|
|
"tile/base/option.cc"
|
|
|
|
"tile/base/option/gflags_provider.cc"
|
|
|
|
"tile/base/option/json_parser.cc"
|
|
|
|
"tile/base/option/key.cc"
|
|
|
|
"tile/base/option/option_provider.cc"
|
|
|
|
"tile/base/option/option_service.cc"
|
|
|
|
"tile/base/slice.cc"
|
|
|
|
"tile/base/status.cc"
|
|
|
|
"tile/base/string.cc"
|
|
|
|
"tile/base/thread/cond_var.cc"
|
|
|
|
"tile/base/thread/latch.cc"
|
|
|
|
"tile/base/thread/mutex.cc"
|
|
|
|
"tile/base/thread/rw_mutex.cc"
|
|
|
|
"tile/base/thread/scoped_lock.cc"
|
|
|
|
"tile/base/thread/spinlock.cc"
|
2024-07-12 17:11:19 +08:00
|
|
|
"tile/base/memory_barrier.cc"
|
2024-06-11 22:11:37 +08:00
|
|
|
"tile/fiber/detail/fiber.cc"
|
2024-06-11 19:13:30 +08:00
|
|
|
"tile/io/detail/eintr_safe.cc"
|
|
|
|
"tile/io/native/acceptor.cc"
|
|
|
|
"tile/io/descriptor.cc"
|
|
|
|
"tile/io/event_loop.cc"
|
|
|
|
"tile/init.cc"
|
|
|
|
"tile/init/on_init.cc"
|
|
|
|
"tile/init/override_flag.cc"
|
|
|
|
"tile/net/http/http_headers.cc"
|
|
|
|
"tile/net/http/http_message.cc"
|
|
|
|
"tile/net/http/http_request.cc"
|
|
|
|
"tile/net/http/http_response.cc"
|
|
|
|
"tile/net/http/http_client.cc"
|
|
|
|
"tile/net/http/types.cc"
|
|
|
|
"tile/net/internal/http_task.cc"
|
|
|
|
"tile/net/internal/http_engine.cc"
|
|
|
|
"tile/testing/internal/random_string.cc"
|
|
|
|
"tile/rpc/protocol/http/buffer_io.cc"
|
|
|
|
"tile/rpc/protocol/message.cc"
|
|
|
|
# "tile/rpc/server.cc"
|
|
|
|
)
|
|
|
|
|
|
|
|
if((NOT TILE_HAVE_GETIFADDRS) OR (NOT TILE_HAVE_FREEIFADDRS))
|
|
|
|
list(APPEND TILE_SRCS "tile/base/net/detail/android/ifaddrs.c")
|
|
|
|
endif()
|
|
|
|
|
2024-06-12 11:11:43 +08:00
|
|
|
add_library(tile OBJECT ${TILE_SRCS})
|
2024-06-11 19:13:30 +08:00
|
|
|
set_target_properties(tile PROPERTIES VERSION ${PROJECT_VERSION}
|
2024-06-17 22:46:00 +08:00
|
|
|
target_precompile_headers(tile PUBLIC inja/inja.h)
|
|
|
|
target_precompile_headers(tile PUBLIC inja/string_view.h)
|
|
|
|
target_precompile_headers(tile PUBLIC json/nlohann/json.hpp)
|
2024-06-11 19:13:30 +08:00
|
|
|
SOVERSION "${tile_VERSION_MAJRO}")
|
|
|
|
# target_sources(tile PRIVATE ${TILE_SRCS})
|
|
|
|
target_include_directories(
|
|
|
|
tile
|
2024-07-27 12:53:30 +08:00
|
|
|
PUBLIC
|
2024-07-30 15:26:10 +08:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/mustache.hpp"
|
2024-07-27 12:53:30 +08:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
2024-06-11 19:13:30 +08:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/include"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/third_party/glog"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/glog/src"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
2024-06-14 12:31:48 +08:00
|
|
|
${THIRD_PARTY_INCLUDE_DIRS}
|
2024-06-11 19:13:30 +08:00
|
|
|
RPIVATE
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include")
|
|
|
|
|
|
|
|
target_link_libraries(
|
|
|
|
tile
|
|
|
|
PUBLIC # -Wl,--start-group
|
2024-06-16 21:07:45 +08:00
|
|
|
nova_context zlib gflags::gflags glog::glog
|
2024-06-20 21:17:12 +08:00
|
|
|
jsoncpp_static
|
2024-06-11 19:13:30 +08:00
|
|
|
# -Wl,--end-group
|
2024-06-16 21:07:45 +08:00
|
|
|
libcurl fmt)
|
2024-06-11 19:26:15 +08:00
|
|
|
if((CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64") OR (CMAKE_SYSTEM_PROCESSOR MATCHES
|
|
|
|
"mips*"))
|
2024-06-11 19:13:30 +08:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
target_link_libraries(tile PUBLIC atomic)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# set(LIB_NAMES tile)
|
|
|
|
#
|
|
|
|
# if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU) OR
|
|
|
|
# ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") OR ("${CMAKE_SYSTEM_NAME}"
|
|
|
|
# STREQUAL "GNU") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") OR
|
|
|
|
# ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia") OR ("${CMAKE_SYSTEM_NAME}"
|
|
|
|
# STREQUAL "DragonFly") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME:
|
|
|
|
# It should be "GNU ld # for elf" set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES}
|
|
|
|
# -Wl,--no-whole-archive) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
|
|
|
# set(LIB_NAMES -Wl,-all_load ${LIB_NAMES}) endif()
|
|
|
|
|
|
|
|
add_library(tile::tile ALIAS tile)
|
|
|
|
# add_library(tile SHARED $<TARGET_OBJECTS:tile>) target_include_directories(
|
|
|
|
# tile PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/include"
|
|
|
|
# "${CMAKE_CURRENT_BINARY_DIR}/third_party/glog"
|
|
|
|
# "${CMAKE_CURRENT_SOURCE_DIR}/third_party/glog/src"
|
|
|
|
# "${CMAKE_CURRENT_SOURCE_DIR}" RPIVATE
|
|
|
|
# "${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include")
|
|
|
|
# target_link_libraries( tile PRIVATE ${WHOLE_ARCHIVE_PREFIX} gflags::gflags
|
|
|
|
# glog::glog libcurl fmt::fmt ${NO_WHOLE_ARCHIVE_PREFIX})
|
|
|
|
|
|
|
|
if(TILE_BUILD_TESTS)
|
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
add_executable(tile_test_all "tile/testing/main.cc")
|
|
|
|
target_link_libraries(tile_test_all PRIVATE gtest gmock tile::tile)
|
2024-06-29 16:13:22 +08:00
|
|
|
|
|
|
|
macro(tile_add_custom_test test_name test_file)
|
2024-06-11 19:13:30 +08:00
|
|
|
add_executable(${test_name} ${test_file} "tile/testing/main.cc")
|
|
|
|
target_link_libraries(
|
|
|
|
${test_name} PUBLIC gtest gmock ${WHOLE_ARCHIVE_PREFIX} tile::tile
|
|
|
|
${WHOLE_ARCHIVE_SUFFIX})
|
|
|
|
|
|
|
|
target_sources(${PROJECT_NAME}_test_all PRIVATE ${test_file})
|
|
|
|
endmacro()
|
|
|
|
|
2024-06-29 16:13:22 +08:00
|
|
|
macro(tile_add_test test_name test_file)
|
|
|
|
tile_add_custom_test(${test_name} ${test_file})
|
|
|
|
add_test(NAME ${test_name} COMMAND ${test_name})
|
|
|
|
endmacro()
|
|
|
|
|
2024-07-06 01:59:04 +08:00
|
|
|
tile_add_test(base_exposed_var_test "tile/base/exposed_var_test.cc")
|
|
|
|
tile_add_test(fiber_detail_scheduler_test "tile/fiber/detail/scheduler_test.cc")
|
2024-06-11 19:13:30 +08:00
|
|
|
tile_add_test(base_internal_meta_test "tile/base/internal/meta_test.cc")
|
|
|
|
# tile_add_test(net_internal_http_engine_test
|
2024-06-11 19:26:15 +08:00
|
|
|
# "tile/net/internal/http_engine_test.cc")
|
2024-06-11 19:13:30 +08:00
|
|
|
tile_add_test(net_internal_http_task_test
|
|
|
|
"tile/net/internal/http_task_test.cc")
|
|
|
|
tile_add_test(net_http_http_client_test "tile/net/http/http_client_test.cc")
|
|
|
|
tile_add_test(net_http_http_request_test "tile/net/http/http_reqeust_test.cc")
|
|
|
|
tile_add_test(net_http_http_response_test
|
|
|
|
"tile/net/http/http_response_test.cc")
|
|
|
|
tile_add_test(base_compression_util_test "tile/base/compression/util_test.cc")
|
|
|
|
tile_add_test(rpc_protocol_http_buffer_io_test
|
|
|
|
"tile/rpc/protocol/http/buffer_io_test.cc")
|
|
|
|
|
|
|
|
tile_add_test(base_compression_test "tile/base/compression_test.cc")
|
|
|
|
tile_add_test(base_casting_test "tile/base/casting_test.cc")
|
|
|
|
tile_add_test(base_future_future_test "tile/base/future/future_test.cc")
|
|
|
|
tile_add_test(base_future_boxed_test "tile/base/future/boxed_test.cc")
|
|
|
|
tile_add_test(base_option_option_service_test
|
|
|
|
"tile/base/option/option_service_test.cc")
|
|
|
|
tile_add_test(base_ref_ptr_test "tile/base/ref_ptr_test.cc")
|
|
|
|
tile_add_test(base_object_pool_disabled_test
|
|
|
|
"tile/base/object_pool/disabled_test.cc")
|
|
|
|
tile_add_test(base_object_pool_types_test
|
|
|
|
"tile/base/object_pool/types_test.cc")
|
|
|
|
tile_add_test(base_string_test "tile/base/string_test.cc")
|
|
|
|
tile_add_test(base_deferred_test "tile/base/deferred_test.cc")
|
|
|
|
tile_add_test(base_internal_singly_linked_list_test
|
|
|
|
"tile/base/internal/singly_linked_list_test.cc")
|
|
|
|
tile_add_test(base_internal_move_on_copy_test
|
|
|
|
"tile/base/internal/move_on_copy_test.cc")
|
|
|
|
tile_add_test(base_internal_thread_pool_test
|
|
|
|
"tile/base/internal/thread_pool_test.cc")
|
|
|
|
tile_add_test(base_internal_format_test "tile/base/internal/format_test.cc")
|
|
|
|
tile_add_test(base_internal_background_task_host_test
|
|
|
|
"tile/base/internal/background_task_host_test.cc")
|
|
|
|
tile_add_test(base_down_cast_test "tile/base/down_cast_test.cc")
|
|
|
|
tile_add_test(base_encoding_hex_test "tile/base/encoding/hex_test.cc")
|
|
|
|
tile_add_test(base_encoding_percent_test "tile/base/encoding/percent_test.cc")
|
|
|
|
tile_add_test(base_encoding_base64_test "tile/base/encoding/base64_test.cc")
|
|
|
|
tile_add_test(base_internal_case_insensitive_hash_map_test
|
|
|
|
"tile/base/internal/case_insensitive_hash_map_test.cc")
|
|
|
|
tile_add_test(net_http_http_headers_test "tile/net/http/http_headers_test.cc")
|
|
|
|
tile_add_test(base_demangle_test "tile/base/demangle_test.cc")
|
|
|
|
tile_add_test(base_option_json_parser_test
|
|
|
|
"tile/base/option/json_parser_test.cc")
|
|
|
|
tile_add_test(base_option_key_test "tile/base/option/key_test.cc")
|
|
|
|
tile_add_test(base_dependency_registry_test
|
|
|
|
"tile/base/dependency_registry_test.cc")
|
|
|
|
tile_add_test(base_maybe_owning_test "tile/base/maybe_owning_test.cc")
|
|
|
|
tile_add_test(base_status_test "tile/base/status_test.cc")
|
|
|
|
tile_add_test(base_net_endpoint_test "tile/base/net/endpoint_test.cc")
|
|
|
|
tile_add_test(base_handle_test "tile/base/handle_test.cc")
|
|
|
|
tile_add_test(base_thread_scoped_lock_test
|
|
|
|
"tile/base/thread/scoped_lock_test.cc")
|
|
|
|
tile_add_test(base_thread_spinlock_test "tile/base/thread/spinlock_test.cc")
|
|
|
|
tile_add_test(base_thread_unique_lock_test
|
|
|
|
"tile/base/thread/unique_lock_test.cc")
|
|
|
|
tile_add_test(base_thread_cond_var_test "tile/base/thread/cond_var_test.cc")
|
|
|
|
tile_add_test(base_thread_latch_test "tile/base/thread/latch_test.cc")
|
|
|
|
# tile_add_test(fiber_ucontext_test "tile/fiber/ucontext_test.cc")
|
|
|
|
|
|
|
|
tile_add_test(init_on_init_test "tile/init/on_init_test.cc")
|
|
|
|
tile_add_test(base_buffer_test "tile/base/buffer_test.cc")
|
|
|
|
tile_add_test(base_object_pool_thread_local_test
|
|
|
|
"tile/base/object_pool/thread_local_test.cc")
|
|
|
|
tile_add_test(base_internal_logging_test "tile/base/internal/logging_test.cc")
|
|
|
|
tile_add_test(base_chrono_test "tile/base/chrono_test.cc")
|
|
|
|
tile_add_test(init_override_flag_test "tile/init/override_flag_test.cc")
|
2024-06-29 16:13:22 +08:00
|
|
|
tile_add_custom_test("custom_http_client_test" "tests/http_client_test.cc")
|
2024-06-11 19:13:30 +08:00
|
|
|
# tile_add_test(base_internal_time_keeper_test
|
|
|
|
# "tile/base/internal/time_keeper_test.cc")
|
|
|
|
endif(TILE_BUILD_TESTS)
|
|
|
|
|
|
|
|
if(TILE_BUILD_BENCHMARKS)
|
|
|
|
add_subdirectory("third_party/benchmark")
|
|
|
|
|
|
|
|
add_executable(tile_bm_all "tile/testing/bm_main.cc")
|
|
|
|
target_link_libraries(tile_bm_all PRIVATE benchmark::benchmark tile::tile)
|
|
|
|
|
|
|
|
macro(tile_add_bm benchmark_name benchmark_file)
|
|
|
|
add_executable(${benchmark_name} ${benchmark_file}
|
|
|
|
"tile/testing/bm_main.cc")
|
|
|
|
target_link_libraries(${benchmark_name} PRIVATE benchmark::benchmark
|
|
|
|
tile::tile)
|
|
|
|
|
|
|
|
target_sources(tile_bm_all PRIVATE ${benchmark_file})
|
|
|
|
endmacro()
|
|
|
|
|
2024-06-17 22:46:00 +08:00
|
|
|
tile_add_bm(fiber_detail_fiber_benchmark "tile/fiber/detail/fiber_benchmark.cc")
|
2024-06-11 19:13:30 +08:00
|
|
|
tile_add_bm(base_casting_benchmark "tile/base/casting_benchmark.cc")
|
|
|
|
tile_add_bm(base_thread_mutex_benchmark "tile/base/thread/mutex_benchmark.cc")
|
|
|
|
tile_add_bm(base_encoding_benchmark "tile/base/encoding_benchmark.cc")
|
|
|
|
tile_add_bm(base_internal_time_keeper_benchmark
|
|
|
|
"tile/base/internal/time_keeper_benchmark.cc")
|
|
|
|
tile_add_bm(base_chrono_benchmark "tile/base/chrono_benchmark.cc")
|
|
|
|
endif(TILE_BUILD_BENCHMARKS)
|