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 @@ -907,29 +907,19 @@ fn patch_model_for_full_tflite(model_dir: &Path, use_full_tflite: bool) {
907907}
908908
909909fn link_with_standard_library ( ) {
910- # [ cfg( all ( target_os = "windows" , target_env = "msvc" ) ) ]
911- {
912- println ! ( "cargo:rustc-link-lib=msvcrt" ) ; // MSVC runtime
913- }
914-
915- # [ cfg ( all ( target_os = "windows" , target_env = "gnu" ) ) ]
916- {
917- println ! ( "cargo:rustc-link-lib=stdc++" ) ; // MinGW GNU toolchain
918- }
919-
920- # [ cfg ( all ( target_os = "linux" , target_env = "gnu" ) ) ]
921- {
910+ if cfg ! ( target_os = "linux" ) {
911+ println ! ( "cargo:rustc-link-lib=stdc++" ) ;
912+ } else if cfg ! ( target_os = "macos" ) {
913+ println ! ( "cargo:rustc-link-lib=c++" ) ;
914+ } else if cfg ! ( target_os = "windows" ) {
915+ if cfg ! ( target_env = "msvc" ) {
916+ println ! ( "cargo:rustc-link-lib=msvcrt" ) ;
917+ } else {
918+ println ! ( "cargo:rustc-link-lib=stdc++" ) ; // MinGW
919+ }
920+ } else {
921+ println ! ( "cargo:warning=Unknown platform, defaulting to stdc++" ) ;
922922 println ! ( "cargo:rustc-link-lib=stdc++" ) ;
923- }
924-
925- #[ cfg( all( target_os = "linux" , target_env = "musl" ) ) ]
926- {
927- println ! ( "cargo:rustc-link-lib=static=stdc++" ) ;
928- }
929-
930- #[ cfg( target_os = "macos" ) ]
931- {
932- println ! ( "cargo:rustc-link-lib=c++" ) ; // macOS uses libc++
933923 }
934924}
935925
You can’t perform that action at this time.
0 commit comments