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.
This commit is contained in:
Jeremy Apthorp 2018-06-28 14:42:09 -07:00 committed by GitHub
parent 733e495e91
commit 59fb4eccb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,18 +66,23 @@ action("build_node") {
":gyp_node", ":gyp_node",
] ]
script = "//electron/build/run-ninja.py" script = "//electron/build/run-ninja.py"
if (is_debug) {
configuration = "Debug"
} else {
configuration = "Release"
}
args = [ args = [
"-C", rebase_path(target_out_dir, root_build_dir) + "/Release", "-C", rebase_path(target_out_dir, root_build_dir) + "/$configuration",
"node_lib" "node_lib"
] ]
if (is_mac) { if (is_mac) {
outputs = [ "$target_out_dir/Release/libnode.dylib" ] outputs = [ "$target_out_dir/$configuration/libnode.dylib" ]
} }
if (is_linux) { if (is_linux) {
outputs = [ "$target_out_dir/Release/lib/libnode.so" ] outputs = [ "$target_out_dir/$configuration/lib/libnode.so" ]
} }
if (is_win) { 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" ]
} }
} }