File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
environment :
2
2
matrix :
3
3
- TARGET : x86_64-pc-windows-msvc
4
+ RUSTFLAGS : -C target-feature=-crt-static
5
+ - TARGET : x86_64-pc-windows-msvc
6
+ RUSTFLAGS : -C target-feature=+crt-static
4
7
- TARGET : i686-pc-windows-msvc
5
8
- TARGET : i686-pc-windows-gnu
6
9
MSYS_BITS : 32
Original file line number Diff line number Diff line change @@ -72,7 +72,6 @@ impl Build {
72
72
configure
73
73
// No shared objects, we just want static libraries
74
74
. arg ( "no-dso" )
75
- . arg ( "no-shared" )
76
75
77
76
// Should be off by default on OpenSSL 1.1.0, but let's be extra sure
78
77
. arg ( "no-ssl3" )
@@ -97,11 +96,20 @@ impl Build {
97
96
// On MSVC we need nasm.exe to compile the assembly files, but let's
98
97
// just pessimistically assume for now that's not available.
99
98
configure. arg ( "no-asm" ) ;
99
+
100
+ let features = env:: var ( "CARGO_CFG_TARGET_FEATURE" )
101
+ . unwrap_or ( String :: new ( ) ) ;
102
+ if features. contains ( "crt-static" ) {
103
+ configure. arg ( "no-shared" ) ;
104
+ }
100
105
} else {
101
106
// If we're *not* on MSVC then we can optimize our build a bit by
102
107
// avoiding building the CLI tools. Unfortunately though on MSVC if
103
108
// we pass this option the build breaks oddly...
104
109
configure. arg ( "no-stdio" ) ;
110
+
111
+ // Never shared on non-MSVC
112
+ configure. arg ( "no-shared" ) ;
105
113
}
106
114
107
115
let os = match target {
You can’t perform that action at this time.
0 commit comments