Repository navigation
feat: Add pkg-config support - #1411
Merged
Merged
Conversation
nmandelblit
force-pushed
the
add-pc-pkgconfig
branch
from
October 10, 2025 10:36
610a789 to
67ba9b8
Compare
nmandelblit
force-pushed
the
add-pc-pkgconfig
branch
3 times, most recently
from
October 10, 2025 13:44
c4b2054 to
7582025
Compare
- Added support for generating and installing a .pc file for pkg-config - Controlled by the SENTRY_INSTALL_PKGCONFIG CMake option - Uses CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR to support non-standard layouts (e.g., lib64) - Installs the generated file to the standard pkg-config directory
jpnurmi
force-pushed
the
add-pc-pkgconfig
branch
from
October 16, 2026 07:30
7582025 to
ae9f697
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1 #1411 +/- ##
=======================================
Coverage 76.16% 76.16%
=======================================
Files 104 104
Lines 29856 29856
Branches 5545 5545
=======================================
Hits 22741 22741
+ Misses 5743 5731 -12
- Partials 1372 1384 +12 🚀 New features to boost your workflow:
|
Export `bindir` in `sentry.pc` so consumers can locate the installed crash handler. Honor `CMAKE_INSTALL_BINDIR` when installing the native handler and its Windows companion so the metadata matches the layout. Add a standalone consumer that links through pkg-config and initializes the default backend using the installed handler and a writable database directory.
mujacica
approved these changes
Oct 20, 2026
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 153b17c. Configure here.
A static `libsentry` needs its full private link graph, including vendored backend archives, system libraries and the C++ runtime. The CMake package already exports that graph. Install `sentry.pc` only for shared builds, where `-lsentry` is complete.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
.pcfile for pkg-configSENTRY_INSTALL_PKGCONFIGCMake optionCMAKE_INSTALL_LIBDIR,CMAKE_INSTALL_INCLUDEDIR, andCMAKE_INSTALL_BINDIRin the generated metadatabindirso consumers can locate the installed crash handler; the native handler installation also honorsCMAKE_INSTALL_BINDIR${CMAKE_INSTALL_LIBDIR}/pkgconfig)Benefits
This allows downstream projects to easily discover and link against sentry-native using pkg-config:
And for backends with out-of-process handlers, the path for
sentry_options_set_handler_path()can be resolved by querying bindir:Test plan
SENTRY_INSTALL_PKGCONFIGenabledsentry.pcfile is generated in build directorysentry.pcfile is installed to correct location