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