Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use crash handler code from the crashpad library #62

Merged
merged 6 commits into from
May 31, 2024
Merged
15 changes: 11 additions & 4 deletions handler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ if (ANDROID)
crashpad_handler_main.cc
)
endif (ANDROID)
# Used to implement a work-around for launching the Crashpad handler stored in an APK.
if (ANDROID)
add_library(handlerlib STATIC ${CRASHPAD_HANDLER_LIBRARY_FILES})
target_compile_features(handlerlib PUBLIC cxx_std_17)
target_link_libraries(handlerlib PRIVATE client tools compat snapshot minidump)
target_include_directories(handlerlib PUBLIC ..)
endif(ANDROID)

add_executable(handler main.cc)
target_sources(handler PRIVATE ${CRASHPAD_HANDLER_LIBRARY_FILES})
Expand All @@ -68,9 +75,9 @@ endif (WIN32)
if (ANDROID)
if (CUSTOM_CRASHPAD_HANDLER_DESTINATION)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should CUSTOM_CRASHPAD_HANDLER_DESTINATION be supported for the static library as well?

add_custom_command(TARGET handler POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:handler>
${CUSTOM_CRASHPAD_HANDLER_DESTINATION}
COMMAND ${CMAKE_COMMAND} -E copy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) These changes seem unnecessary in this PR.

$<TARGET_FILE:handler>
${CUSTOM_CRASHPAD_HANDLER_DESTINATION}
)
endif (CUSTOM_CRASHPAD_HANDLER_DESTINATION)
endif (ANDROID)
endif (ANDROID)
Loading