From d040c4498994ce71c29ff9333351507eeea1e011 Mon Sep 17 00:00:00 2001 From: Mary Marchini Date: Sun, 30 Jan 2022 01:27:08 -0800 Subject: [PATCH 1/3] analysis: add cmake toolchain analysis --- toolchain-analysis/cmake.md | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 toolchain-analysis/cmake.md diff --git a/toolchain-analysis/cmake.md b/toolchain-analysis/cmake.md new file mode 100644 index 0000000..814ea41 --- /dev/null +++ b/toolchain-analysis/cmake.md @@ -0,0 +1,52 @@ +# Bazel toolchain analysis + +[CMake](https://cmake.org) is an open-source, cross-platform family of tools +designed to build, test and package software. CMake is used to control the +software compilation process using simple platform and compiler independent +configuration files, and generate native makefiles and workspaces that can be +used in the compiler environment of your choice. + +## Supported platforms + +TODO: test cmake against currently Node.js supported platforms and toolchains +(see [BUILDING.MD](https://github.com/nodejs/node/edit/master/BUILDING.md)). + +### Unsupported platforms + +TODO: see above + +## Pros + +* Widely used by C++ projects (probably the most used toolchain besides of + `make` and `autotools`). +* Easier to upgrade all our dependencies (except V8) and easier to add new + dependencies that use or are compatible with CMake (which is likely based on + previous point) +* It's been around for over two decades +* Due to its popularity, it's the most likely toolchain to support all of our + platforms within our minimum version constraints + +## Cons + +* CMake is not on V8 tree, therefore, V8 upgrades would be just as hard as today + with gyp + + +## Known ports + +* No open source known ports [1^] + +[1^]: It's not a full Node.js port, but + [bnoordhuis/v8-cmake](https://github.com/bnoordhuis/v8-cmake) adds cmake + support to V8 + +## Need more info + +* Would cmake build affect Electron ability to build Node.js with GN in any way? + +## Observations + +* There seems to be positive reception at the idea of cmake for native modules, + having the same build system for building Node.js and its native modules +* There is the possibility of using cmake to build everything except V8, using + GN to build V8 and then linking it statically to Node.js From 5711cc6e90032b7f1b53ca63cf5d795649678151 Mon Sep 17 00:00:00 2001 From: mary marchini Date: Sun, 30 Jan 2022 01:32:47 -0800 Subject: [PATCH 2/3] Update toolchain-analysis/cmake.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michaƫl Zasso --- toolchain-analysis/cmake.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain-analysis/cmake.md b/toolchain-analysis/cmake.md index 814ea41..8fcda87 100644 --- a/toolchain-analysis/cmake.md +++ b/toolchain-analysis/cmake.md @@ -1,4 +1,4 @@ -# Bazel toolchain analysis +# CMake toolchain analysis [CMake](https://cmake.org) is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the From 289f8571cdc3ca8f5d2ca49c424ee4323079d18d Mon Sep 17 00:00:00 2001 From: mary marchini Date: Tue, 1 Feb 2022 18:25:41 -0800 Subject: [PATCH 3/3] Update toolchain-analysis/cmake.md Co-authored-by: Michael Dawson --- toolchain-analysis/cmake.md | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchain-analysis/cmake.md b/toolchain-analysis/cmake.md index 8fcda87..f8e2e52 100644 --- a/toolchain-analysis/cmake.md +++ b/toolchain-analysis/cmake.md @@ -48,5 +48,6 @@ TODO: see above * There seems to be positive reception at the idea of cmake for native modules, having the same build system for building Node.js and its native modules +* It is already possible to build node-addon-api based native modules with cmake. * There is the possibility of using cmake to build everything except V8, using GN to build V8 and then linking it statically to Node.js