[vlc-devel] [PATCH 2/4] Add cross-compilation targets for Rust contribs

Rémi Denis-Courmont remi at remlab.net
Tue Jul 21 15:47:20 CEST 2020


Le tiistaina 21. heinäkuuta 2020, 12.34.06 EEST rustyc a écrit :
> ---
>  contrib/src/main.mak | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
> index 3119a39875..c8d7df4202 100644
> --- a/contrib/src/main.mak
> +++ b/contrib/src/main.mak
> @@ -440,6 +440,36 @@ else
>  MESON = meson $(MESONFLAGS)
>  endif
> 
> +ifdef HAVE_WIN32
> +RUST_TARGET = i686-pc-windows-gnu
> +else ifdef HAVE_WIN64
> +RUST_TARGET = x86_64-pc-windows-gnu
> +else ifdef HAVE_BSD
> +RUST_TARGET = x86_64-unknown-freebsd
> +else ifdef HAVE_ANDROID
> +ifeq ($(PLATFORM_SHORT_ARCH), arm64)
> +RUST_TARGET = aarch64-linux-android
> +else ifeq ($(PLATFORM_SHORT_ARCH), arm)
> +RUST_TARGET = arm-linux-androideabi
> +else ifeq ($(PLATFORM_SHORT_ARCH), x86)
> +RUST_TARGET = i686-linux-android
> +else ifeq ($(PLATFORM_SHORT_ARCH), x86_64)
> +RUST_TARGET = x86_64-linux-android
> +endif
> +else ifdef HAVE_IOS
> +ifeq ($(PLATFORM_SHORT_ARCH), arm64)
> +RUST_TARGET = aarch64-apple-ios
> +else ifeq ($(PLATFORM_SHORT_ARCH), x86_64)
> +RUST_TARGET = x86_64-apple-ios
> +endif
> +else ifdef HAVE_MACOSX
> +RUST_TARGET = x86_64-apple-darwin
> +else ifdef HAVE_SOLARIS
> +RUST_TARGET = x86_64-sun-solaris
> +else ifdef HAVE_LINUX
> +RUST_TARGET = x86_64-unknown-linux-gnu
> +endif

No matter how you look at this, it's wrong. What Steve said. Also BSD is a 
necessary but not sufficient condition for FreeBSD.

I doubt that, but if you really need complex logic, like get-arch.sh.

> +
>  ifdef GPL
>  REQUIRE_GPL =
>  else


-- 
Реми Дёни-Курмон
http://www.remlab.net/





More information about the vlc-devel mailing list