File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ impl<'r> CmakeProbe<'r> {
159
159
}
160
160
} else if !arg. starts_with ( '-' ) {
161
161
let path = Path :: new ( arg) ;
162
+ let is_static = path. extension ( ) . map_or ( false , |ext| ext. eq_ignore_ascii_case ( "a" ) ) ;
162
163
if let Some ( file) = path. file_name ( ) . and_then ( super :: cleanup_lib_filename) {
163
164
if let Some ( parent) = path. parent ( ) . map ( |p| p. to_owned ( ) ) {
164
165
if !link_paths. contains ( & parent) {
@@ -167,7 +168,12 @@ impl<'r> CmakeProbe<'r> {
167
168
} else {
168
169
panic ! ( "{}" , arg. to_string( ) ) ;
169
170
}
170
- link_libs. push ( file. to_str ( ) . expect ( "Non-UTF8 filename" ) . to_string ( ) ) ;
171
+ let file = file. to_str ( ) . expect ( "Non-UTF8 filename" ) ;
172
+ if is_static {
173
+ link_libs. push ( format ! ( "static={}" , file) ) ;
174
+ } else {
175
+ link_libs. push ( file. to_string ( ) ) ;
176
+ }
171
177
}
172
178
} else {
173
179
eprintln ! ( "=== Unexpected cmake compiler argument found: {arg}" ) ;
You can’t perform that action at this time.
0 commit comments