|
339 | 339 | [ 'OS=="win"', {
|
340 | 340 | 'sources': [
|
341 | 341 | 'src/backtrace_win32.cc',
|
342 |
| - 'src/res/node.rc', |
| 342 | + ], |
| 343 | + 'conditions': [ |
| 344 | + [ 'node_target_type!="static_library"', { |
| 345 | + 'sources': [ |
| 346 | + 'src/res/node.rc', |
| 347 | + ], |
| 348 | + }], |
343 | 349 | ],
|
344 | 350 | 'defines!': [
|
345 | 351 | 'NODE_PLATFORM="win"',
|
|
506 | 512 | 'target_name': 'node_etw',
|
507 | 513 | 'type': 'none',
|
508 | 514 | 'conditions': [
|
509 |
| - [ 'node_use_etw=="true"', { |
| 515 | + [ 'node_use_etw=="true" and node_target_type!="static_library"', { |
510 | 516 | 'actions': [
|
511 | 517 | {
|
512 | 518 | 'action_name': 'node_etw',
|
|
527 | 533 | 'target_name': 'node_perfctr',
|
528 | 534 | 'type': 'none',
|
529 | 535 | 'conditions': [
|
530 |
| - [ 'node_use_perfctr=="true"', { |
| 536 | + [ 'node_use_perfctr=="true" and node_target_type!="static_library"', { |
531 | 537 | 'actions': [
|
532 | 538 | {
|
533 | 539 | 'action_name': 'node_perfctr_man',
|
|
589 | 595 | '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
|
590 | 596 | ],
|
591 | 597 | 'conditions': [
|
592 |
| - [ 'node_use_dtrace=="false" and node_use_etw=="false"', { |
| 598 | + [ 'node_use_dtrace=="false" and node_use_etw=="false" or ' |
| 599 | + 'node_target_type=="static_library"', { |
593 | 600 | 'inputs': [ 'src/notrace_macros.py' ]
|
594 | 601 | }],
|
595 |
| - ['node_use_lttng=="false"', { |
| 602 | + ['node_use_lttng=="false" or node_target_type=="static_library"', { |
596 | 603 | 'inputs': [ 'src/nolttng_macros.py' ]
|
597 | 604 | }],
|
598 |
| - [ 'node_use_perfctr=="false"', { |
| 605 | + [ 'node_use_perfctr=="false" or ' |
| 606 | + 'node_target_type=="static_library"', { |
599 | 607 | 'inputs': [ 'src/noperfctr_macros.py' ]
|
600 | 608 | }]
|
601 | 609 | ],
|
|
949 | 957 | ], # end targets
|
950 | 958 |
|
951 | 959 | 'conditions': [
|
| 960 | + [ 'node_target_type=="static_library"', { |
| 961 | + 'targets': [ |
| 962 | + { |
| 963 | + 'target_name': 'static_node', |
| 964 | + 'type': 'executable', |
| 965 | + 'product_name': '<(node_core_target_name)', |
| 966 | + 'dependencies': [ |
| 967 | + '<(node_core_target_name)', |
| 968 | + ], |
| 969 | + 'sources+': [ |
| 970 | + 'src/node_main.cc', |
| 971 | + ], |
| 972 | + 'include_dirs': [ |
| 973 | + 'deps/v8/include', |
| 974 | + ], |
| 975 | + 'xcode_settings': { |
| 976 | + 'OTHER_LDFLAGS': [ |
| 977 | + '-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)' |
| 978 | + '<(node_core_target_name)<(STATIC_LIB_SUFFIX)', |
| 979 | + ], |
| 980 | + }, |
| 981 | + 'msvs_settings': { |
| 982 | + 'VCLinkerTool': { |
| 983 | + 'AdditionalOptions': [ |
| 984 | + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/' |
| 985 | + '<(node_core_target_name)<(STATIC_LIB_SUFFIX)', |
| 986 | + ], |
| 987 | + }, |
| 988 | + }, |
| 989 | + 'conditions': [ |
| 990 | + ['OS in "linux freebsd openbsd solaris android"', { |
| 991 | + 'ldflags': [ |
| 992 | + '-Wl,--whole-archive,<(OBJ_DIR)/<(STATIC_LIB_PREFIX)' |
| 993 | + '<(node_core_target_name)<(STATIC_LIB_SUFFIX)', |
| 994 | + '-Wl,--no-whole-archive', |
| 995 | + ], |
| 996 | + }], |
| 997 | + ], |
| 998 | + }, |
| 999 | + ], |
| 1000 | + }], |
952 | 1001 | ['OS=="aix"', {
|
953 | 1002 | 'targets': [
|
954 | 1003 | {
|
|
0 commit comments