File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,19 @@ fn main() {
44
44
cfg. define ( "COMPILER_RT_HAS_UNAME" , Some ( "1" ) ) ;
45
45
}
46
46
47
+ // Assume that the Unixes we are building this for have fnctl() available
48
+ if env:: var_os ( "CARGO_CFG_UNIX" ) . is_some ( ) {
49
+ cfg. define ( "COMPILER_RT_HAS_FCNTL_LCK" , Some ( "1" ) ) ;
50
+ }
51
+
52
+ // This should be a pretty good heuristic for when to set
53
+ // COMPILER_RT_HAS_ATOMICS
54
+ if env:: var_os ( "CARGO_CFG_TARGET_HAS_ATOMIC" ) . map ( |features| {
55
+ features. to_string_lossy ( ) . to_lower_case ( ) . contains ( "cas" )
56
+ } ) . unwrap_or ( false ) {
57
+ cfg. define ( "COMPILER_RT_HAS_ATOMICS" , Some ( "1" ) ) ;
58
+ }
59
+
47
60
// The source for `compiler-rt` comes from the `compiler-builtins` crate, so
48
61
// load our env var set by cargo to find the source code.
49
62
let root = env:: var_os ( "DEP_COMPILER_RT_COMPILER_RT" ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments