Skip to content

Commit 1cff538

Browse files
committed
Check version for nginx if build starts with nginx
1 parent 7c3ceb9 commit 1cff538

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

build.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,20 @@ fn detect_nginx_features() {
5555

5656
println!("cargo::rustc-check-cfg=cfg(ngx_ssl_cache)");
5757
println!("cargo::rustc-check-cfg=cfg(ngx_ssl_client_hello_cb)");
58+
println!("cargo::rerun-if-env-changed=DEP_NGINX_VER_BUILD");
5859
println!("cargo::rerun-if-env-changed=DEP_NGINX_VERSION_NUMBER");
5960
if let Ok(version) = env::var("DEP_NGINX_VERSION_NUMBER") {
6061
let version: u64 = version.parse().unwrap();
62+
let build: String = env::var("DEP_NGINX_VER_BUILD").unwrap_or("any()".to_string());
6163

62-
if version >= 1_027_002 {
63-
println!("cargo::rustc-cfg=ngx_ssl_cache");
64-
}
64+
if build.starts_with("nginx") {
65+
if version >= 1_027_002 {
66+
println!("cargo::rustc-cfg=ngx_ssl_cache");
67+
}
6568

66-
if version >= 1_029_002 {
67-
println!("cargo::rustc-cfg=ngx_ssl_client_hello_cb");
69+
if version >= 1_029_002 {
70+
println!("cargo::rustc-cfg=ngx_ssl_client_hello_cb");
71+
}
6872
}
6973
}
7074
}

0 commit comments

Comments
 (0)