File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -268,10 +268,18 @@ fn build(
268
268
}
269
269
270
270
// The 'build-std' unstable cargo feature is required to enable
271
- // cross-compilation for xtensa targets.
272
- // If it has not been set then we cannot build the
273
- // application.
274
- if !cargo_config. has_build_std ( ) && target. starts_with ( "xtensa-" ) {
271
+ // cross-compilation for Xtensa targets. If it has not been set then we
272
+ // cannot build the application, and the cause of the (numerous) build errors
273
+ // may not be immediately clear to the user.
274
+ let cfg_has_build_std = cargo_config. has_build_std ( ) ;
275
+ let opts_has_build_std = build_options
276
+ . clone ( )
277
+ . unstable
278
+ . map ( |ref v| v. iter ( ) . any ( |s| s. contains ( "build-std" ) ) )
279
+ . unwrap_or_default ( ) ;
280
+ let xtensa_target = target. starts_with ( "xtensa-" ) ;
281
+
282
+ if xtensa_target && !( cfg_has_build_std || opts_has_build_std) {
275
283
return Err ( Error :: NoBuildStd . into ( ) ) ;
276
284
} ;
277
285
You can’t perform that action at this time.
0 commit comments