Skip to content

Commit

Permalink
cargo: add metadata to build as a dep of libstd
Browse files Browse the repository at this point in the history
This commit adds the necessary `Cargo.toml` directives which enables
this crate to build with the standard library. This introduces some
optional off-by-deault dependencies which are only activated (and
overwritten) when built as part of the standard library.

Ref rust-lang/backtrace-rs#432

PR #89
  • Loading branch information
alexcrichton committed Aug 18, 2021
1 parent 186ac04 commit 58f29ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: ci
on:
pull_request:
branches:
- master
push:
branches:
- master
Expand Down
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ std = []
# then, it is alias for the 'std' feature.
use_std = ["std"]

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
rustc-dep-of-std = ['core', 'compiler_builtins']

[dependencies]
libc = { version = "0.2.18", default-features = false, optional = true }

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
core = { version = '1.0.0', optional = true, package = 'rustc-std-workspace-core' }
compiler_builtins = { version = '0.1.2', optional = true }

[dev-dependencies]
quickcheck = { version = "1.0.3", default-features = false }

Expand Down

0 comments on commit 58f29ad

Please sign in to comment.