@@ -7,7 +7,6 @@ mod command;
77mod macros;
88mod util;
99
10- pub mod ar;
1110pub mod artifact_names;
1211pub mod assertion_helpers;
1312pub mod diff;
@@ -28,9 +27,10 @@ pub use regex;
2827pub use wasmparser;
2928
3029// Re-exports of external dependencies.
31- pub use external_deps:: { cc, clang, htmldocck, llvm, python, rustc, rustdoc} ;
30+ pub use external_deps:: { c_build , cc, clang, htmldocck, llvm, python, rustc, rustdoc} ;
3231
3332// These rely on external dependencies.
33+ pub use c_build:: build_native_static_lib;
3434pub use cc:: { cc, extra_c_flags, extra_cxx_flags, Cc } ;
3535pub use clang:: { clang, Clang } ;
3636pub use htmldocck:: htmldocck;
@@ -42,12 +42,6 @@ pub use python::python_command;
4242pub use rustc:: { aux_build, bare_rustc, rustc, Rustc } ;
4343pub use rustdoc:: { bare_rustdoc, rustdoc, Rustdoc } ;
4444
45- /// [`ar`][mod@ar] currently uses the [ar][rust-ar] rust library, but that is subject to changes, we
46- /// may switch to `llvm-ar` subject to experimentation.
47- ///
48- /// [rust-ar]: https://github.com/mdsteele/rust-ar
49- pub use ar:: ar;
50-
5145/// [`diff`][mod@diff] is implemented in terms of the [similar] library.
5246///
5347/// [similar]: https://github.com/mitsuhiko/similar
@@ -82,23 +76,3 @@ pub use assertion_helpers::{
8276 has_prefix, has_suffix, invalid_utf8_contains, invalid_utf8_not_contains, not_contains,
8377 shallow_find_files,
8478} ;
85-
86- /// Builds a static lib (`.lib` on Windows MSVC and `.a` for the rest) with the given name.
87- #[ track_caller]
88- pub fn build_native_static_lib ( lib_name : & str ) -> PathBuf {
89- let obj_file = if is_msvc ( ) { format ! ( "{lib_name}" ) } else { format ! ( "{lib_name}.o" ) } ;
90- let src = format ! ( "{lib_name}.c" ) ;
91- let lib_path = static_lib_name ( lib_name) ;
92- if is_msvc ( ) {
93- cc ( ) . arg ( "-c" ) . out_exe ( & obj_file) . input ( src) . run ( ) ;
94- } else {
95- cc ( ) . arg ( "-v" ) . arg ( "-c" ) . out_exe ( & obj_file) . input ( src) . run ( ) ;
96- } ;
97- let obj_file = if is_msvc ( ) {
98- PathBuf :: from ( format ! ( "{lib_name}.obj" ) )
99- } else {
100- PathBuf :: from ( format ! ( "{lib_name}.o" ) )
101- } ;
102- llvm_ar ( ) . obj_to_ar ( ) . output_input ( & lib_path, & obj_file) . run ( ) ;
103- path ( lib_path)
104- }
0 commit comments