Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions crates/symbolicator-crash/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ use std::path::{Path, PathBuf};
use std::process::Command;

fn main() {
// sentry-native dependencies
match std::env::var("CARGO_CFG_TARGET_OS").unwrap().as_str() {
"macos" => println!("cargo:rustc-link-lib=dylib=c++"),
"linux" => println!("cargo:rustc-link-lib=dylib=stdc++"),
_ => return, // allow building with --all-features, fail during runtime
}

if !Path::new("sentry-native/.git").exists() {
let _ = Command::new("git")
.args(["submodule", "update", "--init", "--recursive"])
Expand All @@ -18,8 +11,8 @@ fn main() {
let destination = cmake::Config::new("sentry-native")
// we never need a debug build of sentry-native
.profile("RelWithDebInfo")
// always build breakpad regardless of platform defaults
.define("SENTRY_BACKEND", "breakpad")
// use the sentry native crash reporting backend
.define("SENTRY_BACKEND", "native")
// inject a custom transport instead of curl
.define("SENTRY_TRANSPORT", "none")
// build a static library
Expand All @@ -36,7 +29,9 @@ fn main() {
"cargo:rustc-link-search=native={}",
destination.join("lib").display()
);
println!("cargo:rustc-link-lib=static=breakpad_client");
if std::env::var("CARGO_CFG_TARGET_OS").unwrap().as_str() == "linux" {
println!("cargo:rustc-link-lib=static=unwind");
}
println!("cargo:rustc-link-lib=static=sentry");

let bindings = bindgen::Builder::default()
Expand Down
Loading