Skip to content

Commit 7ac7860

Browse files
authored
Ignore node-addon-api gyp dependency MONGOSH-1039 (#21)
This resolves build failures on Windows when including multiple N-API addons at the same time.
1 parent 6ba2feb commit 7ac7860

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/native-addons.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ async function prepForUsageWithNode (
8686
(config.includes = config.includes || []).push(
8787
path.join(nodeGypDir, 'addon.gypi')
8888
);
89+
// Remove node-addon-api gyp dummy, which inserts nothing.c into
90+
// the build tree, which can conflict with other target's nothing.c
91+
// files.
92+
config.dependencies = config.dependencies?.filter(
93+
dep => !/require\s*\(.+node-addon-api.+\)\s*\.\s*gyp/.test(dep)) ?? [];
8994
config.variables = {
9095
...(config.variables || {}),
9196
'node_root_dir%': nodeSourcePath,

0 commit comments

Comments
 (0)