Crosscompiling for arm64 on a x86 machine

Azure build pipelines don’t yet support arm64 machines (but will soon).

In the meantime, I want at least start building for arm64 in my CI pipelines on Azure.
I’m able to build other projects cmake -G "Visual Studio 17 2022" -DCMAKE_GENERATOR_PLATFORM=arm64 on a Windows agent.

With JUCE (7.0.4) however, the process fails. I found out that it is because juceaide is built (built fo arm64) and executed during the cmake generate call (before even building). Since the agent is a x86/x64 machine, the execution fails.

Is there a simple way to cross-compile? (e.g. have juceaide built for x86 while building my project im arm64)

2 Likes

Did you ever figure out how do this?

Bump - is this fixed?

I believe this should work on the current develop branch, as long as you have both sets of build tools (x64 + ARM64) installed.

This works for me on an x64 machine:

cmake -G "Visual Studio 17 2022" -A ARM64 -B cmake-build-arm64
2 Likes

Nice one, will give it a go. Had my first complaint from an ARM windows user :slight_smile:

Hmm, I’m trying to build native using Github Action windows-11-arm runners.
However they are using an amd64 binary for cmake and thus it recognizes CMAKE_HOST_SYSTEM_PROCESSOR incorrectly as amd64 as well and subsequently setting JUCE_WINDOWS_HELPERS_CAN_RUN to false.

The cause is described here: Windows arm64 hosted runners now available for free in public repositories (Public Preview) · community · Discussion #155713 · GitHub

Your suggestion to add -B cmake-build-arm64 to force the cross-compile doesn’t work though.

Any suggestions on how to proceed?

@drmr-2

I have tried some mang flags and none of them works :frowning: it seems that the whole toolchain is messed up on windows-11-arm images.

My best guess is that we have to wait for the image update

1 Like