Skip to content

Commit

Permalink
try fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Taowyoo committed Dec 12, 2023
1 parent c38bcdd commit c1863a5
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 36 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,30 @@ jobs:
strategy:
matrix:
include:
- rust: stable
target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- rust: stable
target: x86_64-fortanix-unknown-sgx
os: ubuntu-20.04
# - rust: stable
# target: x86_64-unknown-linux-gnu
# os: ubuntu-20.04
# - rust: stable
# target: x86_64-fortanix-unknown-sgx
# os: ubuntu-20.04
- rust: stable
target: x86_64-pc-windows-msvc
os: windows-latest
- rust: stable
target: x86_64-pc-windows-msvc
os: windows-2019
- rust: stable
target: aarch64-unknown-linux-musl
os: ubuntu-20.04
- rust: beta
target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- rust: nightly
target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- rust: stable
target: x86_64-apple-darwin
os: macos-latest
# - rust: stable
# target: aarch64-unknown-linux-musl
# os: ubuntu-20.04
# - rust: beta
# target: x86_64-unknown-linux-gnu
# os: ubuntu-20.04
# - rust: nightly
# target: x86_64-unknown-linux-gnu
# os: ubuntu-20.04
# - rust: stable
# target: x86_64-apple-darwin
# os: macos-latest

runs-on: ${{ matrix.os }}

Expand Down
47 changes: 29 additions & 18 deletions mbedtls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ environment."""
readme = "../README.md"
repository = "https://github.com/fortanix/rust-mbedtls"
documentation = "https://docs.rs/mbedtls/"
keywords = ["MbedTLS","mbed","TLS","SSL","cryptography"]
keywords = ["MbedTLS", "mbed", "TLS", "SSL", "cryptography"]

[dependencies]
bitflags = "1"
serde = { version = "1.0.7", default-features = false, features = ["alloc"] }
serde_derive = "1.0.7"
byteorder = { version = "1.0.0", default-features = false }
yasna = { version = "0.2", optional = true, features = ["num-bigint", "bit-vec"] }
yasna = { version = "0.2", optional = true, features = [
"num-bigint",
"bit-vec",
] }
num-bigint = { version = "0.2", optional = true }
bit-vec = { version = "0.5", optional = true }
cbc = { version = "0.1.2", optional = true }
Expand All @@ -33,18 +36,15 @@ cfg-if = "1.0.0"
tokio = { version = "1.16.1", optional = true }
chrono = { version = "0.4", optional = true }

[target.x86_64-fortanix-unknown-sgx.dependencies]
rs-libc = "0.2.0"
mbedtls-sys-auto = { path = "../mbedtls-sys", version = "2.25.0", default-features = false, features = [
"trusted_cert_callback",
"threading",
] }

[dependencies.mbedtls-sys-auto]
version = "2.25.0"
default-features = false
features = ["trusted_cert_callback", "threading"]
path = "../mbedtls-sys"
mbedtls-platform-support = { version = "0.1", path = "../mbedtls-platform-support" }

[dependencies.mbedtls-platform-support]
version = "0.1"
path = "../mbedtls-platform-support"
[target.x86_64-fortanix-unknown-sgx.dependencies]
rs-libc = "0.2.0"

[dev-dependencies]
libc = "0.2.0"
Expand All @@ -62,10 +62,15 @@ pin-project-lite = "0.2"
cc = "1.0"

# feature 'time` is necessary under windows
[target.'cfg(target_os = "windows")'.mbedtls-platform-support]
version = "0.1"
path = "../mbedtls-platform-support"
features = ["time"]
[target.'cfg(target_os = "windows")']
mbedtls-platform-support = { version = "0.1", path = "../mbedtls-platform-support", features = [
"time",
] }
mbedtls-sys-auto = { path = "../mbedtls-sys", version = "2.25.0", default-features = false, features = [
"trusted_cert_callback",
"threading",
"time",
] }

[features]
# Features are documented in the README
Expand All @@ -74,7 +79,13 @@ x509 = []
ssl = ["x509"]

default = ["std", "aesni", "time", "padlock"]
std = ["byteorder/std", "mbedtls-sys-auto/std", "serde/std", "yasna", "mbedtls-platform-support/std"]
std = [
"byteorder/std",
"mbedtls-sys-auto/std",
"serde/std",
"yasna",
"mbedtls-platform-support/std",
]
debug = ["mbedtls-sys-auto/debug"]
no_std_deps = ["mbedtls-platform-support/spin", "serde/alloc"]
force_aesni_support = ["mbedtls-platform-support/force_aesni_support", "aesni"]
Expand All @@ -88,7 +99,7 @@ dsa = ["std", "yasna", "num-bigint", "bit-vec"]
pkcs12 = ["std", "yasna", "x509"]
pkcs12_rc2 = ["pkcs12", "rc2", "cbc"]
legacy_protocols = ["mbedtls-sys-auto/legacy_protocols", "ssl"]
async = ["std", "tokio","tokio/net","tokio/io-util", "tokio/macros"]
async = ["std", "tokio", "tokio/net", "tokio/io-util", "tokio/macros"]
async-rt = ["async", "tokio/rt", "tokio/sync", "tokio/rt-multi-thread"]

[[example]]
Expand Down

0 comments on commit c1863a5

Please sign in to comment.