From 59fb4eccb4c5552a68820f79ab6219827e814ed2 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Thu, 28 Jun 2018 14:42:09 -0700 Subject: [PATCH] chore: [gn] link against debug node when in debug mode (#13490) This is required on Windows, because in Debug mode, C++ stdlib containers have a different size to when in Release mode, so the code in `node.dll` thought that `node::Environment` was a different size to the code in `electron.exe`, which uh, caused problems. It should also make debugging through node a bit easier on all platforms. --- build/node/BUILD.gn | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build/node/BUILD.gn b/build/node/BUILD.gn index 686fdac5569a..a36d3a5654f5 100644 --- a/build/node/BUILD.gn +++ b/build/node/BUILD.gn @@ -66,18 +66,23 @@ action("build_node") { ":gyp_node", ] script = "//electron/build/run-ninja.py" + if (is_debug) { + configuration = "Debug" + } else { + configuration = "Release" + } args = [ - "-C", rebase_path(target_out_dir, root_build_dir) + "/Release", + "-C", rebase_path(target_out_dir, root_build_dir) + "/$configuration", "node_lib" ] if (is_mac) { - outputs = [ "$target_out_dir/Release/libnode.dylib" ] + outputs = [ "$target_out_dir/$configuration/libnode.dylib" ] } if (is_linux) { - outputs = [ "$target_out_dir/Release/lib/libnode.so" ] + outputs = [ "$target_out_dir/$configuration/lib/libnode.so" ] } if (is_win) { - outputs = [ "$target_out_dir/Release/node.dll.lib", "$target_out_dir/Release/node.dll" ] + outputs = [ "$target_out_dir/$configuration/node.dll.lib", "$target_out_dir/$configuration/node.dll" ] } }