-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: use target_arch config variable to link against node.lib #964
Conversation
…ndows Using `target_arch` in addon.gypi to link against Node.js library. This variable was written into build/config.gypi on the `configure` stage. Do not copy node.lib into node_root_dir/Release or node_root_dir/Debug on Windows, link it from node_root_dir/target_arch directory. Removed unused copyNodeLib() function Removed unused `copy_dev_lib` variable introduced in commit @84d24189735e19350a93aaf9f6a327bb4c52349e
addon.gypi
Outdated
@@ -92,7 +92,7 @@ | |||
'-luuid.lib', | |||
'-lodbc32.lib', | |||
'-lDelayImp.lib', | |||
'-l"<(node_root_dir)/$(ConfigurationName)/<(node_lib_file)"' | |||
'-l"<(node_root_dir)/<(target_arch)/<(node_lib_file)"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will break users on Windows who compile Node.js from source and use --nodedir
to point at their source tree. When building from source, the node.lib
file is written to either the Release
or Debug
directory depending on the build configuration (i.e. the value of $(ConfigurationName)
) used.
Set path to node lib in `$(Configuration)` dir when `--nodedir` option is supplied, otherwise use value of `target_arch` variable.
@richardlau, thanks for pointing out the I've changed the |
I need to defer to @nodejs/platform-windows folks on this, is it safe to compile against a node.lib that's not in the build directory? Is it statically linked so that if it gets deleted in the original location then it won't cause problems? @pmed does this work on Node.js v0.10 and v0.12? Lots of stuff changed on the v4 bump including file locations. |
I've checked these changes with Node versions |
@pmed don't let us forget about this, we're going to start work on v4 and this would be a good inclusion for testing |
Ping @nodejs/platform-windows, see @rvagg's question here: #964 (comment)
|
It seems there could be a case, when a user would remove nodeir after But I don't think this is a issue, because in this case |
ping @nodejs/platform-windows we need your help to get this landed. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tested deleting the .lib after compiling, just to be sure. No problem.
The commit messages should obey the line sizes in https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit . Perhaps use build,win:
.
For the commit messages, maybe something like:
and
|
@rvagg @bnoordhuis can I land this? @pmed let me know if you object to me rewording the commit messages to @gibfahn 's suggestion above. |
@joaocgreis Yes, if you think it's good to go and CI is green. |
Using `target_arch` in addon.gypi to link against Node.js library. This variable was written into build/config.gypi on the `configure` stage. Do not copy node.lib into node_root_dir/Release or node_root_dir/Debug on Windows, link it from node_root_dir/target_arch directory. PR-URL: #964 Reviewed-By: João Reis <[email protected]>
Set path to node lib in `$(Configuration)` dir when `--nodedir` option is supplied, otherwise use value of `target_arch` variable. PR-URL: #964 Reviewed-By: João Reis <[email protected]>
PR extracted form #962
on Windows
Using
target_arch
in addon.gypi to link against Node.js library.This variable was written into build/config.gypi on the
configure
stage.Do not copy node.lib into node_root_dir/Release or node_root_dir/Debug
on Windows, link it from node_root_dir/target_arch directory.
Removed unused copyNodeLib() function
Removed unused
copy_dev_lib
variable introduced in commit@84d24189735e19350a93aaf9f6a327bb4c52349e