From f4603f3b72e0c66693ac5c0560ba9e844058180b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Ho=CC=88ner?= Date: Thu, 27 Jun 2019 16:13:56 +0200 Subject: [PATCH] Use gimli on Linux, coresym on macOS Fixes source printing after switching the working dir to something != the root source directory by ditching libbacktrace. Resolves #2 --- Cargo.toml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c52ce29..ab6baeb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,15 @@ keywords = [ ] [dependencies] -backtrace = "0.3" term = "0.5" atty = "0.2" + +[target.'cfg(target_os="linux")'.dependencies] +backtrace = { version = "0.3", features = ["gimli-symbolize"] } + +[target.'cfg(target_os="macos")'.dependencies] +backtrace = { version = "0.3", features = ["coresymbolication"] } + +[target.'cfg(not(any(target_os="macos", target_os="linux")))'.dependencies] +backtrace = { version = "0.3" } +