@@ -16,21 +16,22 @@ use std::env;
16
16
fn main ( ) {
17
17
// Actual build
18
18
let mut base_config = cc:: Build :: new ( ) ;
19
- base_config. include ( "depend/secp256k1/" )
20
- . include ( "depend/secp256k1/include" )
21
- . include ( "depend/secp256k1/src" )
22
- . flag_if_supported ( "-Wno-unused-function" ) // some ecmult stuff is defined but not used upstream
23
- . flag_if_supported ( "-Wno-unused-parameter" ) // patching out printf causes this warning
24
- . define ( "SECP256K1_API" , Some ( "" ) )
25
- . define ( "ENABLE_MODULE_ECDH" , Some ( "1" ) )
26
- . define ( "ENABLE_MODULE_SCHNORRSIG" , Some ( "1" ) )
27
- . define ( "ENABLE_MODULE_EXTRAKEYS" , Some ( "1" ) )
28
- . define ( "ENABLE_MODULE_ELLSWIFT" , Some ( "1" ) )
29
- . define ( "ENABLE_MODULE_MUSIG" , Some ( "1" ) )
30
- // upstream sometimes introduces calls to printf, which we cannot compile
31
- // with WASM due to its lack of libc. printf is never necessary and we can
32
- // just #define it away.
33
- . define ( "printf(...)" , Some ( "" ) ) ;
19
+ base_config
20
+ . include ( "depend/secp256k1/" )
21
+ . include ( "depend/secp256k1/include" )
22
+ . include ( "depend/secp256k1/src" )
23
+ . flag_if_supported ( "-Wno-unused-function" ) // some ecmult stuff is defined but not used upstream
24
+ . flag_if_supported ( "-Wno-unused-parameter" ) // patching out printf causes this warning
25
+ . define ( "SECP256K1_API" , Some ( "" ) )
26
+ . define ( "ENABLE_MODULE_ECDH" , Some ( "1" ) )
27
+ . define ( "ENABLE_MODULE_SCHNORRSIG" , Some ( "1" ) )
28
+ . define ( "ENABLE_MODULE_EXTRAKEYS" , Some ( "1" ) )
29
+ . define ( "ENABLE_MODULE_ELLSWIFT" , Some ( "1" ) )
30
+ . define ( "ENABLE_MODULE_MUSIG" , Some ( "1" ) )
31
+ // upstream sometimes introduces calls to printf, which we cannot compile
32
+ // with WASM due to its lack of libc. printf is never necessary and we can
33
+ // just #define it away.
34
+ . define ( "printf(...)" , Some ( "" ) ) ;
34
35
35
36
if cfg ! ( feature = "lowmemory" ) {
36
37
base_config. define ( "ECMULT_WINDOW_SIZE" , Some ( "4" ) ) ; // A low-enough value to consume negligible memory
@@ -45,15 +46,15 @@ fn main() {
45
46
46
47
// WASM headers and size/align defines.
47
48
if env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) == "wasm32" {
48
- base_config. include ( "wasm/wasm-sysroot" )
49
- . file ( "wasm/wasm.c" ) ;
49
+ base_config. include ( "wasm/wasm-sysroot" ) . file ( "wasm/wasm.c" ) ;
50
50
}
51
51
52
52
// secp256k1
53
- base_config. file ( "depend/secp256k1/contrib/lax_der_parsing.c" )
54
- . file ( "depend/secp256k1/src/precomputed_ecmult_gen.c" )
55
- . file ( "depend/secp256k1/src/precomputed_ecmult.c" )
56
- . file ( "depend/secp256k1/src/secp256k1.c" ) ;
53
+ base_config
54
+ . file ( "depend/secp256k1/contrib/lax_der_parsing.c" )
55
+ . file ( "depend/secp256k1/src/precomputed_ecmult_gen.c" )
56
+ . file ( "depend/secp256k1/src/precomputed_ecmult.c" )
57
+ . file ( "depend/secp256k1/src/secp256k1.c" ) ;
57
58
58
59
if base_config. try_compile ( "libsecp256k1.a" ) . is_err ( ) {
59
60
// Some embedded platforms may not have, eg, string.h available, so if the build fails
@@ -63,4 +64,3 @@ fn main() {
63
64
base_config. compile ( "libsecp256k1.a" ) ;
64
65
}
65
66
}
66
-
0 commit comments