build: add GN build files
As per discussion in https://github.com/nodejs/TSC/issues/1353, this PR adds GN build files into Node's repo.
I have provided 2 ways to test the build:
- Build with a standalone version of GN.
- Build with
depot_tools
from Chromium.
Both have GitHub actions successfully building for win/mac/linux on arm/arm64/x64/x86.
This PR only adds configurations for building the node target, it does not include configurations for building tests, which I plan to add in a later PR, to make review easier.
After this is merged to Node, I'll upstream my changes in https://github.com/photoionization/node-ci to https://chromium.googlesource.com/v8/node-ci/, which is used by V8 team to test Node.js with latest V8. I'll also setup a nightly build of Node with gn in https://github.com/photoionization/node_with_gn, so we can find out early when the gn build is broken.
/cc @codebytere @victorgomes @joyeecheung @targos