|
324 | 324 | [ 'OS=="win"', { |
325 | 325 | 'sources': [ |
326 | 326 | 'src/backtrace_win32.cc', |
327 | | - 'src/res/node.rc', |
| 327 | + ], |
| 328 | + 'conditions': [ |
| 329 | + [ 'node_target_type!="static_library"', { |
| 330 | + 'sources': [ |
| 331 | + 'src/res/node.rc', |
| 332 | + ], |
| 333 | + }], |
328 | 334 | ], |
329 | 335 | 'defines!': [ |
330 | 336 | 'NODE_PLATFORM="win"', |
|
491 | 497 | 'target_name': 'node_etw', |
492 | 498 | 'type': 'none', |
493 | 499 | 'conditions': [ |
494 | | - [ 'node_use_etw=="true"', { |
| 500 | + [ 'node_use_etw=="true" and node_target_type!="static_library"', { |
495 | 501 | 'actions': [ |
496 | 502 | { |
497 | 503 | 'action_name': 'node_etw', |
|
512 | 518 | 'target_name': 'node_perfctr', |
513 | 519 | 'type': 'none', |
514 | 520 | 'conditions': [ |
515 | | - [ 'node_use_perfctr=="true"', { |
| 521 | + [ 'node_use_perfctr=="true" and node_target_type!="static_library"', { |
516 | 522 | 'actions': [ |
517 | 523 | { |
518 | 524 | 'action_name': 'node_perfctr_man', |
|
574 | 580 | '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc', |
575 | 581 | ], |
576 | 582 | 'conditions': [ |
577 | | - [ 'node_use_dtrace=="false" and node_use_etw=="false"', { |
| 583 | + [ 'node_use_dtrace=="false" and node_use_etw=="false" or ' |
| 584 | + 'node_target_type=="static_library"', { |
578 | 585 | 'inputs': [ 'src/notrace_macros.py' ] |
579 | 586 | }], |
580 | | - ['node_use_lttng=="false"', { |
| 587 | + ['node_use_lttng=="false" or node_target_type=="static_library"', { |
581 | 588 | 'inputs': [ 'src/nolttng_macros.py' ] |
582 | 589 | }], |
583 | | - [ 'node_use_perfctr=="false"', { |
| 590 | + [ 'node_use_perfctr=="false" or ' |
| 591 | + 'node_target_type=="static_library"', { |
584 | 592 | 'inputs': [ 'src/noperfctr_macros.py' ] |
585 | 593 | }] |
586 | 594 | ], |
|
934 | 942 | ], # end targets |
935 | 943 |
|
936 | 944 | 'conditions': [ |
| 945 | + [ 'node_target_type=="static_library"', { |
| 946 | + 'targets': [ |
| 947 | + { |
| 948 | + 'target_name': 'static_node', |
| 949 | + 'type': 'executable', |
| 950 | + 'product_name': '<(node_core_target_name)', |
| 951 | + 'dependencies': [ |
| 952 | + '<(node_core_target_name)', |
| 953 | + ], |
| 954 | + 'sources+': [ |
| 955 | + 'src/node_main.cc', |
| 956 | + ], |
| 957 | + 'include_dirs': [ |
| 958 | + 'deps/v8/include', |
| 959 | + ], |
| 960 | + 'xcode_settings': { |
| 961 | + 'OTHER_LDFLAGS': [ |
| 962 | + '-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)' |
| 963 | + '<(node_core_target_name)<(STATIC_LIB_SUFFIX)', |
| 964 | + ], |
| 965 | + }, |
| 966 | + 'msvs_settings': { |
| 967 | + 'VCLinkerTool': { |
| 968 | + 'AdditionalOptions': [ |
| 969 | + '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/' |
| 970 | + '<(node_core_target_name)<(STATIC_LIB_SUFFIX)', |
| 971 | + ], |
| 972 | + }, |
| 973 | + }, |
| 974 | + 'conditions': [ |
| 975 | + ['OS in "linux freebsd openbsd solaris android"', { |
| 976 | + 'ldflags': [ |
| 977 | + '-Wl,--whole-archive,<(OBJ_DIR)/<(STATIC_LIB_PREFIX)' |
| 978 | + '<(node_core_target_name)<(STATIC_LIB_SUFFIX)', |
| 979 | + '-Wl,--no-whole-archive', |
| 980 | + ], |
| 981 | + }], |
| 982 | + ], |
| 983 | + }, |
| 984 | + ], |
| 985 | + }], |
937 | 986 | ['OS=="aix"', { |
938 | 987 | 'targets': [ |
939 | 988 | { |
|
0 commit comments