From 45ce84134218caf38dc5e70d72db5236cb8b75c9 Mon Sep 17 00:00:00 2001
From: Jiahao XU <Jiahao_XU@outlook.com>
Date: Thu, 16 Feb 2023 09:57:58 +1100
Subject: [PATCH] Adjust feature flags enabled on CI (#809)

Enable feature `pkg-config` and `log_release_max_level_debug` for debug
build and enable feature `static`, `trust-dns` and
`log_release_max_level_debug` for release build.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---
 justfile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/justfile b/justfile
index 1ecd7610..a391216c 100644
--- a/justfile
+++ b/justfile
@@ -62,9 +62,13 @@ cargo-no-default-features := if default-features == "false" { " --no-default-fea
     } else if (cargo-profile / ci-or-no) == "dev/ci" { " --no-default-features"
     } else { "" }
 
+support-pkg-config := if target == target-host {
+    if target-os != "windows" { "true" } else { "" }
+} else { "" }
+
 cargo-features := trim_end_match(if override-features != "" { override-features
-    } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin" + extra-features
-    } else if (cargo-profile / ci-or-no) == "release/ci" { "rustls,fancy-no-backtrace,zstd-thin" + extra-features
+    } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin,log_release_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features
+    } else if (cargo-profile / ci-or-no) == "release/ci" { "static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug" + extra-features
     } else { extra-features
 }, ",")