Skip to content

Commit 88beaf0

Browse files
committed
build,win: rename node.lib to libnode.lib
eliminate the need for `rename_node_bin_win` PR-URL: #27150 Reviewed-By: Joyee Cheung <[email protected]>
1 parent 2e4ceb5 commit 88beaf0

File tree

2 files changed

+6
-42
lines changed

2 files changed

+6
-42
lines changed

node.gyp

+3-39
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'node_v8_options%': '',
2323
'node_enable_v8_vtunejit%': 'false',
2424
'node_core_target_name%': 'node',
25-
'node_lib_target_name%': 'node_lib',
25+
'node_lib_target_name%': 'libnode',
2626
'node_intermediate_lib_type%': 'static_library',
2727
'library_files': [
2828
'lib/internal/bootstrap/environment.js',
@@ -335,7 +335,7 @@
335335
'msvs_settings': {
336336
'VCLinkerTool': {
337337
'AdditionalOptions': [
338-
'/WHOLEARCHIVE:<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
338+
'/WHOLEARCHIVE:<(node_lib_target_name)<(STATIC_LIB_SUFFIX)',
339339
],
340340
},
341341
},
@@ -364,12 +364,6 @@
364364
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
365365
},
366366
}],
367-
[ 'node_intermediate_lib_type=="shared_library" and OS=="win"', {
368-
# On Windows, having the same name for both executable and shared
369-
# lib causes filename collision. Need a different PRODUCT_NAME for
370-
# the executable and rename it back to node.exe later
371-
'product_name': '<(node_core_target_name)-win',
372-
}],
373367
[ 'node_report=="true"', {
374368
'defines': [
375369
'NODE_REPORT',
@@ -441,9 +435,8 @@
441435
{
442436
'target_name': '<(node_lib_target_name)',
443437
'type': '<(node_intermediate_lib_type)',
444-
'product_name': '<(node_core_target_name)',
445438
'includes': [
446-
'node.gypi'
439+
'node.gypi',
447440
],
448441

449442
'include_dirs': [
@@ -1017,41 +1010,12 @@
10171010
} ],
10181011
]
10191012
}, # specialize_node_d
1020-
{
1021-
# When using shared lib to build executable in Windows, in order to avoid
1022-
# filename collision, the executable name is node-win.exe. Need to rename
1023-
# it back to node.exe
1024-
'target_name': 'rename_node_bin_win',
1025-
'type': 'none',
1026-
'dependencies': [
1027-
'<(node_core_target_name)',
1028-
],
1029-
'conditions': [
1030-
[ 'OS=="win" and node_intermediate_lib_type=="shared_library"', {
1031-
'actions': [
1032-
{
1033-
'action_name': 'rename_node_bin_win',
1034-
'inputs': [
1035-
'<(PRODUCT_DIR)/<(node_core_target_name)-win.exe'
1036-
],
1037-
'outputs': [
1038-
'<(PRODUCT_DIR)/<(node_core_target_name).exe',
1039-
],
1040-
'action': [
1041-
'move', '<@(_inputs)', '<@(_outputs)',
1042-
],
1043-
},
1044-
],
1045-
} ],
1046-
]
1047-
}, # rename_node_bin_win
10481013
{
10491014
'target_name': 'cctest',
10501015
'type': 'executable',
10511016

10521017
'dependencies': [
10531018
'<(node_lib_target_name)',
1054-
'rename_node_bin_win',
10551019
'deps/gtest/gtest.gyp:gtest',
10561020
'deps/histogram/histogram.gyp:histogram',
10571021
'node_dtrace_header',

vcbuild.bat

+3-3
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,11 @@ set "msbplatform=Win32"
311311
if "%target_arch%"=="x64" set "msbplatform=x64"
312312
if "%target_arch%"=="arm64" set "msbplatform=ARM64"
313313
if "%target%"=="Build" (
314-
if defined no_cctest set target=rename_node_bin_win
315-
if "%test_args%"=="" set target=rename_node_bin_win
314+
if defined no_cctest set target=node
315+
if "%test_args%"=="" set target=node
316316
if defined cctest set target="Build"
317317
)
318-
if "%target%"=="rename_node_bin_win" if exist "%config%\cctest.exe" del "%config%\cctest.exe"
318+
if "%target%"=="node" if exist "%config%\cctest.exe" del "%config%\cctest.exe"
319319
if defined msbuild_args set "extra_msbuild_args=%extra_msbuild_args% %msbuild_args%"
320320
msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoItemAndPropertyList;Verbosity=minimal /nologo %extra_msbuild_args%
321321
if errorlevel 1 (

0 commit comments

Comments
 (0)