This repository was archived by the owner on Feb 25, 2021. It is now read-only.
File tree 1 file changed +6
-11
lines changed
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 23
23
24
24
extern crate cc;
25
25
26
- use std:: io :: { self , Write } ;
26
+ use std:: env ;
27
27
28
28
fn main ( ) {
29
29
// Check whether we can use 64-bit compilation
30
- #[ cfg( target_pointer_width = "64" ) ]
31
- let use_64bit_compilation = {
30
+ let use_64bit_compilation = if env:: var ( "CARGO_CFG_TARGET_POINTER_WIDTH" ) . unwrap ( ) == "64" {
32
31
let check = cc:: Build :: new ( ) . file ( "depend/check_uint128_t.c" )
33
32
. cargo_metadata ( false )
34
33
. try_compile ( "check_uint128_t" )
35
34
. is_ok ( ) ;
36
35
if !check {
37
- writeln ! (
38
- & mut io:: stderr( ) ,
39
- "Warning: Compiling in 32-bit mode on a 64-bit architecture due to lack of uint128_t support."
40
- ) . expect ( "print to stderr" )
36
+ println ! ( "cargo:warning=Compiling in 32-bit mode on a 64-bit architecture due to lack of uint128_t support." ) ;
41
37
}
42
38
check
39
+ } else {
40
+ false
43
41
} ;
44
- #[ cfg( not( target_pointer_width = "64" ) ) ]
45
- let use_64bit_compilation = false ;
46
-
47
42
48
43
// Actual build
49
44
let mut base_config = cc:: Build :: new ( ) ;
@@ -61,7 +56,7 @@ fn main() {
61
56
. define ( "ENABLE_MODULE_ECDH" , Some ( "1" ) )
62
57
. define ( "ENABLE_MODULE_RECOVERY" , Some ( "1" ) ) ;
63
58
64
- if let Ok ( target_endian) = std :: env:: var ( "CARGO_CFG_TARGET_ENDIAN" ) {
59
+ if let Ok ( target_endian) = env:: var ( "CARGO_CFG_TARGET_ENDIAN" ) {
65
60
if target_endian == "big" {
66
61
base_config. define ( "WORDS_BIGENDIAN" , Some ( "1" ) ) ;
67
62
}
You can’t perform that action at this time.
0 commit comments