From 9610803b6eed56f6b8e9506f2fb8cc702195a3a2 Mon Sep 17 00:00:00 2001 From: Masahiro Kozuka Date: Fri, 3 Jan 2025 22:58:17 +0900 Subject: [PATCH] Add schannel feature support and update CI configuration (#4735) --- .github/workflows/cargo.yml | 15 ++++++++++++++- Cargo.toml | 1 + scripts/build.rs | 6 +++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 689676fdbe..fec34ec7e7 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -17,7 +17,20 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-xlarge] - features: ["", "--features static"] + features: ["", "--features static", "--features schannel", "--features schannel,static"] + exclude: + - os: ubuntu-latest + features: "--features schannel" + - os: ubuntu-latest + features: "--features schannel,static" + - os: macos-latest + features: "--features schannel" + - os: macos-latest + features: "--features schannel,static" + - os: macos-latest-xlarge + features: "--features schannel" + - os: macos-latest-xlarge + features: "--features schannel,static" runs-on: ${{ matrix.os }} name: Cargo steps: diff --git a/Cargo.toml b/Cargo.toml index ad41247b71..892e6f969f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,7 @@ include = [ [features] default = [] +schannel = [] static = [] preview-api = [] diff --git a/scripts/build.rs b/scripts/build.rs index 5e3d8ba4f5..7dbb6d3ec0 100644 --- a/scripts/build.rs +++ b/scripts/build.rs @@ -21,8 +21,12 @@ fn main() { let mut config = Config::new("."); config .define("QUIC_ENABLE_LOGGING", logging_enabled) - .define("QUIC_TLS", "openssl") .define("QUIC_OUTPUT_DIR", quic_output_dir.to_str().unwrap()); + if cfg!(feature = "schannel") { + config.define("QUIC_TLS", "schannel"); + } else { + config.define("QUIC_TLS", "openssl"); + } if cfg!(feature = "static") { config.define("QUIC_BUILD_SHARED", "off"); }