Skip to content

Commit 1124c06

Browse files
legendecasaduh95
authored andcommitted
build: remove redundant intermediate node_aix_shared
With the introduction of always static target `node_base`, `node_aix_shared` is now redundant. Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net> PR-URL: #63747 Refs: #63626 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 363912a commit 1124c06

1 file changed

Lines changed: 19 additions & 64 deletions

File tree

node.gyp

Lines changed: 19 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
'node_builtin_modules_path%': '',
99
# `node` executable target name.
1010
'node_core_target_name%': 'node',
11-
# Derived flag from `node_shared`.
12-
# On most platforms, this is `static_library` if `node_shared` is false and `shared_library` if `node_shared` is true.
13-
# AIX needs to generate static library first and then link to shared library `node_aix_shared`.
14-
# TODO(legendecas): move this to depend on target `node_base` in AIX build .
15-
'node_intermediate_lib_type%': 'static_library',
11+
# `libnode` target type, `static_library` if `node_shared` is false and `shared_library` if `node_shared` is true.
12+
'node_lib_type%': 'static_library',
1613
# `libnode` target name, can be a `static_library` or `shared_library` based on `node_shared`.
1714
# NOTE: Gyp will prefix this with `lib` if this name does not start with `lib`.
1815
'node_lib_target_name%': 'libnode',
@@ -492,17 +489,7 @@
492489
}],
493490
[ 'node_shared=="true"', {
494491
'node_target_type%': 'shared_library',
495-
'conditions': [
496-
['OS in "aix os400"', {
497-
# For AIX, always generate static library first,
498-
# It needs an extra step to generate exp and
499-
# then use both static lib and exp to create
500-
# shared lib.
501-
'node_intermediate_lib_type': 'static_library',
502-
}, {
503-
'node_intermediate_lib_type': 'shared_library',
504-
}],
505-
],
492+
'node_lib_type': 'shared_library',
506493
}, {
507494
'node_target_type%': 'executable',
508495
}],
@@ -614,6 +601,10 @@
614601
'src/node_main.cc'
615602
],
616603

604+
'dependencies': [
605+
'<(node_lib_target_name)',
606+
],
607+
617608
'msvs_settings': {
618609
'VCLinkerTool': {
619610
'GenerateMapFile': 'true', # /MAP
@@ -646,25 +637,13 @@
646637
'WARNING_CFLAGS': [ '-Werror' ],
647638
},
648639
}],
649-
[ 'node_intermediate_lib_type=="static_library" and '
650-
'node_shared=="true" and OS in "aix os400"', {
651-
# For AIX, shared lib is linked by static lib and .exp. In the
652-
# case here, the executable needs to link to shared lib.
653-
# Therefore, use 'node_aix_shared' target to generate the
654-
# shared lib and then executable.
655-
'dependencies': [ 'node_aix_shared' ],
656-
}, {
657-
'dependencies': [ '<(node_lib_target_name)' ],
658-
'conditions': [
659-
['OS=="win" and node_shared=="true"', {
660-
'dependencies': ['generate_node_def'],
661-
'msvs_settings': {
662-
'VCLinkerTool': {
663-
'ModuleDefinitionFile': '<(PRODUCT_DIR)/<(node_core_target_name).def',
664-
},
665-
},
666-
}],
667-
],
640+
['node_shared=="true" and OS=="win"', {
641+
'dependencies': ['generate_node_def'],
642+
'msvs_settings': {
643+
'VCLinkerTool': {
644+
'ModuleDefinitionFile': '<(PRODUCT_DIR)/<(node_core_target_name).def',
645+
},
646+
},
668647
}],
669648
[ 'node_shared=="false"', {
670649
# Keep this whole-archive section in sync with the `node_lib` target below.
@@ -1095,7 +1074,7 @@
10951074
}, # node_base
10961075
{
10971076
'target_name': '<(node_lib_target_name)',
1098-
'type': '<(node_intermediate_lib_type)',
1077+
'type': '<(node_lib_type)',
10991078
'includes': [
11001079
'node.gypi',
11011080
],
@@ -1215,7 +1194,10 @@
12151194
},
12161195
}],
12171196
['node_shared=="true" and OS in "aix os400"', {
1218-
'product_name': 'node_base',
1197+
'ldflags': ['--shared'],
1198+
'direct_dependent_settings': {
1199+
'ldflags': [ '-Wl,-brtl' ],
1200+
},
12191201
}],
12201202
[ 'node_shared=="true" and OS=="win"', {
12211203
'sources': [
@@ -1797,33 +1779,6 @@
17971779
], # end targets
17981780

17991781
'conditions': [
1800-
['OS in "aix os400" and node_shared=="true"', {
1801-
'targets': [
1802-
{
1803-
'target_name': 'node_aix_shared',
1804-
'type': 'shared_library',
1805-
'product_name': '<(node_core_target_name)',
1806-
'ldflags': ['--shared'],
1807-
'product_extension': '<(shlib_suffix)',
1808-
'includes': [
1809-
'node.gypi'
1810-
],
1811-
'dependencies': ['<(node_lib_target_name)'],
1812-
'include_dirs': [
1813-
'src',
1814-
'deps/v8/include',
1815-
],
1816-
'sources': [
1817-
'<@(library_files)',
1818-
'<@(deps_files)',
1819-
'common.gypi',
1820-
],
1821-
'direct_dependent_settings': {
1822-
'ldflags': [ '-Wl,-brtl' ],
1823-
},
1824-
},
1825-
]
1826-
}], # end aix section
18271782
['OS=="win" and node_shared=="true"', {
18281783
'targets': [
18291784
{

0 commit comments

Comments
 (0)