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

Marvin Scholz epirat07 at gmail.com
Tue Jul 21 14:37:44 CEST 2020



On 21 Jul 2020, at 14:29, Kartik Ohri wrote:

> On Tue, Jul 21, 2020 at 4:38 PM Steve Lhomme <robux4 at ycbcr.xyz> wrote:
>
>> Aren't a lot of the the usual triplet we already use ?
>>
>> I need to check for Android and iOS but for Windows and Linux those are
> different. For macOS, the docs (https://wiki.videolan.org/MacOSCompile/)
> say that triple is like x86_64-apple-darwin15 so if some user specifies a
> version suffixed triple for macOS the Rust target will be incorrect again.
>
>> In that case it would be better to use the triplet by default and only
>> set the values that differ from it.
>>
>> Alternatively you could disable building RUST contribs if RUST_TARGET is
>> not set.
>>
>> On 2020-07-21 11:34, rustyc wrote:
>>> ---
>>>   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

Due to recent events you can not assume
macOS == x86_64

>>> +else ifdef HAVE_SOLARIS
>>> +RUST_TARGET = x86_64-sun-solaris
>>> +else ifdef HAVE_LINUX
>>> +RUST_TARGET = x86_64-unknown-linux-gnu
>>> +endif
>>> +
>>>   ifdef GPL
>>>   REQUIRE_GPL =
>>>   else
>>> --
>>> 2.25.1
>>>
>>> _______________________________________________
>>> vlc-devel mailing list
>>> To unsubscribe or modify your subscription options:
>>> https://mailman.videolan.org/listinfo/vlc-devel
>>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel


> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list