From d731ef2a28bc5157acadad27f5ae50483cd4af61 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Aug 2023 16:06:16 +0900 Subject: [PATCH] src: allow embedders to override NODE_MODULE_VERSION --- src/node_version.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/node_version.h b/src/node_version.h index 6768e5b1306fde..9001284dabf584 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -83,13 +83,20 @@ * We will, at times update the version of V8 shipped in the release line * if it can be made ABI compatible with the previous version. * + * Embedders building Node.js can define NODE_EMBEDDER_MODULE_VERSION to + * override the default value of NODE_MODULE_VERSION. + * * The registry of used NODE_MODULE_VERSION numbers is located at * https://github.com/nodejs/node/blob/HEAD/doc/abi_version_registry.json * Extenders, embedders and other consumers of Node.js that require ABI * version matching should open a pull request to reserve a number in this * registry. */ +#if defined(NODE_EMBEDDER_MODULE_VERSION) +#define NODE_MODULE_VERSION NODE_EMBEDDER_MODULE_VERSION +#else #define NODE_MODULE_VERSION 115 +#endif // The NAPI_VERSION supported by the runtime. This is the inclusive range of // versions which the Node.js binary being built supports.