File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,9 @@ mod c {
103
103
let target_env = env:: var ( "CARGO_CFG_TARGET_ENV" ) . unwrap ( ) ;
104
104
let target_os = env:: var ( "CARGO_CFG_TARGET_OS" ) . unwrap ( ) ;
105
105
let target_vendor = env:: var ( "CARGO_CFG_TARGET_VENDOR" ) . unwrap ( ) ;
106
-
106
+ let target_arch_arm =
107
+ target_arch. contains ( "arm" ) ||
108
+ target_arch. contains ( "thumb" ) ;
107
109
let cfg = & mut cc:: Build :: new ( ) ;
108
110
109
111
cfg. warnings ( false ) ;
@@ -137,10 +139,10 @@ mod c {
137
139
// the implementation is not valid for the arch, then gcc will error when compiling it.
138
140
if llvm_target[ 0 ] . starts_with ( "thumb" ) {
139
141
cfg. flag ( "-mthumb" ) ;
142
+ }
140
143
141
- if llvm_target. last ( ) == Some ( & "eabihf" ) {
142
- cfg. flag ( "-mfloat-abi=hard" ) ;
143
- }
144
+ if target_arch_arm && llvm_target. last ( ) == Some ( & "eabihf" ) {
145
+ cfg. flag ( "-mfloat-abi=hard" ) ;
144
146
}
145
147
146
148
if llvm_target[ 0 ] == "thumbv6m" {
You can’t perform that action at this time.
0 commit comments