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
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.
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.
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.