File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ pub fn main() -> Result<(), &'static str> {
270
270
let arm_sysroot = env:: var ( "CMAKE_SYSROOT" ) . unwrap_or ( "/usr/local/arm-none-eabi" . to_string ( ) ) ;
271
271
let arm_sysroot = format ! ( "--sysroot={arm_sysroot}" ) ;
272
272
273
- let extra_flags = if cross_compiling {
273
+ let mut extra_flags = if cross_compiling {
274
274
vec ! [
275
275
"-D__SAMD51J20A__" ,
276
276
"--target=thumbv7em-none-eabi" ,
@@ -284,6 +284,15 @@ pub fn main() -> Result<(), &'static str> {
284
284
vec ! [ "-DTESTING" , "-D_UNIT_TEST_" , "-DPRODUCT_BITBOX_MULTI=1" ]
285
285
} ;
286
286
287
+ // If user enables -Dwarnings for rust we also want to enable -Werror for C.
288
+ if let Ok ( rustflags) = std:: env:: var ( "CARGO_ENCODED_RUSTFLAGS" ) {
289
+ for flag in rustflags. split ( '\x1f' ) {
290
+ if flag == "-Dwarnings" {
291
+ extra_flags. push ( "-Werror" ) ;
292
+ }
293
+ }
294
+ }
295
+
287
296
let mut includes = vec ! [
288
297
// $INCLUDES
289
298
"../.." ,
You can’t perform that action at this time.
0 commit comments