From 57f23b40508a283e1adb51ba8456ec4eb73f2a33 Mon Sep 17 00:00:00 2001 From: Cheng Date: Mon, 11 Nov 2024 13:33:06 +0900 Subject: [PATCH] build: implement node_use_amaro flag in GN build PR-URL: https://github.com/nodejs/node/pull/55798 Refs: https://github.com/nodejs/node/pull/54136 Reviewed-By: Marco Ippolito Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca --- node.gni | 3 +++ tools/generate_config_gypi.py | 1 + unofficial.gni | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/node.gni b/node.gni index 9dca810dece..057686f0046 100644 --- a/node.gni +++ b/node.gni @@ -59,6 +59,9 @@ declare_args() { # 1. cross-os compilation is not supported. # 2. node_mksnapshot crashes when cross-compiling for x64 from arm64. node_use_node_snapshot = (host_os == target_os) && !(host_cpu == "arm64" && target_cpu == "x64") + + # Build with Amaro (TypeScript utils). + node_use_amaro = true } assert(!node_enable_inspector || node_use_openssl, diff --git a/tools/generate_config_gypi.py b/tools/generate_config_gypi.py index c9dd4a24a39..ac8edb6896a 100755 --- a/tools/generate_config_gypi.py +++ b/tools/generate_config_gypi.py @@ -61,6 +61,7 @@ def translate_config(out_dir, config, v8_config): eval(config['node_builtin_shareable_builtins']), 'node_module_version': int(config['node_module_version']), 'node_use_openssl': config['node_use_openssl'], + 'node_use_amaro': config['node_use_amaro'], 'node_use_node_code_cache': config['node_use_node_code_cache'], 'node_use_node_snapshot': config['node_use_node_snapshot'], 'v8_enable_inspector': # this is actually a node misnomer diff --git a/unofficial.gni b/unofficial.gni index 4a2eeed1876..1caadb88346 100644 --- a/unofficial.gni +++ b/unofficial.gni @@ -22,6 +22,11 @@ template("node_gn_build") { } else { defines += [ "HAVE_OPENSSL=0" ] } + if (node_use_amaro) { + defines += [ "HAVE_AMARO=1" ] + } else { + defines += [ "HAVE_AMARO=0" ] + } if (node_use_v8_platform) { defines += [ "NODE_USE_V8_PLATFORM=1" ] } else {