Allow to explicitly define a build as (not) cross-compiled
Checklist
-
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
Build and compilation
Description of change
This fixes issue #10271 (closed), allowing to explicitly set that we are doing a cross-compilation (or not, if we desire so) instead of only rely on heuristics. This is useful when you are compiling to the same target CPU of your host system by using a toolchain that uses a different C lib (like musl from glib), since mkpeephole
gets compiled with the cross-toolchain and later can't be executed. This way we can force it to use the host toolchain instead. By default it still use the heuristics.
I have checked that it correctly set the GYP variables correctly and the compiled Node.js works as expected.