@@ -23,25 +23,28 @@ fn main() {
2323 println ! ( "cargo::rustc-check-cfg=cfg({cfg})" ) ;
2424 }
2525
26- #[ allow( clippy:: unusual_byte_groupings) ]
27- if let Ok ( v) = std:: env:: var ( "DEP_OPENSSL_VERSION_NUMBER" ) {
28- println ! ( "cargo:rustc-env=OPENSSL_API_VERSION={v}" ) ;
29- // cfg setup from openssl crate's build script
30- let version = u64:: from_str_radix ( & v, 16 ) . unwrap ( ) ;
31- for ( ver, cfg) in ossl_vers {
32- if version >= ver {
33- println ! ( "cargo:rustc-cfg={cfg}" ) ;
26+ #[ cfg( feature = "ssl-openssl" ) ]
27+ {
28+ #[ allow( clippy:: unusual_byte_groupings) ]
29+ if let Ok ( v) = std:: env:: var ( "DEP_OPENSSL_VERSION_NUMBER" ) {
30+ println ! ( "cargo:rustc-env=OPENSSL_API_VERSION={v}" ) ;
31+ // cfg setup from openssl crate's build script
32+ let version = u64:: from_str_radix ( & v, 16 ) . unwrap ( ) ;
33+ for ( ver, cfg) in ossl_vers {
34+ if version >= ver {
35+ println ! ( "cargo:rustc-cfg={cfg}" ) ;
36+ }
3437 }
3538 }
36- }
37- if let Ok ( v) = std:: env:: var ( "DEP_OPENSSL_CONF" ) {
38- for conf in v. split ( ',' ) {
39- println ! ( "cargo:rustc-cfg=osslconf=\" {conf}\" " ) ;
39+ if let Ok ( v) = std:: env:: var ( "DEP_OPENSSL_CONF" ) {
40+ for conf in v. split ( ',' ) {
41+ println ! ( "cargo:rustc-cfg=osslconf=\" {conf}\" " ) ;
42+ }
43+ }
44+ // it's possible for openssl-sys to link against the system openssl under certain conditions,
45+ // so let the ssl module know to only perform a probe if we're actually vendored
46+ if std:: env:: var ( "DEP_OPENSSL_VENDORED" ) . is_ok_and ( |s| s == "1" ) {
47+ println ! ( "cargo::rustc-cfg=openssl_vendored" )
4048 }
41- }
42- // it's possible for openssl-sys to link against the system openssl under certain conditions,
43- // so let the ssl module know to only perform a probe if we're actually vendored
44- if std:: env:: var ( "DEP_OPENSSL_VENDORED" ) . is_ok_and ( |s| s == "1" ) {
45- println ! ( "cargo::rustc-cfg=openssl_vendored" )
4649 }
4750}
0 commit comments