2023-01-03 18:35:24 +00:00
|
|
|
if (NOT OS_FREEBSD AND NOT (OS_DARWIN AND COMPILER_CLANG))
|
2022-01-17 22:08:35 +00:00
|
|
|
option (ENABLE_SENTRY "Enable Sentry" ${ENABLE_LIBRARIES})
|
|
|
|
else()
|
|
|
|
option (ENABLE_SENTRY "Enable Sentry" OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT ENABLE_SENTRY)
|
|
|
|
message(STATUS "Not using sentry")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2021-11-21 15:43:06 +00:00
|
|
|
set (SRC_DIR "${ClickHouse_SOURCE_DIR}/contrib/sentry-native")
|
|
|
|
|
|
|
|
set (SRCS
|
|
|
|
${SRC_DIR}/vendor/mpack.c
|
|
|
|
${SRC_DIR}/src/sentry_alloc.c
|
|
|
|
${SRC_DIR}/src/sentry_backend.c
|
|
|
|
${SRC_DIR}/src/sentry_core.c
|
|
|
|
${SRC_DIR}/src/sentry_database.c
|
|
|
|
${SRC_DIR}/src/sentry_envelope.c
|
|
|
|
${SRC_DIR}/src/sentry_json.c
|
|
|
|
${SRC_DIR}/src/sentry_logger.c
|
|
|
|
${SRC_DIR}/src/sentry_options.c
|
|
|
|
${SRC_DIR}/src/sentry_random.c
|
|
|
|
${SRC_DIR}/src/sentry_ratelimiter.c
|
|
|
|
${SRC_DIR}/src/sentry_scope.c
|
|
|
|
${SRC_DIR}/src/sentry_session.c
|
|
|
|
${SRC_DIR}/src/sentry_slice.c
|
|
|
|
${SRC_DIR}/src/sentry_string.c
|
|
|
|
${SRC_DIR}/src/sentry_sync.c
|
|
|
|
${SRC_DIR}/src/sentry_transport.c
|
|
|
|
${SRC_DIR}/src/sentry_utils.c
|
|
|
|
${SRC_DIR}/src/sentry_uuid.c
|
|
|
|
${SRC_DIR}/src/sentry_value.c
|
|
|
|
${SRC_DIR}/src/path/sentry_path.c
|
|
|
|
${SRC_DIR}/src/transports/sentry_disk_transport.c
|
|
|
|
${SRC_DIR}/src/transports/sentry_function_transport.c
|
|
|
|
${SRC_DIR}/src/unwinder/sentry_unwinder.c
|
|
|
|
${SRC_DIR}/src/sentry_unix_pageallocator.c
|
|
|
|
${SRC_DIR}/src/path/sentry_path_unix.c
|
|
|
|
${SRC_DIR}/src/symbolizer/sentry_symbolizer_unix.c
|
|
|
|
${SRC_DIR}/src/transports/sentry_transport_curl.c
|
|
|
|
${SRC_DIR}/src/backends/sentry_backend_none.c
|
|
|
|
)
|
|
|
|
|
2021-11-25 23:03:04 +00:00
|
|
|
if(APPLE)
|
|
|
|
list(APPEND SRCS ${SRC_DIR}/src/modulefinder/sentry_modulefinder_apple.c)
|
|
|
|
else()
|
|
|
|
list(APPEND SRCS ${SRC_DIR}/src/modulefinder/sentry_modulefinder_linux.c)
|
|
|
|
endif()
|
|
|
|
|
2022-01-20 14:26:30 +00:00
|
|
|
add_library(_sentry ${SRCS})
|
2021-11-21 15:43:06 +00:00
|
|
|
|
2023-01-03 18:35:24 +00:00
|
|
|
target_compile_definitions(_sentry PUBLIC SENTRY_BUILD_STATIC)
|
2021-11-21 15:43:06 +00:00
|
|
|
|
2022-01-20 14:26:30 +00:00
|
|
|
target_link_libraries(_sentry PRIVATE ch_contrib::curl pthread)
|
|
|
|
target_include_directories(_sentry PUBLIC "${SRC_DIR}/include" PRIVATE "${SRC_DIR}/src")
|
|
|
|
target_compile_definitions(_sentry PRIVATE SENTRY_WITH_INPROC_BACKEND SIZEOF_LONG=8)
|
2022-01-17 22:08:35 +00:00
|
|
|
|
2022-01-20 14:26:30 +00:00
|
|
|
add_library(ch_contrib::sentry ALIAS _sentry)
|