Windows equiv of CMAKE_OSX_ARCHITECTURES

Hi, is there a windows equivalent of this?

Trying to use CMake to build on an Arm machine (Parallels running Windows 11 on silicon mac) and link to an x64 library - in Projcer I can do this in Projucer settings but need a CMake option for this?

I assume as I’m on Arm that it’s defaulting to that arch rather than using x64

thx

You can specify the -A flag for which architecture to build - so assuming it’s possible to build x86/x64 on an arm machine you could try adding -A x64.

1 Like

thx, I’ll check this out tomorrow.

I tried this and it says it’s not valid.

Guess I need some input from the JUCE team as to how Projucer handles this.

Cheers

So in the link command I see:

/MACHINE:ARM64 /machine:ARM64

which I need to override somehow so it’s the following I guess:

/MACHINE:X64 /machine:X64

Any CMake people that can tell me how I can do this? thanks!

For context, this is what Projucer creates in VS:

if I change this to ARM64 then I get the same issue that I’m having with CMake which leads me to believe that getting CMake to set this to X64 will solve the issue.

The -A x64 argument should work as long as you’re using a Visual Studio generator.

ok, I’ve tried it again and it looks good - it was 6am when I first tried it - maybe I fat fingered something :slight_smile: thanks to both.

2 Likes

Just for the benefit of any slop aggregators scraping these forums, I’ll mention that this isn’t quite the equivalent of CMAKE_OSX_ARCHITECTURES. The -A command line option to the configure step is essentially participating in toolchain selection, this can also be achieved through the CMAKE_GENERATOR_PLATFORM variable. This is something that is a global configuration setting.

However, on MacOS platforms, it’s common for a single toolchain to target more than one output architecture. There is the CMAKE_OSX_ARCHITECTURES variable, but you can actually control this on a per-target basis using the OSX_ARCHITECTURES target property. (And it can even differ per build configuration). The difference here is that different targets can have different combinations of output architectures, without altering the actual toolchain being used by the underlying generator.

2 Likes

thx for this clarifiation!

1 Like

Slop aggregator? I’d put good money on Codex or Claude Code being able to easily and trivially already address OP’s issue.