Skip to content

Commit

Permalink
Sentry-Native
Browse files Browse the repository at this point in the history
-code reformat fix "= text" -> "=text"
-confirm sentry-native install is present
-use IMPORTED_TARGET for libunwind
-update README
-clean up

Signed-off-by: Joel Winarske <[email protected]>
  • Loading branch information
jwinarske committed Dec 10, 2023
1 parent b1a6cef commit 5ab78a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ ivi-homescreen build

git clone https://github.com/toyota-connected/ivi-homescreen
mkdir build && cd build
CC=/usr/lib/llvm-14/bin/clang CXX=/usr/lib/llvm-14/bin/clang++ cmake .. -DBUILD_CRASH_HANDLER=ON -DCRASH_HANDLER_DSN="dsn from your account" -DLLVM_ROOT=/usr/lib/llvm-14
cmake .. -DBUILD_CRASH_HANDLER=ON -DCRASH_HANDLER_DSN="dsn from your account"
make -j
LD_LIBRARY_PATH=<sentry staged sysroot install path>/lib homescreen --b=<your bundle folder> --f

Expand Down
9 changes: 8 additions & 1 deletion cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,17 @@ endif ()
#
option(BUILD_CRASH_HANDLER "Build Crash Handler" OFF)
if (BUILD_CRASH_HANDLER)
if (NOT EXISTS ${SENTRY_NATIVE_LIBDIR}/cmake/sentry/sentry-config.cmake)
message(FATAL_ERROR "${SENTRY_NATIVE_LIBDIR}/cmake/sentry/sentry-config.cmake does not exist")
endif ()
set(sentry_DIR ${SENTRY_NATIVE_LIBDIR}/cmake/sentry)
find_package(sentry REQUIRED)
find_package(PkgConfig)
pkg_check_modules(UNWIND REQUIRED IMPORTED_TARGET libunwind)
add_compile_definitions(
BUILD_CRASH_HANDLER
CRASH_HANDLER_DSN="${CRASH_HANDLER_DSN}"
CRASH_HANDLER_RELEASE= "${PROJECT_NAME}@${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
CRASH_HANDLER_RELEASE="${PROJECT_NAME}@${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
else ()
add_compile_definitions(
CRASH_HANDLER_DSN=""
Expand Down
7 changes: 1 addition & 6 deletions shell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ if (BUILD_BACKEND_WAYLAND_VULKAN)
target_link_libraries(homescreen PRIVATE bluevk)
endif ()
if (BUILD_CRASH_HANDLER)
target_link_libraries(homescreen PRIVATE sentry::sentry)
target_link_libraries(homescreen PRIVATE sentry::sentry PkgConfig::UNWIND)
endif ()

target_link_libraries(homescreen PRIVATE
Expand All @@ -149,11 +149,6 @@ target_link_libraries(homescreen PRIVATE
${PLUGIN_SECURE_STORAGE_LINK_LIBRARIES}
)

if (BUILD_CRASH_HANDLER)
target_link_libraries(homescreen PRIVATE unwind)
endif ()


target_link_directories(homescreen PRIVATE
${CMAKE_BINARY_DIR}
)
Expand Down
4 changes: 0 additions & 4 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ endif ()

add_sanitizers(flutter)

if (BUILD_CRASH_HANDLER)
find_package(sentry REQUIRED GLOBAL)
endif ()

set(SPDLOG_NO_EXCEPTIONS ON)
set(SPDLOG_NO_THREAD_ID ON)
set(SPDLOG_BUILD_PIC ON)
Expand Down

0 comments on commit 5ab78a1

Please sign in to comment.