GYP3
GYP3 copied to clipboard
Support ARM64 Windows dual-toolchain MSVC cross-compilation
The simplest cross-compilation scenario is compiling source on one architecture for another. Currently, MSVC and GYP both support this for ARM64--that is, MSVC provides x64-arm64 and x86-arm64 toolchains, while GYP supports generating MSVC projects that use either of these.
If the project requires compiling and then running tools (such as v8's mksnapshot during the Node.js build), then both the ARM64 and x64 toolchains need to be invoked during the build. MSVC partially supports this--each project can contain multiple configurations--but currently GYP only supports using one toolchain at a time. See https://github.com/refack/GYP/blob/master/pylib/gyp/generator/msvs.py#L1849
The simplest solution would be to support emitting projects with two toolchain configurations, then letting the user invoke msbuild twice with two configurations.
The ideal solution would be to use msbuild magic to emit projects such that msbuild need only be invoked once, but I don't know if this is possible.
My instinct is to say - let's get this working with ninja first...
From the code comments and the build markup, I would be surprised if it weren't already working with ninja. I got the impression the only way it didn't work was with the msbuild generator...but I have not yet tried.
N.B. This would be cool and convenient, but I expect this to be a lot of work and so I have no expectations around timing.
This issue could be resolved by this PR: https://github.com/nodejs/node-gyp/pull/1678
(Presumably the submitter has done basic validation, but I haven't validated it myself.)