@@ -25,7 +25,6 @@ pub struct Artifacts {
25
25
bin_dir : PathBuf ,
26
26
libs : Vec < String > ,
27
27
target : String ,
28
- shared : bool ,
29
28
}
30
29
31
30
impl Build {
@@ -98,6 +97,7 @@ impl Build {
98
97
configure
99
98
// No shared objects, we just want static libraries
100
99
. arg ( "no-dso" )
100
+ . arg ( "no-shared" )
101
101
// Should be off by default on OpenSSL 1.1.0, but let's be extra sure
102
102
. arg ( "no-ssl3" )
103
103
// No need to build tests, we won't run them anyway
@@ -146,23 +146,11 @@ impl Build {
146
146
configure. arg ( "no-stdio" ) ;
147
147
}
148
148
149
- let shared = if target. contains ( "msvc" ) {
149
+ if target. contains ( "msvc" ) {
150
150
// On MSVC we need nasm.exe to compile the assembly files, but let's
151
151
// just pessimistically assume for now that's not available.
152
152
configure. arg ( "no-asm" ) ;
153
-
154
- let features = env:: var ( "CARGO_CFG_TARGET_FEATURE" ) . unwrap_or ( String :: new ( ) ) ;
155
- if features. contains ( "crt-static" ) {
156
- configure. arg ( "no-shared" ) ;
157
- false
158
- } else {
159
- true
160
- }
161
- } else {
162
- // Never shared on non-MSVC
163
- configure. arg ( "no-shared" ) ;
164
- false
165
- } ;
153
+ }
166
154
167
155
let os = match target {
168
156
"aarch64-apple-darwin" => "darwin64-arm64-cc" ,
@@ -417,7 +405,6 @@ impl Build {
417
405
include_dir : install_dir. join ( "include" ) ,
418
406
libs : libs,
419
407
target : target. to_string ( ) ,
420
- shared,
421
408
}
422
409
}
423
410
@@ -521,20 +508,12 @@ impl Artifacts {
521
508
pub fn print_cargo_metadata ( & self ) {
522
509
println ! ( "cargo:rustc-link-search=native={}" , self . lib_dir. display( ) ) ;
523
510
for lib in self . libs . iter ( ) {
524
- if self . shared {
525
- println ! ( "cargo:rustc-link-lib={}" , lib) ;
526
- } else {
527
- println ! ( "cargo:rustc-link-lib=static={}" , lib) ;
528
- }
511
+ println ! ( "cargo:rustc-link-lib=static={}" , lib) ;
529
512
}
530
513
println ! ( "cargo:include={}" , self . include_dir. display( ) ) ;
531
514
println ! ( "cargo:lib={}" , self . lib_dir. display( ) ) ;
532
515
if self . target . contains ( "msvc" ) {
533
- if self . shared {
534
- println ! ( "cargo:rustc-link-search=native={}" , self . bin_dir. display( ) ) ;
535
- } else {
536
- println ! ( "cargo:rustc-link-lib=user32" ) ;
537
- }
516
+ println ! ( "cargo:rustc-link-lib=user32" ) ;
538
517
}
539
518
}
540
519
}
0 commit comments