Skip to content
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: fix static dll compilation on Windows #30695

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'node_shared_openssl%': 'false',
'node_v8_options%': '',
'node_core_target_name%': 'node',
'node_target_type%': 'executable',
'node_lib_target_name%': 'libnode',
'node_intermediate_lib_type%': 'static_library',
'node_builtin_modules_path%': '',
Expand Down Expand Up @@ -251,14 +252,16 @@
[ 'node_shared=="true"', {
'node_target_type%': 'shared_library',
'conditions': [
['OS=="aix"', {
['OS in ("aix", "win")', {
# For AIX, always generate static library first,
# It needs an extra step to generate exp and
# then use both static lib and exp to create
# shared lib.
'node_intermediate_lib_type': 'static_library',
# For Windows, always generate static library,
# which is necessary to compile node.dll
'node_intermediate_lib_type%': 'static_library',
}, {
'node_intermediate_lib_type': 'shared_library',
'node_intermediate_lib_type%': 'shared_library',
}],
],
}, {
Expand Down Expand Up @@ -313,7 +316,7 @@
'targets': [
{
'target_name': '<(node_core_target_name)',
'type': 'executable',
'type': '<(node_target_type)',

'defines': [
'NODE_WANT_INTERNALS=1',
Expand Down Expand Up @@ -746,6 +749,7 @@
'libraries': [
'Dbghelp',
'Psapi',
'Winmm',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is necessary to build v8_base, shouldn't this be placed in the v8 gypfiles? cc @targos @ryzokuken

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly. What exactly in V8 uses Winmm APIs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#28845 (comment) was the initial explanation as to why I had to add it at this level, so potentially there is something wrong in the gyp configuration of v8?

Regarding what is using it exactly, it's the use of __imp_timeGetTime. From the errors (as shown in #28845 (comment)) I Googled it and the solution was to add Winmm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this blocking?

],
}],
[ 'node_use_etw=="true"', {
Expand Down