Skip to content

Commit

Permalink
[sentry-native] Enable arm64 on macOS (#18184)
Browse files Browse the repository at this point in the history
* [sentry-native] Enable arm64 on macOS

* [sentry-native] x-add-version

* [sentry-native] Fix build issue with libcurl and crashpad for *-osx-dynamic

* [sentry-native] x-add-version
  • Loading branch information
vejmartin committed Jun 3, 2021
1 parent d97e159 commit 5f32a49
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
19 changes: 19 additions & 0 deletions ports/sentry-native/fix-libcurl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a74a93..30c131c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,13 +249,7 @@ target_compile_definitions(sentry PRIVATE SIZEOF_LONG=${CMAKE_SIZEOF_LONG})

if(SENTRY_TRANSPORT_CURL)
find_package(CURL REQUIRED)
- target_include_directories(sentry PRIVATE ${CURL_INCLUDE_DIR})
- # The exported sentry target must not contain any path of the build machine, therefore use generator expressions
- # FIXME: cmake 3.12 introduced the target CURL::libcurl
- string(REPLACE ";" "$<SEMICOLON>" GENEX_CURL_LIBRARIES "${CURL_LIBRARIES}")
- string(REPLACE ";" "$<SEMICOLON>" GENEX_CURL_COMPILE_DEFINITIONS "${CURL_COMPILE_DEFINITIONS}")
- target_link_libraries(sentry PRIVATE $<BUILD_INTERFACE:${GENEX_CURL_LIBRARIES}>)
- target_compile_definitions(sentry PRIVATE $<BUILD_INTERFACE:${GENEX_CURL_COMPILE_DEFINITIONS}>)
+ target_link_libraries(sentry PRIVATE CURL::libcurl)
endif()

set_property(TARGET sentry PROPERTY C_VISIBILITY_PRESET hidden)
7 changes: 5 additions & 2 deletions ports/sentry-native/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP")
if(NOT VCPKG_TARGET_IS_OSX)
vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP")
endif()

vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/getsentry/sentry-native/releases/download/0.4.9/sentry-native.zip"
Expand All @@ -13,6 +15,7 @@ vcpkg_extract_source_archive_ex(
PATCHES
fix-warningC5105.patch
fix-config-cmake.patch
fix-libcurl.patch
)

if (NOT DEFINED SENTRY_BACKEND)
Expand Down Expand Up @@ -44,7 +47,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/sentry TARGET_PATH share/sentry)

if (WIN32 AND SENTRY_BACKEND STREQUAL "crashpad")
if (SENTRY_BACKEND STREQUAL "crashpad")
vcpkg_copy_tools(
TOOL_NAMES crashpad_handler
AUTO_CLEAN
Expand Down
3 changes: 2 additions & 1 deletion ports/sentry-native/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "sentry-native",
"version-semver": "0.4.9",
"port-version": 1,
"description": "Sentry SDK for C, C++ and native applications.",
"homepage": "https://sentry.io/",
"supports": "!(arm | arm64 | uwp)",
"supports": "!(arm | (arm64 & !osx) | uwp)",
"dependencies": [
{
"name": "curl",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5674,7 +5674,7 @@
},
"sentry-native": {
"baseline": "0.4.9",
"port-version": 0
"port-version": 1
},
"septag-sx": {
"baseline": "2019-05-07-2",
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/sentry-native.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8200b5e337c4e6074c67a6a2398fa7bbbb3c2e4b",
"version-semver": "0.4.9",
"port-version": 1
},
{
"git-tree": "17febc7e743aa5a91308dd2afd46cec3ef4a6c36",
"version-semver": "0.4.9",
Expand Down

0 comments on commit 5f32a49

Please sign in to comment.