cleanup cargo optional dep: in features

This commit is contained in:
Yuri Astrakhan 2023-06-16 19:11:13 -04:00
parent 22173e4881
commit a187e6e1da
4 changed files with 10 additions and 10 deletions

View File

@ -62,10 +62,10 @@ jobs:
rustup target add aarch64-apple-darwin
# compile without debug symbols
RUSTFLAGS='-C link-arg=-s' cargo build --release --target ${{ matrix.target }} --features=vendored-openssl --package martin
RUSTFLAGS='-C link-arg=-s' cargo build --release --target ${{ matrix.target }} --features=tools --package martin-mbtiles
RUSTFLAGS='-C link-arg=-s' cargo build --release --target ${{ matrix.target }} --features=cli --package martin-mbtiles
else
cargo build --release --target ${{ matrix.target }} --features=ssl --package martin
cargo build --release --target ${{ matrix.target }} --features=tools --package martin-mbtiles
cargo build --release --target ${{ matrix.target }} --features=cli --package martin-mbtiles
fi
mkdir target_releases
if [[ "${{ runner.os }}" == "Windows" ]]; then

View File

@ -27,7 +27,7 @@ futures = "0.3"
indoc = "2"
itertools = "0.10"
log = "0.4"
martin-mbtiles = { path = "./martin-mbtiles", version = "0.2.0", default-features = false } # disable tools
martin-mbtiles = { path = "./martin-mbtiles", version = "0.2.0", default-features = false } # disable CLI tools
martin-tile-utils = { path = "./martin-tile-utils", version = "0.1.0" }
num_cpus = "1"
openssl = "0.10"

View File

@ -10,9 +10,9 @@ repository.workspace = true
license.workspace = true
[features]
# TODO: Disable "tools" feature in default builds
default = ["tools"]
tools = ["anyhow", "clap", "tokio"]
# TODO: Disable "cli" feature in default builds
default = ["cli"]
cli = ["dep:anyhow", "dep:clap", "dep:tokio"]
[dependencies]
futures.workspace = true
@ -38,4 +38,4 @@ path = "src/lib.rs"
[[bin]]
name = "mbtiles"
path = "src/bin/main.rs"
required-features = ["tools"]
required-features = ["cli"]

View File

@ -23,8 +23,8 @@ path = "src/bin/main.rs"
[features]
default = []
ssl = ["openssl", "postgres-openssl"]
vendored-openssl = ["ssl", "openssl/vendored"]
vendored-openssl = ["ssl", "openssl?/vendored"]
ssl = ["dep:openssl", "dep:postgres-openssl"]
bless-tests = []
[dependencies]
@ -60,7 +60,7 @@ thiserror.workspace = true
tilejson.workspace = true
tokio = { workspace = true, features = ["io-std"] }
# Optional dependencies for openssl support
# Optional dependencies for ssl support
openssl = { workspace = true, optional = true }
postgres-openssl = { workspace = true, optional = true }