From d60c19fd1035242803d7fb3e31553daecead4ea8 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Fri, 26 Sep 2025 11:19:46 -0700 Subject: [PATCH] subprojects: enable proper cross-compile on MinGW of certain crates The virtgpu_kumquat deps -- used by gfxstream -- don't work with cross-compile. This is because they set "native: true" even for host machine deps. In addition, some proc-macro deps (which need "native: true") try to link against host machine deps. Reviewed-by: David Gilhooley --- subprojects/packagefiles/bitflags-2-rs/meson.build | 1 - subprojects/packagefiles/cfg-if-1-rs/meson.build | 1 - subprojects/packagefiles/errno-0.3-rs/meson.build | 1 - subprojects/packagefiles/libc-0.2-rs/meson.build | 1 - subprojects/packagefiles/log-0.4-rs/meson.build | 1 - subprojects/packagefiles/remain-0.2-rs/meson.build | 2 +- subprojects/packagefiles/rustix-1-rs/meson.build | 1 - subprojects/packagefiles/thiserror-2-rs/meson.build | 5 ++--- subprojects/packagefiles/thiserror-impl-2-rs/meson.build | 2 +- subprojects/packagefiles/zerocopy-0.8-rs/meson.build | 3 +-- subprojects/packagefiles/zerocopy-derive-0.8-rs/meson.build | 2 +- 11 files changed, 6 insertions(+), 14 deletions(-) diff --git a/subprojects/packagefiles/bitflags-2-rs/meson.build b/subprojects/packagefiles/bitflags-2-rs/meson.build index bee3a5f5bff..c38b635e8a5 100644 --- a/subprojects/packagefiles/bitflags-2-rs/meson.build +++ b/subprojects/packagefiles/bitflags-2-rs/meson.build @@ -13,7 +13,6 @@ lib = static_library( 'src/lib.rs', override_options : ['rust_std=2021', 'build.rust_std=2021'], rust_abi : 'rust', - native : true, ) dep_bitflags = declare_dependency( diff --git a/subprojects/packagefiles/cfg-if-1-rs/meson.build b/subprojects/packagefiles/cfg-if-1-rs/meson.build index 8bbba45e0dd..1f467731b71 100644 --- a/subprojects/packagefiles/cfg-if-1-rs/meson.build +++ b/subprojects/packagefiles/cfg-if-1-rs/meson.build @@ -13,7 +13,6 @@ lib = static_library( 'src/lib.rs', override_options : ['rust_std=2018', 'build.rust_std=2018'], rust_abi : 'rust', - native : true, ) dep_cfg_if = declare_dependency( diff --git a/subprojects/packagefiles/errno-0.3-rs/meson.build b/subprojects/packagefiles/errno-0.3-rs/meson.build index 465ff94c85a..51c0edf6b55 100644 --- a/subprojects/packagefiles/errno-0.3-rs/meson.build +++ b/subprojects/packagefiles/errno-0.3-rs/meson.build @@ -16,7 +16,6 @@ lib = static_library( override_options : ['rust_std=2018', 'build.rust_std=2018'], link_with: [libc], rust_abi : 'rust', - native : true, ) dep_errno = declare_dependency( diff --git a/subprojects/packagefiles/libc-0.2-rs/meson.build b/subprojects/packagefiles/libc-0.2-rs/meson.build index 932ea81eedf..d78ff112746 100644 --- a/subprojects/packagefiles/libc-0.2-rs/meson.build +++ b/subprojects/packagefiles/libc-0.2-rs/meson.build @@ -35,7 +35,6 @@ lib = static_library( 'src/lib.rs', rust_abi : 'rust', override_options : ['rust_std=2021', 'build.rust_std=2021'], - native : true, rust_args: libc_args, ) diff --git a/subprojects/packagefiles/log-0.4-rs/meson.build b/subprojects/packagefiles/log-0.4-rs/meson.build index ecc213fed96..c2467f961be 100644 --- a/subprojects/packagefiles/log-0.4-rs/meson.build +++ b/subprojects/packagefiles/log-0.4-rs/meson.build @@ -13,7 +13,6 @@ lib = static_library( 'src/lib.rs', override_options : ['rust_std=2021', 'build.rust_std=2021'], rust_abi : 'rust', - native : true, ) dep_log = declare_dependency( diff --git a/subprojects/packagefiles/remain-0.2-rs/meson.build b/subprojects/packagefiles/remain-0.2-rs/meson.build index 44357b61d87..ead045823db 100644 --- a/subprojects/packagefiles/remain-0.2-rs/meson.build +++ b/subprojects/packagefiles/remain-0.2-rs/meson.build @@ -21,5 +21,5 @@ lib = rust.proc_macro( ) dep_remain = declare_dependency( - link_with : [lib, syn, quote, proc_macro2] + link_with : [lib] ) diff --git a/subprojects/packagefiles/rustix-1-rs/meson.build b/subprojects/packagefiles/rustix-1-rs/meson.build index 96791ffa8fa..457728381a7 100644 --- a/subprojects/packagefiles/rustix-1-rs/meson.build +++ b/subprojects/packagefiles/rustix-1-rs/meson.build @@ -36,7 +36,6 @@ lib = static_library( override_options : ['rust_std=2021', 'build.rust_std=2021'], link_with : [errno, libc, bitflags], rust_abi : 'rust', - native : true, rust_args: rustix_args, ) diff --git a/subprojects/packagefiles/thiserror-2-rs/meson.build b/subprojects/packagefiles/thiserror-2-rs/meson.build index 7f33781d5ab..8740bbf2243 100644 --- a/subprojects/packagefiles/thiserror-2-rs/meson.build +++ b/subprojects/packagefiles/thiserror-2-rs/meson.build @@ -18,10 +18,9 @@ lib = static_library( 'src/lib.rs', override_options : ['rust_std=2021', 'build.rust_std=2021'], rust_abi : 'rust', - native : true, - link_with : [thiserror_impl, syn, quote, proc_macro2] + link_with : [thiserror_impl] ) dep_thiserror = declare_dependency( - link_with : [lib, thiserror_impl, syn, quote, proc_macro2] + link_with : [lib] ) diff --git a/subprojects/packagefiles/thiserror-impl-2-rs/meson.build b/subprojects/packagefiles/thiserror-impl-2-rs/meson.build index d7641cc9377..9c62c042d8f 100644 --- a/subprojects/packagefiles/thiserror-impl-2-rs/meson.build +++ b/subprojects/packagefiles/thiserror-impl-2-rs/meson.build @@ -21,5 +21,5 @@ lib = rust.proc_macro( ) dep_thiserror_impl = declare_dependency( - link_with : [lib, syn, quote, proc_macro2] + link_with : [lib] ) diff --git a/subprojects/packagefiles/zerocopy-0.8-rs/meson.build b/subprojects/packagefiles/zerocopy-0.8-rs/meson.build index 8d7f7622913..db76c755456 100644 --- a/subprojects/packagefiles/zerocopy-0.8-rs/meson.build +++ b/subprojects/packagefiles/zerocopy-0.8-rs/meson.build @@ -16,11 +16,10 @@ lib = static_library( 'src/lib.rs', override_options : ['rust_std=2021', 'build.rust_std=2021'], rust_abi : 'rust', - native : true, rust_args: zerocopy_args, link_with : [zerocopy_derive] ) dep_zerocopy = declare_dependency( - link_with : [lib, zerocopy_derive] + link_with : [lib] ) diff --git a/subprojects/packagefiles/zerocopy-derive-0.8-rs/meson.build b/subprojects/packagefiles/zerocopy-derive-0.8-rs/meson.build index 6f92703715d..cf80bf50caa 100644 --- a/subprojects/packagefiles/zerocopy-derive-0.8-rs/meson.build +++ b/subprojects/packagefiles/zerocopy-derive-0.8-rs/meson.build @@ -21,5 +21,5 @@ lib = rust.proc_macro( ) dep_zerocopy_derive = declare_dependency( - link_with : [lib, syn, quote, proc_macro2] + link_with : [lib] )