File tree Expand file tree Collapse file tree 1 file changed +12
-22
lines changed Expand file tree Collapse file tree 1 file changed +12
-22
lines changed Original file line number Diff line number Diff line change @@ -728,29 +728,19 @@ fn patch_model_for_full_tflite(model_dir: &Path, use_full_tflite: bool) {
728728}
729729
730730fn link_with_standard_library ( ) {
731- # [ cfg( all ( target_os = "windows" , target_env = "msvc" ) ) ]
732- {
733- println ! ( "cargo:rustc-link-lib=msvcrt" ) ; // MSVC runtime
734- }
735-
736- # [ cfg ( all ( target_os = "windows" , target_env = "gnu" ) ) ]
737- {
738- println ! ( "cargo:rustc-link-lib=stdc++" ) ; // MinGW GNU toolchain
739- }
740-
741- # [ cfg ( all ( target_os = "linux" , target_env = "gnu" ) ) ]
742- {
731+ if cfg ! ( target_os = "linux" ) {
732+ println ! ( "cargo:rustc-link-lib=stdc++" ) ;
733+ } else if cfg ! ( target_os = "macos" ) {
734+ println ! ( "cargo:rustc-link-lib=c++" ) ;
735+ } else if cfg ! ( target_os = "windows" ) {
736+ if cfg ! ( target_env = "msvc" ) {
737+ println ! ( "cargo:rustc-link-lib=msvcrt" ) ;
738+ } else {
739+ println ! ( "cargo:rustc-link-lib=stdc++" ) ; // MinGW
740+ }
741+ } else {
742+ println ! ( "cargo:warning=Unknown platform, defaulting to stdc++" ) ;
743743 println ! ( "cargo:rustc-link-lib=stdc++" ) ;
744- }
745-
746- #[ cfg( all( target_os = "linux" , target_env = "musl" ) ) ]
747- {
748- println ! ( "cargo:rustc-link-lib=static=stdc++" ) ;
749- }
750-
751- #[ cfg( target_os = "macos" ) ]
752- {
753- println ! ( "cargo:rustc-link-lib=c++" ) ; // macOS uses libc++
754744 }
755745}
756746
You can’t perform that action at this time.
0 commit comments