@@ -2,6 +2,13 @@ use std::path::{Path, PathBuf};
22use std:: process:: Command ;
33
44fn main ( ) {
5+ // sentry-native dependencies
6+ match std:: env:: var ( "CARGO_CFG_TARGET_OS" ) . unwrap ( ) . as_str ( ) {
7+ "macos" => println ! ( "cargo:rustc-link-lib=dylib=c++" ) ,
8+ "linux" => println ! ( "cargo:rustc-link-lib=dylib=stdc++" ) ,
9+ _ => return , // allow building with --all-features, fail during runtime
10+ }
11+
512 if !Path :: new ( "sentry-native/.git" ) . exists ( ) {
613 let _ = Command :: new ( "git" )
714 . args ( [ "submodule" , "update" , "--init" , "--recursive" ] )
@@ -11,8 +18,8 @@ fn main() {
1118 let destination = cmake:: Config :: new ( "sentry-native" )
1219 // we never need a debug build of sentry-native
1320 . profile ( "RelWithDebInfo" )
14- // use the sentry native crash reporting backend
15- . define ( "SENTRY_BACKEND" , "native " )
21+ // always build breakpad regardless of platform defaults
22+ . define ( "SENTRY_BACKEND" , "breakpad " )
1623 // inject a custom transport instead of curl
1724 . define ( "SENTRY_TRANSPORT" , "none" )
1825 // build a static library
@@ -29,9 +36,7 @@ fn main() {
2936 "cargo:rustc-link-search=native={}" ,
3037 destination. join( "lib" ) . display( )
3138 ) ;
32- if std:: env:: var ( "CARGO_CFG_TARGET_OS" ) . unwrap ( ) . as_str ( ) == "linux" {
33- println ! ( "cargo:rustc-link-lib=static=unwind" ) ;
34- }
39+ println ! ( "cargo:rustc-link-lib=static=breakpad_client" ) ;
3540 println ! ( "cargo:rustc-link-lib=static=sentry" ) ;
3641
3742 let bindings = bindgen:: Builder :: default ( )
0 commit comments