From b9071381ae600c6ccbbccb117af8eaf537b30eb6 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 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ee5c5e3..983835b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,14 +16,19 @@ keywords = [ "pretty", ] +[features] +failure-bt = ["failure"] + [dependencies] -backtrace = "0.3" term = "0.5" atty = "0.2" +failure = { version = "0.1", optional = true } -[features] -failure-bt = ["failure"] +[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"] } -[dependencies.failure] -optional = true -version = "0.1.5" +[target.'cfg(not(any(target_os="macos", target_os="linux")))'.dependencies] +backtrace = { version = "0.3" }