Skip to content

Commit db7e850

Browse files
committed
build: implement node_use_amaro flag in GN build
1 parent 58a8eb4 commit db7e850

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

node.gni

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ declare_args() {
2020
"deps/cjs-module-lexer/lexer.js",
2121
"deps/cjs-module-lexer/dist/lexer.js",
2222
"deps/undici/undici.js",
23-
"deps/amaro/dist/index.js",
2423
]
2524
}
2625

@@ -59,6 +58,9 @@ declare_args() {
5958
# 1. cross-os compilation is not supported.
6059
# 2. node_mksnapshot crashes when cross-compiling for x64 from arm64.
6160
node_use_node_snapshot = (host_os == target_os) && !(host_cpu == "arm64" && target_cpu == "x64")
61+
62+
# Build with Amaro (TypeScript utils).
63+
node_use_amaro = true
6264
}
6365

6466
assert(!node_enable_inspector || node_use_openssl,

unofficial.gni

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ template("node_gn_build") {
2222
} else {
2323
defines += [ "HAVE_OPENSSL=0" ]
2424
}
25+
if (node_use_amaro) {
26+
defines += [ "HAVE_AMARO=1" ]
27+
} else {
28+
defines += [ "HAVE_AMARO=0" ]
29+
}
2530
if (node_use_v8_platform) {
2631
defines += [ "NODE_USE_V8_PLATFORM=1" ]
2732
} else {
@@ -320,6 +325,9 @@ template("node_gn_build") {
320325
rebase_path("lib", root_build_dir),
321326
"js" ],
322327
"list lines")
328+
if (node_use_amaro) {
329+
node_deps_files += [ "deps/amaro/dist/index.js" ]
330+
}
323331

324332
inputs = node_library_files +
325333
node_deps_files +

0 commit comments

Comments
 (0)