@@ -436,22 +436,21 @@ impl SDKBuilder {
436
436
}
437
437
}
438
438
439
- let mut png_list: Vec < String > = Vec :: new ( ) ;
439
+ let mut cmd = Command :: new ( icon2glyph. as_os_str ( ) ) ;
440
+ cmd. arg ( "--glyphcheader" )
441
+ . arg ( dest_path. join ( "glyphs.h" ) . as_os_str ( ) )
442
+ . arg ( "--glyphcfile" )
443
+ . arg ( dest_path. join ( "glyphs.c" ) . as_os_str ( ) ) ;
444
+
440
445
for folder in glyph_folders. iter ( ) {
441
446
for file in std:: fs:: read_dir ( folder) . unwrap ( ) {
442
447
let path = file. unwrap ( ) . path ( ) ;
443
448
let path_str = path. to_str ( ) . unwrap ( ) . to_string ( ) ;
444
- png_list . push ( path_str) ;
449
+ cmd . arg ( path_str) ;
445
450
}
446
451
}
447
452
448
- let _ = Command :: new ( icon2glyph. as_os_str ( ) )
449
- . arg ( "--glyphcheader" )
450
- . arg ( dest_path. join ( "glyphs.h" ) . as_os_str ( ) )
451
- . arg ( "--glyphcfile" )
452
- . arg ( dest_path. join ( "glyphs.c" ) . as_os_str ( ) )
453
- . args ( png_list)
454
- . output ( ) ;
453
+ let _ = cmd. output ( ) ;
455
454
}
456
455
457
456
pub fn build_c_sdk ( & self ) {
@@ -589,17 +588,14 @@ impl SDKBuilder {
589
588
}
590
589
Device :: Stax | Device :: Flex => {
591
590
let out_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
592
- if Device :: Stax == self . device {
593
- let glyphs = out_path. join ( "glyphs_stax" ) ;
594
- let include_path = glyphs. to_str ( ) . unwrap ( ) ;
595
- let s = "-I" . to_string ( ) + include_path;
596
- bindings = bindings. clang_args ( [ s. as_str ( ) ] ) ;
597
- } else {
598
- let glyphs = out_path. join ( "glyphs_flex" ) ;
599
- let include_path = glyphs. to_str ( ) . unwrap ( ) ;
600
- let s = "-I" . to_string ( ) + include_path;
601
- bindings = bindings. clang_args ( [ s. as_str ( ) ] ) ;
602
- }
591
+ let mut include_path = "-I" . to_string ( ) ;
592
+ let glyphs = match self . device {
593
+ Device :: Stax => out_path. join ( "glyphs_stax" ) ,
594
+ Device :: Flex => out_path. join ( "glyphs_flex" ) ,
595
+ _ => panic ! ( "Invalid device" ) ,
596
+ } ;
597
+ include_path += glyphs. to_str ( ) . unwrap ( ) ;
598
+ bindings = bindings. clang_args ( [ include_path. as_str ( ) ] ) ;
603
599
604
600
bindings = bindings. clang_args ( [
605
601
format ! ( "-I{bsdk}/lib_nbgl/include/" ) . as_str ( ) ,
0 commit comments