Skip to content

Commit

Permalink
(#16530) sentry-native: Add option to enable the WER module support o…
Browse files Browse the repository at this point in the history
…f crashpad

* sentry-native: Add option to enable the WER module support of crashpad

* sentry-native: Use patch from getsentry/sentry-native#816 instead
  • Loading branch information
Cyriuz authored Mar 24, 2023
1 parent 1c22a5a commit 3076508
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
6 changes: 6 additions & 0 deletions recipes/sentry-native/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ sources:
"0.4.18":
url: "https://github.com/getsentry/sentry-native/releases/download/0.4.18/sentry-native.zip"
sha256: "41fdf6499cd8576142beb03104badcc9e0b80b8ef27080ca71cd4408cc1d7ece"
patches:
"0.6.0":
- patch_file: "patches/sentry-native-903c17a.patch"
patch_description: "Make it possible to build with support for the crashpad WER module while using the sentry-crashpad package"
patch_type: "official"
patch_source: "https://github.com/getsentry/sentry-native/pull/816"
9 changes: 8 additions & 1 deletion recipes/sentry-native/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import copy, get, rm, rmdir
from conan.tools.files import copy, get, rm, rmdir, export_conandata_patches, apply_conandata_patches
from conan.tools.gnu import PkgConfigDeps
from conan.tools.scm import Version
import os
Expand Down Expand Up @@ -34,6 +34,7 @@ class SentryNativeConan(ConanFile):
"qt": [True, False],
"with_crashpad": ["google", "sentry"],
"with_breakpad": ["google", "sentry"],
"wer" : [True, False],
}
default_options = {
"shared": False,
Expand All @@ -43,6 +44,7 @@ class SentryNativeConan(ConanFile):
"qt": False,
"with_crashpad": "sentry",
"with_breakpad": "sentry",
"wer": False
}

@property
Expand All @@ -59,6 +61,9 @@ def _minimum_compilers_version(self):
"apple-clang": "5.1",
}

def export_sources(self):
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand Down Expand Up @@ -155,12 +160,14 @@ def generate(self):
tc.variables["SENTRY_TRANSPORT"] = self.options.transport
tc.variables["SENTRY_PIC"] = self.options.get_safe("fPIC", True)
tc.variables["SENTRY_INTEGRATION_QT"] = self.options.qt
tc.variables["CRASHPAD_WER_ENABLED"] = self.options.wer
tc.generate()
CMakeDeps(self).generate()
if self.options.backend == "breakpad":
PkgConfigDeps(self).generate()

def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down
34 changes: 34 additions & 0 deletions recipes/sentry-native/all/patches/sentry-native-903c17a.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 903c17ae20888679caab1871cc74de577509452e Mon Sep 17 00:00:00 2001
From: Cyriuz <Cyriuz@users.noreply.github.com>
Date: Mon, 13 Mar 2023 14:55:26 +0100
Subject: [PATCH] Allow setting CRASHPAD_WER_ENABLED when using system crashpad
(#816)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 831e8e1..aeea09f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -426,8 +426,9 @@ if(SENTRY_BACKEND_CRASHPAD)
set(CRASHPAD_ENABLE_INSTALL ON CACHE BOOL "Enable crashpad installation" FORCE)
endif()
add_subdirectory(external/crashpad crashpad_build)
+
if(CRASHPAD_WER_ENABLED)
- add_compile_definitions(CRASHPAD_WER_ENABLED)
+ add_dependencies(sentry crashpad::wer)
endif()

# set static runtime if enabled
@@ -482,8 +483,9 @@ if(SENTRY_BACKEND_CRASHPAD)
endif()
endif()
add_dependencies(sentry crashpad::handler)
+
if(CRASHPAD_WER_ENABLED)
- add_dependencies(sentry crashpad::wer)
+ add_compile_definitions(CRASHPAD_WER_ENABLED)
endif()
elseif(SENTRY_BACKEND_BREAKPAD)
option(SENTRY_BREAKPAD_SYSTEM "Use system breakpad" OFF)
--
2.39.1.windows.1

0 comments on commit 3076508

Please sign in to comment.