Skip to content

Commit 0225210

Browse files
committed
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>
1 parent e8cc66e commit 0225210

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',
@@ -503,17 +500,7 @@
503500
}],
504501
[ 'node_shared=="true"', {
505502
'node_target_type%': 'shared_library',
506-
'conditions': [
507-
['OS in "aix os400"', {
508-
# For AIX, always generate static library first,
509-
# It needs an extra step to generate exp and
510-
# then use both static lib and exp to create
511-
# shared lib.
512-
'node_intermediate_lib_type': 'static_library',
513-
}, {
514-
'node_intermediate_lib_type': 'shared_library',
515-
}],
516-
],
503+
'node_lib_type': 'shared_library',
517504
}, {
518505
'node_target_type%': 'executable',
519506
}],
@@ -625,6 +612,10 @@
625612
'src/node_main.cc'
626613
],
627614

615+
'dependencies': [
616+
'<(node_lib_target_name)',
617+
],
618+
628619
'msvs_settings': {
629620
'VCLinkerTool': {
630621
'GenerateMapFile': 'true', # /MAP
@@ -657,25 +648,13 @@
657648
'WARNING_CFLAGS': [ '-Werror' ],
658649
},
659650
}],
660-
[ 'node_intermediate_lib_type=="static_library" and '
661-
'node_shared=="true" and OS in "aix os400"', {
662-
# For AIX, shared lib is linked by static lib and .exp. In the
663-
# case here, the executable needs to link to shared lib.
664-
# Therefore, use 'node_aix_shared' target to generate the
665-
# shared lib and then executable.
666-
'dependencies': [ 'node_aix_shared' ],
667-
}, {
668-
'dependencies': [ '<(node_lib_target_name)' ],
669-
'conditions': [
670-
['OS=="win" and node_shared=="true"', {
671-
'dependencies': ['generate_node_def'],
672-
'msvs_settings': {
673-
'VCLinkerTool': {
674-
'ModuleDefinitionFile': '<(PRODUCT_DIR)/<(node_core_target_name).def',
675-
},
676-
},
677-
}],
678-
],
651+
['node_shared=="true" and OS=="win"', {
652+
'dependencies': ['generate_node_def'],
653+
'msvs_settings': {
654+
'VCLinkerTool': {
655+
'ModuleDefinitionFile': '<(PRODUCT_DIR)/<(node_core_target_name).def',
656+
},
657+
},
679658
}],
680659
[ 'node_shared=="false"', {
681660
# Keep this whole-archive section in sync with the `node_lib` target below.
@@ -1114,7 +1093,7 @@
11141093
}, # node_base
11151094
{
11161095
'target_name': '<(node_lib_target_name)',
1117-
'type': '<(node_intermediate_lib_type)',
1096+
'type': '<(node_lib_type)',
11181097
'includes': [
11191098
'node.gypi',
11201099
],
@@ -1234,7 +1213,10 @@
12341213
},
12351214
}],
12361215
['node_shared=="true" and OS in "aix os400"', {
1237-
'product_name': 'node_base',
1216+
'ldflags': ['--shared'],
1217+
'direct_dependent_settings': {
1218+
'ldflags': [ '-Wl,-brtl' ],
1219+
},
12381220
}],
12391221
[ 'node_shared=="true" and OS=="win"', {
12401222
'sources': [
@@ -1816,33 +1798,6 @@
18161798
], # end targets
18171799

18181800
'conditions': [
1819-
['OS in "aix os400" and node_shared=="true"', {
1820-
'targets': [
1821-
{
1822-
'target_name': 'node_aix_shared',
1823-
'type': 'shared_library',
1824-
'product_name': '<(node_core_target_name)',
1825-
'ldflags': ['--shared'],
1826-
'product_extension': '<(shlib_suffix)',
1827-
'includes': [
1828-
'node.gypi'
1829-
],
1830-
'dependencies': ['<(node_lib_target_name)'],
1831-
'include_dirs': [
1832-
'src',
1833-
'deps/v8/include',
1834-
],
1835-
'sources': [
1836-
'<@(library_files)',
1837-
'<@(deps_files)',
1838-
'common.gypi',
1839-
],
1840-
'direct_dependent_settings': {
1841-
'ldflags': [ '-Wl,-brtl' ],
1842-
},
1843-
},
1844-
]
1845-
}], # end aix section
18461801
['OS=="win" and node_shared=="true"', {
18471802
'targets': [
18481803
{

0 commit comments

Comments
 (0)