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,win: rename node.lib to libnode.lib #27150

Merged
merged 1 commit into from
Apr 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 3 additions & 39 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'node_v8_options%': '',
'node_enable_v8_vtunejit%': 'false',
'node_core_target_name%': 'node',
'node_lib_target_name%': 'node_lib',
'node_lib_target_name%': 'libnode',
Copy link
Member

Choose a reason for hiding this comment

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

I think this would make the product..liblibnode.so/liblibnode.dylib on other platforms? (looks a bit funny, but probably not a big deal)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this would make the product..liblibnode.so/liblibnode.dylib on other platforms?

This is the line I see on linuxONE for example:

ar crsT /data/iojs/build/workspace/node-test-commit-linuxone/nodes/rhel72-s390x/out/Release/obj.target/libnode.a ...
                                                                                                       ^^^^^^^^^

'node_intermediate_lib_type%': 'static_library',
'library_files': [
'lib/internal/bootstrap/environment.js',
Expand Down Expand Up @@ -335,7 +335,7 @@
'msvs_settings': {
'VCLinkerTool': {
'AdditionalOptions': [
'/WHOLEARCHIVE:<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
'/WHOLEARCHIVE:<(node_lib_target_name)<(STATIC_LIB_SUFFIX)',
],
},
},
Expand Down Expand Up @@ -364,12 +364,6 @@
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
[ 'node_intermediate_lib_type=="shared_library" and OS=="win"', {
# On Windows, having the same name for both executable and shared
# lib causes filename collision. Need a different PRODUCT_NAME for
# the executable and rename it back to node.exe later
'product_name': '<(node_core_target_name)-win',
}],
[ 'node_report=="true"', {
'defines': [
'NODE_REPORT',
Expand Down Expand Up @@ -441,9 +435,8 @@
{
'target_name': '<(node_lib_target_name)',
'type': '<(node_intermediate_lib_type)',
'product_name': '<(node_core_target_name)',
'includes': [
'node.gypi'
'node.gypi',
],

'include_dirs': [
Expand Down Expand Up @@ -1017,41 +1010,12 @@
} ],
]
}, # specialize_node_d
{
# When using shared lib to build executable in Windows, in order to avoid
# filename collision, the executable name is node-win.exe. Need to rename
# it back to node.exe
'target_name': 'rename_node_bin_win',
'type': 'none',
'dependencies': [
'<(node_core_target_name)',
],
'conditions': [
[ 'OS=="win" and node_intermediate_lib_type=="shared_library"', {
'actions': [
{
'action_name': 'rename_node_bin_win',
'inputs': [
'<(PRODUCT_DIR)/<(node_core_target_name)-win.exe'
],
'outputs': [
'<(PRODUCT_DIR)/<(node_core_target_name).exe',
],
'action': [
'move', '<@(_inputs)', '<@(_outputs)',
],
},
],
} ],
]
}, # rename_node_bin_win
{
'target_name': 'cctest',
'type': 'executable',

'dependencies': [
'<(node_lib_target_name)',
'rename_node_bin_win',
'deps/gtest/gtest.gyp:gtest',
'deps/histogram/histogram.gyp:histogram',
'node_dtrace_header',
Expand Down
6 changes: 3 additions & 3 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ set "msbplatform=Win32"
if "%target_arch%"=="x64" set "msbplatform=x64"
if "%target_arch%"=="arm64" set "msbplatform=ARM64"
if "%target%"=="Build" (
if defined no_cctest set target=rename_node_bin_win
if "%test_args%"=="" set target=rename_node_bin_win
if defined no_cctest set target=node
if "%test_args%"=="" set target=node
if defined cctest set target="Build"
)
if "%target%"=="rename_node_bin_win" if exist "%config%\cctest.exe" del "%config%\cctest.exe"
if "%target%"=="node" if exist "%config%\cctest.exe" del "%config%\cctest.exe"
if defined msbuild_args set "extra_msbuild_args=%extra_msbuild_args% %msbuild_args%"
msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoItemAndPropertyList;Verbosity=minimal /nologo %extra_msbuild_args%
if errorlevel 1 (
Expand Down