File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ fn main() {
100100 }
101101}
102102
103+ fn needs_curl ( ) -> bool {
104+ env:: var ( "CARGO_FEATURE_CURL" ) . is_ok ( ) || env:: var ( "CARGO_FEATURE_CURL_STATIC" ) . is_ok ( )
105+ }
106+
103107#[ cfg( not( feature = "cmake-build" ) ) ]
104108fn build_librdkafka ( ) {
105109 let mut configure_flags: Vec < String > = Vec :: new ( ) ;
@@ -144,7 +148,7 @@ fn build_librdkafka() {
144148 configure_flags. push ( "--disable-zlib" . into ( ) ) ;
145149 }
146150
147- if env :: var ( "CARGO_FEATURE_CURL" ) . is_ok ( ) {
151+ if needs_curl ( ) {
148152 // There is no --enable-curl option, but it is enabled by default.
149153 if let Ok ( curl_root) = env:: var ( "DEP_CURL_ROOT" ) {
150154 cflags. push ( "-DCURLSTATIC_LIB" . to_string ( ) ) ;
@@ -240,7 +244,7 @@ fn build_librdkafka() {
240244 config. define ( "WITH_ZLIB" , "0" ) ;
241245 }
242246
243- if env :: var ( "CARGO_FEATURE_CURL" ) . is_ok ( ) {
247+ if needs_curl ( ) {
244248 config. define ( "WITH_CURL" , "1" ) ;
245249 config. register_dep ( "curl" ) ;
246250 if let Ok ( curl_root) = env:: var ( "DEP_CURL_ROOT" ) {
You can’t perform that action at this time.
0 commit comments