File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 7
7
extern crate gcc;
8
8
9
9
use std:: env;
10
+ use std:: path:: Path ;
10
11
11
12
fn main ( ) {
12
13
let target = env:: var ( "TARGET" ) . unwrap ( ) ;
@@ -18,10 +19,17 @@ fn main() {
18
19
config. define ( "X64" , None ) ;
19
20
}
20
21
config. compile ( "lib_rust_crypto_helpers.a" ) ;
21
- } else {
22
- gcc:: compile_library (
23
- "lib_rust_crypto_helpers.a" ,
24
- & [ "src/util_helpers.c" , "src/aesni_helpers.c" ] ) ;
22
+ }
23
+ else {
24
+ let mut cfg = gcc:: Config :: new ( ) ;
25
+ cfg. file ( "src/util_helpers.c" ) ;
26
+ cfg. file ( "src/aesni_helpers.c" ) ;
27
+ // gcc can't build this library so, unless the user has explicitly
28
+ // specified a different C compiler, use clang.
29
+ if env:: var_os ( "CC" ) . is_none ( ) {
30
+ cfg. compiler ( Path :: new ( "clang" ) ) ;
31
+ }
32
+ cfg. compile ( "lib_rust_crypto_helpers.a" ) ;
25
33
}
26
34
}
27
35
You can’t perform that action at this time.
0 commit comments