feat: add platform integration hook - #2005
Conversation
Allow downstream platform SDKs to register an integration without replacing sentry_init(). Add an integration fixture that verifies a mixture of SDK metadata, platform scope data, and application event data.
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- add platform integration hook ([#2005](https://github.com/getsentry/sentry-native/pull/2005))If none of the above apply, you can opt out of this check by adding |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 958c654. Configure here.
|
|
||
| if(NOT SENTRY_INTEGRATION_PLATFORM STREQUAL "") | ||
| target_compile_definitions(sentry PRIVATE SENTRY_INTEGRATION_PLATFORM) | ||
| endif() |
There was a problem hiding this comment.
Platform define stays private
Medium Severity
SENTRY_INTEGRATION_PLATFORM is added as a PRIVATE compile definition on sentry, so downstream translation units never see it. The extern "C" declaration of sentry_integration_platform_new in sentry_integration.h is therefore hidden from C++ platform SDKs, which will emit a mangled symbol the C library cannot resolve. Consumers also still see sentry__native_init in sentry_core.h even though the library now exports sentry_init.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 958c654. Configure here.


Adds a
SENTRY_INTEGRATION_PLATFORMbuild option for console SDKs.When enabled, sentry-native automatically creates the downstream-provided platform integration via
sentry_integration_platform_new(). This lets sentry-playstation, sentry-switch, and sentry-xbox move platform-specific initialization into a platform integration without wrappingsentry__native_init().