@@ -281,26 +281,6 @@ pub fn not_contains<P: AsRef<Path>>(path: P, expected: &str) -> bool {
281
281
!path. as_ref ( ) . file_name ( ) . is_some_and ( |name| name. to_str ( ) . unwrap ( ) . contains ( expected) )
282
282
}
283
283
284
- /// Builds a static lib (`.lib` on Windows MSVC and `.a` for the rest) with the given name.
285
- #[ track_caller]
286
- pub fn build_native_static_lib ( lib_name : & str ) -> PathBuf {
287
- let obj_file = if is_msvc ( ) { format ! ( "{lib_name}" ) } else { format ! ( "{lib_name}.o" ) } ;
288
- let src = format ! ( "{lib_name}.c" ) ;
289
- let lib_path = static_lib_name ( lib_name) ;
290
- if is_msvc ( ) {
291
- cc ( ) . arg ( "-c" ) . out_exe ( & obj_file) . input ( src) . run ( ) ;
292
- } else {
293
- cc ( ) . arg ( "-v" ) . arg ( "-c" ) . out_exe ( & obj_file) . input ( src) . run ( ) ;
294
- } ;
295
- let obj_file = if is_msvc ( ) {
296
- PathBuf :: from ( format ! ( "{lib_name}.obj" ) )
297
- } else {
298
- PathBuf :: from ( format ! ( "{lib_name}.o" ) )
299
- } ;
300
- llvm_ar ( ) . obj_to_ar ( ) . output_input ( & lib_path, & obj_file) . run ( ) ;
301
- path ( lib_path)
302
- }
303
-
304
284
/// Returns true if the filename at `path` is not in `expected`.
305
285
pub fn filename_not_in_denylist < P : AsRef < Path > , V : AsRef < [ String ] > > ( path : P , expected : V ) -> bool {
306
286
let expected = expected. as_ref ( ) ;
@@ -339,11 +319,11 @@ pub fn build_native_static_lib(lib_name: &str) -> PathBuf {
339
319
} else {
340
320
cc ( ) . arg ( "-v" ) . arg ( "-c" ) . out_exe ( & obj_file) . input ( src) . run ( ) ;
341
321
} ;
342
- let mut obj_file = PathBuf :: from ( format ! ( "{lib_name}.o" ) ) ;
343
- if is_msvc ( ) {
344
- obj_file . set_extension ( "" ) ;
345
- obj_file . set_extension ( "obj" ) ;
346
- }
322
+ let obj_file = if is_msvc ( ) {
323
+ PathBuf :: from ( format ! ( "{lib_name}.obj" ) )
324
+ } else {
325
+ PathBuf :: from ( format ! ( "{lib_name}.o" ) )
326
+ } ;
347
327
llvm_ar ( ) . obj_to_ar ( ) . output_input ( & lib_path, & obj_file) . run ( ) ;
348
328
path ( lib_path)
349
329
}
0 commit comments