|
8 | 8 | 'node_builtin_modules_path%': '', |
9 | 9 | # `node` executable target name. |
10 | 10 | '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', |
16 | 13 | # `libnode` target name, can be a `static_library` or `shared_library` based on `node_shared`. |
17 | 14 | # NOTE: Gyp will prefix this with `lib` if this name does not start with `lib`. |
18 | 15 | 'node_lib_target_name%': 'libnode', |
|
503 | 500 | }], |
504 | 501 | [ 'node_shared=="true"', { |
505 | 502 | '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', |
517 | 504 | }, { |
518 | 505 | 'node_target_type%': 'executable', |
519 | 506 | }], |
|
625 | 612 | 'src/node_main.cc' |
626 | 613 | ], |
627 | 614 |
|
| 615 | + 'dependencies': [ |
| 616 | + '<(node_lib_target_name)', |
| 617 | + ], |
| 618 | + |
628 | 619 | 'msvs_settings': { |
629 | 620 | 'VCLinkerTool': { |
630 | 621 | 'GenerateMapFile': 'true', # /MAP |
|
657 | 648 | 'WARNING_CFLAGS': [ '-Werror' ], |
658 | 649 | }, |
659 | 650 | }], |
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 | + }, |
679 | 658 | }], |
680 | 659 | [ 'node_shared=="false"', { |
681 | 660 | # Keep this whole-archive section in sync with the `node_lib` target below. |
|
1114 | 1093 | }, # node_base |
1115 | 1094 | { |
1116 | 1095 | 'target_name': '<(node_lib_target_name)', |
1117 | | - 'type': '<(node_intermediate_lib_type)', |
| 1096 | + 'type': '<(node_lib_type)', |
1118 | 1097 | 'includes': [ |
1119 | 1098 | 'node.gypi', |
1120 | 1099 | ], |
|
1234 | 1213 | }, |
1235 | 1214 | }], |
1236 | 1215 | ['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 | + }, |
1238 | 1220 | }], |
1239 | 1221 | [ 'node_shared=="true" and OS=="win"', { |
1240 | 1222 | 'sources': [ |
|
1816 | 1798 | ], # end targets |
1817 | 1799 |
|
1818 | 1800 | '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 |
1846 | 1801 | ['OS=="win" and node_shared=="true"', { |
1847 | 1802 | 'targets': [ |
1848 | 1803 | { |
|
0 commit comments