File tree Expand file tree Collapse file tree 4 files changed +25
-8
lines changed Expand file tree Collapse file tree 4 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ license = "MIT"
23
23
repository = " https://github.com/malept/crypto-hash"
24
24
[dependencies .hex ]
25
25
version = " 0.3"
26
- [target ."cfg(not(any(target_os = \"windows\", target_os = \"macos\" )))" .dependencies .openssl ]
26
+ [target ."cfg(not(any(target_os = \"windows\")))" .dependencies .openssl ]
27
27
version = " 0.10"
28
28
[target ."cfg(target_os = \"macos\")" .dependencies .commoncrypto ]
29
29
version = " 0.2"
Original file line number Diff line number Diff line change
1
+ use std:: env;
2
+
3
+ fn main ( ) {
4
+ if env:: var ( "CRYPTO_HASH_FORCE_OPENSSL" ) . is_ok ( ) {
5
+ println ! ( "cargo:rustc-cfg=feature=\" openssl\" " ) ;
6
+ return ;
7
+ }
8
+
9
+ #[ cfg( all( target_os = "macos" , not( target_os = "windows" ) ) ) ]
10
+ println ! ( "cargo:rustc-cfg=feature=\" commoncrypto\" " ) ;
11
+
12
+ #[ cfg( all( not( target_os = "macos" ) , target_os = "windows" ) ) ]
13
+ println ! ( "cargo:rustc-cfg=feature=\" winapi\" " ) ;
14
+
15
+ #[ cfg( all( not( target_os = "macos" ) , not( target_os = "windows" ) ) ) ]
16
+ println ! ( "cargo:rustc-cfg=feature=\" openssl\" " ) ;
17
+ }
Original file line number Diff line number Diff line change 43
43
44
44
#![ warn( missing_docs) ]
45
45
46
- #[ cfg( target_os = "macos " ) ]
46
+ #[ cfg( feature = "commoncrypto " ) ]
47
47
extern crate commoncrypto;
48
48
extern crate hex;
49
- #[ cfg( not ( any ( target_os = "macos" , target_os = "windows" ) ) ) ]
49
+ #[ cfg( feature = "openssl" ) ]
50
50
extern crate openssl;
51
- #[ cfg( target_os = "windows " ) ]
51
+ #[ cfg( feature = "winapi " ) ]
52
52
extern crate winapi;
53
53
54
54
use std:: io:: Write ;
55
55
56
- #[ cfg( target_os = "macos " ) ]
56
+ #[ cfg( feature = "commoncrypto " ) ]
57
57
#[ path = "imp/commoncrypto.rs" ]
58
58
mod imp;
59
- #[ cfg( target_os = "windows " ) ]
59
+ #[ cfg( feature = "winapi " ) ]
60
60
#[ path = "imp/cryptoapi.rs" ]
61
61
mod imp;
62
- #[ cfg( not ( any ( target_os = "macos" , target_os = "windows" ) ) ) ]
62
+ #[ cfg( feature = "openssl" ) ]
63
63
#[ path = "imp/openssl.rs" ]
64
64
mod imp;
65
65
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ fn main() {
132
132
133
133
if windows {
134
134
features. push_str ( "#define GIT_WINHTTP 1\n " ) ;
135
- } else if target. contains ( "apple" ) {
135
+ } else if target. contains ( "apple" ) && cfg ! ( not ( feature = "macos_before_10_7" ) ) {
136
136
features. push_str ( "#define GIT_SECURE_TRANSPORT 1\n " ) ;
137
137
} else {
138
138
features. push_str ( "#define GIT_OPENSSL 1\n " ) ;
You can’t perform that action at this time.
0 commit comments