Skip to content

Commit

Permalink
Ensure crashpad targets are included when building as a shared libr…
Browse files Browse the repository at this point in the history
…ary using our exported CMake config

Also, in the exported CMake config, Use `find_dependency()` instead of `find_package()`.

---------

Co-authored-by: wojciech minko <minko@quicktrurnstudio.com>
Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
  • Loading branch information
3 people authored Jun 11, 2024
1 parent a05b260 commit 0de14cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

**Fixes**:

- Fix `crashpad` build for Windows ARM64 via LLVM-MINGW. ([#1003](https://github.com/getsentry/sentry-native/pull/1003), [crashpad#101](https://github.com/getsentry/crashpad/pull/101))
- Remove remaining build blockers for the `crashpad` backend on Windows ARM64 when using LLVM-MINGW. ([#1003](https://github.com/getsentry/sentry-native/pull/1003), [crashpad#101](https://github.com/getsentry/crashpad/pull/101))
- Ensure `crashpad` targets are included when building as a shared library using our exported CMake config. ([#1007](https://github.com/getsentry/sentry-native/pull/1007))
- Use `find_dependency()` instead of `find_package()` in the exported CMake config. ([#1007](https://github.com/getsentry/sentry-native/pull/1007))

**Thank you**:

- [@past-due](https://github.com/past-due)
- [@podlaszczyk](https://github.com/podlaszczyk)

## 0.7.5

Expand Down
10 changes: 5 additions & 5 deletions sentry-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ set(SENTRY_TRANSPORT @SENTRY_TRANSPORT@)
set(SENTRY_BUILD_SHARED_LIBS @SENTRY_BUILD_SHARED_LIBS@)
set(SENTRY_LINK_PTHREAD @SENTRY_LINK_PTHREAD@)

if(SENTRY_BACKEND STREQUAL "crashpad" AND NOT SENTRY_BUILD_SHARED_LIBS)
if(SENTRY_BACKEND STREQUAL "crashpad")
include("${CMAKE_CURRENT_LIST_DIR}/sentry_crashpad-targets.cmake")
if(NOT MSVC AND NOT SENTRY_BUILD_SHARED_LIBS)
find_package(ZLIB REQUIRED)
find_dependency(ZLIB REQUIRED)
endif()
endif()

if(SENTRY_BACKEND STREQUAL "breakpad" AND NOT SENTRY_BUILD_SHARED_LIBS)
set(SENTRY_BREAKPAD_SYSTEM @SENTRY_BREAKPAD_SYSTEM@)
if(SENTRY_BREAKPAD_SYSTEM)
find_package(PkgConfig REQUIRED)
find_dependency(PkgConfig REQUIRED)
pkg_check_modules(BREAKPAD REQUIRED IMPORTED_TARGET breakpad-client)
endif()
endif()

include("${CMAKE_CURRENT_LIST_DIR}/sentry-targets.cmake")

if(SENTRY_TRANSPORT STREQUAL "curl" AND (NOT @BUILD_SHARED_LIBS@ OR NOT SENTRY_BUILD_SHARED_LIBS))
find_package(CURL REQUIRED)
find_dependency(CURL REQUIRED)
set_property(TARGET sentry::sentry APPEND
PROPERTY INTERFACE_LINK_LIBRARIES ${CURL_LIBRARIES})
endif()

if(SENTRY_LINK_PTHREAD AND NOT SENTRY_BUILD_SHARED_LIBS)
find_package(Threads REQUIRED)
find_dependency(Threads REQUIRED)
endif()

0 comments on commit 0de14cc

Please sign in to comment.