Node_Escargot_Release_210713_97834f7
[platform/framework/web/lwnode.git] / node.gyp
1 {
2   'variables': {
3     'v8_use_siphash%': 0,
4     'v8_trace_maps%': 0,
5     'v8_enable_pointer_compression%': 0,
6     'v8_enable_31bit_smis_on_64bit_arch%': 0,
7     'node_use_dtrace%': 'false',
8     'node_use_etw%': 'false',
9     'node_no_browser_globals%': 'false',
10     'node_use_node_snapshot%': 'false',
11     'node_use_v8_platform%': 'true',
12     'node_use_bundled_v8%': 'true',
13     'node_shared%': 'false',
14     'force_dynamic_crt%': 0,
15     'ossfuzz' : 'false',
16     'node_module_version%': '',
17     'node_shared_brotli%': 'false',
18     'node_shared_zlib%': 'false',
19     'node_shared_http_parser%': 'false',
20     'node_shared_cares%': 'false',
21     'node_shared_libuv%': 'false',
22     'node_shared_nghttp2%': 'false',
23     'node_use_openssl%': 'true',
24     'node_shared_openssl%': 'false',
25     'node_v8_options%': '',
26     'node_core_target_name%': 'node',
27     'node_lib_target_name%': 'libnode',
28     'node_intermediate_lib_type%': 'static_library',
29     'node_builtin_modules_path%': '',
30     'library_files': [
31       'lib/internal/bootstrap/environment.js',
32       'lib/internal/bootstrap/loaders.js',
33       'lib/internal/bootstrap/node.js',
34       'lib/internal/bootstrap/pre_execution.js',
35       'lib/internal/bootstrap/switches/does_own_process_state.js',
36       'lib/internal/bootstrap/switches/does_not_own_process_state.js',
37       'lib/internal/bootstrap/switches/is_main_thread.js',
38       'lib/internal/bootstrap/switches/is_not_main_thread.js',
39       'lib/internal/per_context/primordials.js',
40       'lib/internal/per_context/domexception.js',
41       'lib/internal/per_context/messageport.js',
42       'lib/async_hooks.js',
43       'lib/assert.js',
44       'lib/buffer.js',
45       'lib/child_process.js',
46       'lib/console.js',
47       'lib/constants.js',
48       'lib/crypto.js',
49       'lib/cluster.js',
50       'lib/dgram.js',
51       'lib/dns.js',
52       'lib/domain.js',
53       'lib/events.js',
54       'lib/fs.js',
55       'lib/fs/promises.js',
56       'lib/http.js',
57       'lib/http2.js',
58       'lib/_http_agent.js',
59       'lib/_http_client.js',
60       'lib/_http_common.js',
61       'lib/_http_incoming.js',
62       'lib/_http_outgoing.js',
63       'lib/_http_server.js',
64       'lib/https.js',
65       'lib/inspector.js',
66       'lib/module.js',
67       'lib/net.js',
68       'lib/os.js',
69       'lib/path.js',
70       'lib/perf_hooks.js',
71       'lib/process.js',
72       'lib/punycode.js',
73       'lib/querystring.js',
74       'lib/readline.js',
75       'lib/repl.js',
76       'lib/stream.js',
77       'lib/_stream_readable.js',
78       'lib/_stream_writable.js',
79       'lib/_stream_duplex.js',
80       'lib/_stream_transform.js',
81       'lib/_stream_passthrough.js',
82       'lib/_stream_wrap.js',
83       'lib/string_decoder.js',
84       'lib/sys.js',
85       'lib/timers.js',
86       'lib/tls.js',
87       'lib/_tls_common.js',
88       'lib/_tls_wrap.js',
89       'lib/trace_events.js',
90       'lib/tty.js',
91       'lib/url.js',
92       'lib/util.js',
93       'lib/v8.js',
94       'lib/vm.js',
95       'lib/wasi.js',
96       'lib/worker_threads.js',
97       'lib/zlib.js',
98       'lib/internal/assert.js',
99       'lib/internal/assert/assertion_error.js',
100       'lib/internal/assert/calltracker.js',
101       'lib/internal/async_hooks.js',
102       'lib/internal/buffer.js',
103       'lib/internal/cli_table.js',
104       'lib/internal/child_process.js',
105       'lib/internal/child_process/serialization.js',
106       'lib/internal/cluster/child.js',
107       'lib/internal/cluster/master.js',
108       'lib/internal/cluster/round_robin_handle.js',
109       'lib/internal/cluster/shared_handle.js',
110       'lib/internal/cluster/utils.js',
111       'lib/internal/cluster/worker.js',
112       'lib/internal/console/constructor.js',
113       'lib/internal/console/global.js',
114       'lib/internal/crypto/certificate.js',
115       'lib/internal/crypto/cipher.js',
116       'lib/internal/crypto/diffiehellman.js',
117       'lib/internal/crypto/hash.js',
118       'lib/internal/crypto/keygen.js',
119       'lib/internal/crypto/keys.js',
120       'lib/internal/crypto/pbkdf2.js',
121       'lib/internal/crypto/random.js',
122       'lib/internal/crypto/scrypt.js',
123       'lib/internal/crypto/sig.js',
124       'lib/internal/crypto/util.js',
125       'lib/internal/constants.js',
126       'lib/internal/dgram.js',
127       'lib/internal/dns/promises.js',
128       'lib/internal/dns/utils.js',
129       'lib/internal/dtrace.js',
130       'lib/internal/encoding.js',
131       'lib/internal/errors.js',
132       'lib/internal/error_serdes.js',
133       'lib/internal/event_target.js',
134       'lib/internal/fixed_queue.js',
135       'lib/internal/freelist.js',
136       'lib/internal/freeze_intrinsics.js',
137       'lib/internal/fs/dir.js',
138       'lib/internal/fs/promises.js',
139       'lib/internal/fs/read_file_context.js',
140       'lib/internal/fs/rimraf.js',
141       'lib/internal/fs/streams.js',
142       'lib/internal/fs/sync_write_stream.js',
143       'lib/internal/fs/utils.js',
144       'lib/internal/fs/watchers.js',
145       'lib/internal/http.js',
146       'lib/internal/heap_utils.js',
147       'lib/internal/histogram.js',
148       'lib/internal/idna.js',
149       'lib/internal/inspector_async_hook.js',
150       'lib/internal/js_stream_socket.js',
151       'lib/internal/linkedlist.js',
152       'lib/internal/main/check_syntax.js',
153       'lib/internal/main/eval_string.js',
154       'lib/internal/main/eval_stdin.js',
155       'lib/internal/main/inspect.js',
156       'lib/internal/main/print_help.js',
157       'lib/internal/main/prof_process.js',
158       'lib/internal/main/repl.js',
159       'lib/internal/main/run_main_module.js',
160       'lib/internal/main/run_third_party_main.js',
161       'lib/internal/main/worker_thread.js',
162       'lib/internal/modules/run_main.js',
163       'lib/internal/modules/package_json_reader.js',
164       'lib/internal/modules/cjs/helpers.js',
165       'lib/internal/modules/cjs/loader.js',
166       'lib/internal/modules/esm/loader.js',
167       'lib/internal/modules/esm/create_dynamic_module.js',
168       'lib/internal/modules/esm/get_format.js',
169       'lib/internal/modules/esm/get_source.js',
170       'lib/internal/modules/esm/module_job.js',
171       'lib/internal/modules/esm/module_map.js',
172       'lib/internal/modules/esm/resolve.js',
173       'lib/internal/modules/esm/transform_source.js',
174       'lib/internal/modules/esm/translators.js',
175       'lib/internal/net.js',
176       'lib/internal/options.js',
177       'lib/internal/policy/manifest.js',
178       'lib/internal/policy/sri.js',
179       'lib/internal/priority_queue.js',
180       'lib/internal/process/esm_loader.js',
181       'lib/internal/process/execution.js',
182       'lib/internal/process/per_thread.js',
183       'lib/internal/process/policy.js',
184       'lib/internal/process/promises.js',
185       'lib/internal/process/warning.js',
186       'lib/internal/process/worker_thread_only.js',
187       'lib/internal/process/report.js',
188       'lib/internal/process/signal.js',
189       'lib/internal/process/task_queues.js',
190       'lib/internal/querystring.js',
191       'lib/internal/readline/utils.js',
192       'lib/internal/repl.js',
193       'lib/internal/repl/await.js',
194       'lib/internal/repl/history.js',
195       'lib/internal/repl/utils.js',
196       'lib/internal/socket_list.js',
197       'lib/internal/source_map/prepare_stack_trace.js',
198       'lib/internal/source_map/source_map.js',
199       'lib/internal/source_map/source_map_cache.js',
200       'lib/internal/test/binding.js',
201       'lib/internal/timers.js',
202       'lib/internal/tls.js',
203       'lib/internal/trace_events_async_hooks.js',
204       'lib/internal/tty.js',
205       'lib/internal/url.js',
206       'lib/internal/util.js',
207       'lib/internal/util/comparisons.js',
208       'lib/internal/util/debuglog.js',
209       'lib/internal/util/inspect.js',
210       'lib/internal/util/inspector.js',
211       'lib/internal/util/types.js',
212       'lib/internal/http2/core.js',
213       'lib/internal/http2/compat.js',
214       'lib/internal/http2/util.js',
215       'lib/internal/v8_prof_polyfill.js',
216       'lib/internal/v8_prof_processor.js',
217       'lib/internal/validators.js',
218       'lib/internal/stream_base_commons.js',
219       'lib/internal/vm/module.js',
220       'lib/internal/worker.js',
221       'lib/internal/worker/io.js',
222       'lib/internal/worker/js_transferable.js',
223       'lib/internal/watchdog.js',
224       'lib/internal/streams/lazy_transform.js',
225       'lib/internal/streams/buffer_list.js',
226       'lib/internal/streams/duplexpair.js',
227       'lib/internal/streams/from.js',
228       'lib/internal/streams/legacy.js',
229       'lib/internal/streams/destroy.js',
230       'lib/internal/streams/state.js',
231       'lib/internal/streams/pipeline.js',
232       'lib/internal/streams/end-of-stream.js',
233       'deps/v8/tools/splaytree.js',
234       'deps/v8/tools/codemap.js',
235       'deps/v8/tools/consarray.js',
236       'deps/v8/tools/csvparser.js',
237       'deps/v8/tools/profile.js',
238       'deps/v8/tools/profile_view.js',
239       'deps/v8/tools/logreader.js',
240       'deps/v8/tools/arguments.js',
241       'deps/v8/tools/tickprocessor.js',
242       'deps/v8/tools/SourceMap.js',
243       'deps/v8/tools/tickprocessor-driver.js',
244       'deps/node-inspect/lib/_inspect.js',
245       'deps/node-inspect/lib/internal/inspect_client.js',
246       'deps/node-inspect/lib/internal/inspect_repl.js',
247       'deps/acorn/acorn/dist/acorn.js',
248       'deps/acorn/acorn-walk/dist/walk.js',
249       'deps/acorn-plugins/acorn-class-fields/index.js',
250       'deps/acorn-plugins/acorn-numeric-separator/index.js',
251       'deps/acorn-plugins/acorn-private-class-elements/index.js',
252       'deps/acorn-plugins/acorn-private-methods/index.js',
253       'deps/acorn-plugins/acorn-static-class-features/index.js',
254       'deps/cjs-module-lexer/lexer.js',
255       'deps/cjs-module-lexer/dist/lexer.js',
256     ],
257     'node_mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)node_mksnapshot<(EXECUTABLE_SUFFIX)',
258     'mkcodecache_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mkcodecache<(EXECUTABLE_SUFFIX)',
259     'conditions': [
260       ['GENERATOR == "ninja"', {
261         'node_text_start_object_path': 'src/large_pages/node_text_start.node_text_start.o'
262       }, {
263         'node_text_start_object_path': 'node_text_start/src/large_pages/node_text_start.o'
264       }],
265       [ 'node_shared=="true"', {
266         'node_target_type%': 'shared_library',
267         'conditions': [
268           ['OS=="aix"', {
269             # For AIX, always generate static library first,
270             # It needs an extra step to generate exp and
271             # then use both static lib and exp to create
272             # shared lib.
273             'node_intermediate_lib_type': 'static_library',
274           }, {
275             'node_intermediate_lib_type': 'shared_library',
276           }],
277         ],
278       }, {
279         'node_target_type%': 'executable',
280       }],
281       [ 'OS=="win" and '
282         'node_use_openssl=="true" and '
283         'node_shared_openssl=="false"', {
284         'use_openssl_def%': 1,
285       }, {
286         'use_openssl_def%': 0,
287       }],
288     ],
289   },
290
291   'target_defaults': {
292     # Putting these explicitly here so not to depend on `common.gypi`.
293     # `common.gypi` need to be more general because it is used to build userland native addons.
294     # Refs: https://github.com/nodejs/node-gyp/issues/1118
295     'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
296     'xcode_settings': {
297       'WARNING_CFLAGS': [
298         '-Wall',
299         '-Wendif-labels',
300         '-W',
301         '-Wno-unused-parameter',
302         '-Werror=undefined-inline',
303       ],
304     },
305
306     # Relevant only for x86.
307     # Refs: https://github.com/nodejs/node/pull/25852
308     # Refs: https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
309     'msvs_settings': {
310       'VCLinkerTool': {
311         'ImageHasSafeExceptionHandlers': 'false',
312       },
313     },
314
315     'conditions': [
316       ['OS=="aix"', {
317         'ldflags': [
318           '-Wl,-bnoerrmsg',
319         ],
320       }],
321       ['OS == "linux" and llvm_version != "0.0"', {
322         'libraries': ['-latomic'],
323       }],
324     ],
325   },
326
327   'targets': [
328     {
329       'target_name': 'node_text_start',
330       'type': 'none',
331       'conditions': [
332         [ 'OS in "linux freebsd" and '
333           'target_arch=="x64"', {
334           'type': 'static_library',
335           'sources': [
336             'src/large_pages/node_text_start.S'
337           ]
338         }],
339       ]
340     },
341     {
342       'target_name': '<(node_core_target_name)',
343       'type': 'executable',
344
345       'defines': [
346         'NODE_ARCH="<(target_arch)"',
347         'NODE_PLATFORM="<(OS)"',
348         'NODE_WANT_INTERNALS=1',
349       ],
350
351       'includes': [
352         'node.gypi'
353       ],
354
355       'include_dirs': [
356         'src',
357         '<(lwnode_jsengine_path)/include'
358       ],
359
360       'sources': [
361         'src/node_main.cc'
362       ],
363
364       'dependencies': [
365         'deps/histogram/histogram.gyp:histogram',
366         'deps/uvwasi/uvwasi.gyp:uvwasi',
367       ],
368
369       'msvs_settings': {
370         'VCLinkerTool': {
371           'GenerateMapFile': 'true', # /MAP
372           'MapExports': 'true', # /MAPINFO:EXPORTS
373           'RandomizedBaseAddress': 2, # enable ASLR
374           'DataExecutionPrevention': 2, # enable DEP
375           'AllowIsolation': 'true',
376         },
377       },
378
379       # - "C4244: conversion from 'type1' to 'type2', possible loss of data"
380       #   Ususaly safe. Disable for `dep`, enable for `src`
381       'msvs_disabled_warnings!': [4244],
382
383       'conditions': [
384         [ 'error_on_warn=="true"', {
385           'cflags': ['-Werror'],
386           'xcode_settings': {
387             'WARNING_CFLAGS': [ '-Werror' ],
388           },
389         }],
390         [ 'node_intermediate_lib_type=="static_library" and '
391             'node_shared=="true" and OS=="aix"', {
392           # For AIX, shared lib is linked by static lib and .exp. In the
393           # case here, the executable needs to link to shared lib.
394           # Therefore, use 'node_aix_shared' target to generate the
395           # shared lib and then executable.
396           'dependencies': [ 'node_aix_shared' ],
397         }, {
398           'dependencies': [ '<(node_lib_target_name)' ],
399         }],
400         [ 'node_intermediate_lib_type=="static_library" and node_shared=="false"', {
401           'xcode_settings': {
402             'OTHER_LDFLAGS': [
403               '-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
404               '-Wl,-force_load,<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
405             ],
406           },
407           'msvs_settings': {
408             'VCLinkerTool': {
409               'AdditionalOptions': [
410                 '/WHOLEARCHIVE:<(node_lib_target_name)<(STATIC_LIB_SUFFIX)',
411                 '/WHOLEARCHIVE:<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
412               ],
413             },
414           },
415           'conditions': [
416             ['lwnode=="false" and OS != "aix" and OS != "mac"', {
417               'ldflags': [
418                 '-Wl,--whole-archive',
419                 '<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
420                 '<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)',
421                 '-Wl,--no-whole-archive',
422               ],
423             }],
424             [ 'OS=="win"', {
425               'sources': [ 'src/res/node.rc' ],
426               'conditions': [
427                 [ 'node_use_etw=="true"', {
428                   'sources': [
429                     'tools/msvs/genfiles/node_etw_provider.rc'
430                   ],
431                 }],
432               ],
433             }],
434           ],
435         }],
436         [ 'node_shared=="true"', {
437           'xcode_settings': {
438             'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
439           },
440         }],
441         ['OS=="win"', {
442           'libraries': [
443             'Dbghelp.lib',
444             'winmm.lib',
445             'Ws2_32.lib',
446           ],
447         }],
448         ['node_with_ltcg=="true"', {
449           'msvs_settings': {
450             'VCCLCompilerTool': {
451               'WholeProgramOptimization': 'true'   # /GL, whole program optimization, needed for LTCG
452             },
453             'VCLibrarianTool': {
454               'AdditionalOptions': [
455                 '/LTCG:INCREMENTAL',               # link time code generation
456               ],
457             },
458             'VCLinkerTool': {
459               'OptimizeReferences': 2,             # /OPT:REF
460               'EnableCOMDATFolding': 2,            # /OPT:ICF
461               'LinkIncremental': 1,                # disable incremental linking
462               'AdditionalOptions': [
463                 '/LTCG:INCREMENTAL',               # incremental link-time code generation
464               ],
465             }
466           }
467         }, {
468           'msvs_settings': {
469             'VCCLCompilerTool': {
470               'WholeProgramOptimization': 'false'
471             },
472             'VCLinkerTool': {
473               'LinkIncremental': 2                 # enable incremental linking
474             },
475           },
476          }],
477         ['node_use_node_code_cache=="true"', {
478           'dependencies': [
479             'mkcodecache',
480           ],
481           'actions': [
482             {
483               'action_name': 'run_mkcodecache',
484               'process_outputs_as_sources': 1,
485               'inputs': [
486                 '<(mkcodecache_exec)',
487               ],
488               'outputs': [
489                 '<(SHARED_INTERMEDIATE_DIR)/node_code_cache.cc',
490               ],
491               'action': [
492                 '<@(_inputs)',
493                 '<@(_outputs)',
494               ],
495             },
496           ],
497         }, {
498           'sources': [
499             'src/node_code_cache_stub.cc'
500           ],
501         }],
502         ['node_use_node_snapshot=="true"', {
503           'dependencies': [
504             'node_mksnapshot',
505           ],
506           'actions': [
507             {
508               'action_name': 'node_mksnapshot',
509               'process_outputs_as_sources': 1,
510               'inputs': [
511                 '<(node_mksnapshot_exec)',
512               ],
513               'outputs': [
514                 '<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc',
515               ],
516               'action': [
517                 '<@(_inputs)',
518                 '<@(_outputs)',
519               ],
520             },
521           ],
522         }, {
523           'sources': [
524             'src/node_snapshot_stub.cc'
525           ],
526         }],
527         [ 'OS in "linux freebsd" and '
528           'target_arch=="x64"', {
529           'dependencies': [ 'node_text_start' ],
530           'ldflags+': [
531             '<(obj_dir)/<(node_text_start_object_path)'
532           ]
533         }],
534       ],
535     }, # node_core_target_name
536     {
537       'target_name': '<(node_lib_target_name)',
538       'type': '<(node_intermediate_lib_type)',
539       'includes': [
540         'node.gypi',
541       ],
542
543       'include_dirs': [
544         'src',
545         '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
546       ],
547       'dependencies': [
548         'deps/histogram/histogram.gyp:histogram',
549         'deps/uvwasi/uvwasi.gyp:uvwasi',
550       ],
551
552       'sources': [
553         'src/api/async_resource.cc',
554         'src/api/callback.cc',
555         'src/api/encoding.cc',
556         'src/api/environment.cc',
557         'src/api/exceptions.cc',
558         'src/api/hooks.cc',
559         'src/api/utils.cc',
560         'src/async_wrap.cc',
561         'src/cares_wrap.cc',
562         'src/connect_wrap.cc',
563         'src/connection_wrap.cc',
564         'src/debug_utils.cc',
565         'src/env.cc',
566         'src/fs_event_wrap.cc',
567         'src/handle_wrap.cc',
568         'src/heap_utils.cc',
569         'src/histogram.cc',
570         'src/js_native_api.h',
571         'src/js_native_api_types.h',
572         'src/js_native_api_v8.cc',
573         'src/js_native_api_v8.h',
574         'src/js_native_api_v8_internals.h',
575         'src/js_stream.cc',
576         'src/json_utils.cc',
577         'src/js_udp_wrap.cc',
578         'src/module_wrap.cc',
579         'src/node.cc',
580         'src/node_api.cc',
581         'src/node_binding.cc',
582         'src/node_buffer.cc',
583         'src/node_config.cc',
584         'src/node_constants.cc',
585         'src/node_contextify.cc',
586         'src/node_credentials.cc',
587         'src/node_dir.cc',
588         'src/node_env_var.cc',
589         'src/node_errors.cc',
590         'src/node_file.cc',
591         'src/node_http_parser.cc',
592         'src/node_http2.cc',
593         'src/node_i18n.cc',
594         'src/node_main_instance.cc',
595         'src/node_messaging.cc',
596         'src/node_metadata.cc',
597         'src/node_native_module.cc',
598         'src/node_native_module_env.cc',
599         'src/node_options.cc',
600         'src/node_os.cc',
601         'src/node_perf.cc',
602         'src/node_platform.cc',
603         'src/node_postmortem_metadata.cc',
604         'src/node_process_events.cc',
605         'src/node_process_methods.cc',
606         'src/node_process_object.cc',
607         'src/node_report.cc',
608         'src/node_report_module.cc',
609         'src/node_report_utils.cc',
610         'src/node_serdes.cc',
611         'src/node_sockaddr.cc',
612         'src/node_stat_watcher.cc',
613         'src/node_symbols.cc',
614         'src/node_task_queue.cc',
615         'src/node_trace_events.cc',
616         'src/node_types.cc',
617         'src/node_url.cc',
618         'src/node_util.cc',
619         'src/node_v8.cc',
620         'src/node_wasi.cc',
621         'src/node_watchdog.cc',
622         'src/node_worker.cc',
623         'src/node_zlib.cc',
624         'src/pipe_wrap.cc',
625         'src/process_wrap.cc',
626         'src/signal_wrap.cc',
627         'src/spawn_sync.cc',
628         'src/stream_base.cc',
629         'src/stream_pipe.cc',
630         'src/stream_wrap.cc',
631         'src/string_bytes.cc',
632         'src/string_decoder.cc',
633         'src/tcp_wrap.cc',
634         'src/timers.cc',
635         'src/tracing/agent.cc',
636         'src/tracing/node_trace_buffer.cc',
637         'src/tracing/node_trace_writer.cc',
638         'src/tracing/trace_event.cc',
639         'src/tracing/traced_value.cc',
640         'src/tty_wrap.cc',
641         'src/udp_wrap.cc',
642         'src/util.cc',
643         'src/uv.cc',
644         # headers to make for a more pleasant IDE experience
645         'src/aliased_buffer.h',
646         'src/aliased_struct.h',
647         'src/aliased_struct-inl.h',
648         'src/allocated_buffer.h',
649         'src/allocated_buffer-inl.h',
650         'src/async_wrap.h',
651         'src/async_wrap-inl.h',
652         'src/base_object.h',
653         'src/base_object-inl.h',
654         'src/base64.h',
655         'src/callback_queue.h',
656         'src/callback_queue-inl.h',
657         'src/connect_wrap.h',
658         'src/connection_wrap.h',
659         'src/debug_utils.h',
660         'src/debug_utils-inl.h',
661         'src/env.h',
662         'src/env-inl.h',
663         'src/handle_wrap.h',
664         'src/histogram.h',
665         'src/histogram-inl.h',
666         'src/js_stream.h',
667         'src/json_utils.h',
668         'src/large_pages/node_large_page.cc',
669         'src/large_pages/node_large_page.h',
670         'src/memory_tracker.h',
671         'src/memory_tracker-inl.h',
672         'src/module_wrap.h',
673         'src/node.h',
674         'src/node_api.h',
675         'src/node_api_types.h',
676         'src/node_binding.h',
677         'src/node_buffer.h',
678         'src/node_constants.h',
679         'src/node_context_data.h',
680         'src/node_contextify.h',
681         'src/node_dir.h',
682         'src/node_errors.h',
683         'src/node_file.h',
684         'src/node_file-inl.h',
685         'src/node_http_common.h',
686         'src/node_http_common-inl.h',
687         'src/node_http2.h',
688         'src/node_http2_state.h',
689         'src/node_i18n.h',
690         'src/node_internals.h',
691         'src/node_main_instance.h',
692         'src/node_mem.h',
693         'src/node_mem-inl.h',
694         'src/node_messaging.h',
695         'src/node_metadata.h',
696         'src/node_mutex.h',
697         'src/node_native_module.h',
698         'src/node_native_module_env.h',
699         'src/node_object_wrap.h',
700         'src/node_options.h',
701         'src/node_options-inl.h',
702         'src/node_perf.h',
703         'src/node_perf_common.h',
704         'src/node_platform.h',
705         'src/node_process.h',
706         'src/node_report.h',
707         'src/node_revert.h',
708         'src/node_root_certs.h',
709         'src/node_sockaddr.h',
710         'src/node_sockaddr-inl.h',
711         'src/node_stat_watcher.h',
712         'src/node_union_bytes.h',
713         'src/node_url.h',
714         'src/node_version.h',
715         'src/node_v8_platform-inl.h',
716         'src/node_wasi.h',
717         'src/node_watchdog.h',
718         'src/node_worker.h',
719         'src/pipe_wrap.h',
720         'src/req_wrap.h',
721         'src/req_wrap-inl.h',
722         'src/spawn_sync.h',
723         'src/stream_base.h',
724         'src/stream_base-inl.h',
725         'src/stream_pipe.h',
726         'src/stream_wrap.h',
727         'src/string_bytes.h',
728         'src/string_decoder.h',
729         'src/string_decoder-inl.h',
730         'src/string_search.h',
731         'src/tcp_wrap.h',
732         'src/tracing/agent.h',
733         'src/tracing/node_trace_buffer.h',
734         'src/tracing/node_trace_writer.h',
735         'src/tracing/trace_event.h',
736         'src/tracing/trace_event_common.h',
737         'src/tracing/traced_value.h',
738         'src/tty_wrap.h',
739         'src/udp_wrap.h',
740         'src/util.h',
741         'src/util-inl.h',
742         # Dependency headers
743         '<(lwnode_jsengine_path)/include/v8.h',
744         # javascript files to make for an even more pleasant IDE experience
745         '<@(library_files)',
746         # node.gyp is added by default, common.gypi is added for change detection
747         'common.gypi',
748       ],
749
750       'variables': {
751         'openssl_system_ca_path%': '',
752         'openssl_default_cipher_list%': '',
753       },
754
755       'defines': [
756         'NODE_ARCH="<(target_arch)"',
757         'NODE_PLATFORM="<(OS)"',
758         'NODE_WANT_INTERNALS=1',
759         # Warn when using deprecated V8 APIs.
760         'V8_DEPRECATION_WARNINGS=1',
761         'NODE_OPENSSL_SYSTEM_CERT_PATH="<(openssl_system_ca_path)"',
762       ],
763
764       # - "C4244: conversion from 'type1' to 'type2', possible loss of data"
765       #   Ususaly safe. Disable for `dep`, enable for `src`
766       'msvs_disabled_warnings!': [4244],
767
768       'conditions': [
769         [ 'lwnode=="true"', {
770           'dependencies': [
771             '<(lwnode_jsengine_path)/escargotshim.gyp:escargotshim',
772           ],
773         }],
774         [ 'openssl_default_cipher_list!=""', {
775           'defines': [
776             'NODE_OPENSSL_DEFAULT_CIPHER_LIST="<(openssl_default_cipher_list)"'
777            ]
778         }],
779         [ 'error_on_warn=="true"', {
780           'cflags': ['-Werror'],
781           'xcode_settings': {
782             'WARNING_CFLAGS': [ '-Werror' ],
783           },
784         }],
785         [ 'node_builtin_modules_path!=""', {
786           'defines': [ 'NODE_BUILTIN_MODULES_PATH="<(node_builtin_modules_path)"' ]
787         }],
788         [ 'node_shared=="true"', {
789           'sources': [
790             'src/node_snapshot_stub.cc',
791             'src/node_code_cache_stub.cc',
792           ]
793         }],
794         [ 'node_shared=="true" and node_module_version!="" and OS!="win"', {
795           'product_extension': '<(shlib_suffix)',
796           'xcode_settings': {
797             'LD_DYLIB_INSTALL_NAME':
798               '@rpath/lib<(node_core_target_name).<(shlib_suffix)'
799           },
800         }],
801         ['node_shared=="true" and OS=="aix"', {
802           'product_name': 'node_base',
803         }],
804         [ 'v8_enable_inspector==1', {
805           'includes' : [ 'src/inspector/node_inspector.gypi' ],
806         }, {
807           'defines': [ 'HAVE_INSPECTOR=0' ]
808         }],
809         [ 'OS=="win"', {
810           'conditions': [
811             [ 'node_intermediate_lib_type!="static_library"', {
812               'sources': [
813                 'src/res/node.rc',
814               ],
815             }],
816           ],
817           'libraries': [
818             'Dbghelp',
819             'Psapi',
820             'Ws2_32',
821           ],
822         }],
823         [ 'node_use_etw=="true"', {
824           'defines': [ 'HAVE_ETW=1' ],
825           'dependencies': [ 'node_etw' ],
826           'include_dirs': [
827             'src',
828             'tools/msvs/genfiles',
829             '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
830           ],
831           'sources': [
832             'src/node_win32_etw_provider.h',
833             'src/node_win32_etw_provider-inl.h',
834             'src/node_win32_etw_provider.cc',
835             'src/node_dtrace.h',
836             'src/node_dtrace.cc',
837             'tools/msvs/genfiles/node_etw_provider.h',
838           ],
839           'conditions': [
840             ['node_intermediate_lib_type != "static_library"', {
841               'sources': [
842                 'tools/msvs/genfiles/node_etw_provider.rc',
843               ],
844             }],
845           ],
846         }],
847         [ 'node_use_dtrace=="true"', {
848           'defines': [ 'HAVE_DTRACE=1' ],
849           'dependencies': [
850             'node_dtrace_header',
851             'specialize_node_d',
852           ],
853           'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
854           #
855           # DTrace is supported on linux, solaris, mac, and bsd.  There are
856           # three object files associated with DTrace support, but they're
857           # not all used all the time:
858           #
859           #   node_dtrace.o           all configurations
860           #   node_dtrace_ustack.o    not supported on mac and linux
861           #   node_dtrace_provider.o  All except OS X.  "dtrace -G" is not
862           #                           used on OS X.
863           #
864           # Note that node_dtrace_provider.cc and node_dtrace_ustack.cc do not
865           # actually exist.  They're listed here to trick GYP into linking the
866           # corresponding object files into the final "node" executable.  These
867           # object files are generated by "dtrace -G" using custom actions
868           # below, and the GYP-generated Makefiles will properly build them when
869           # needed.
870           #
871           'sources': [
872             'src/node_dtrace.h',
873             'src/node_dtrace.cc',
874           ],
875           'conditions': [
876             [ 'OS=="linux"', {
877               'sources': [
878                 '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o'
879               ],
880             }],
881             [ 'OS!="mac" and OS!="linux"', {
882               'sources': [
883                 'src/node_dtrace_ustack.cc',
884                 'src/node_dtrace_provider.cc',
885               ]
886             }
887           ] ]
888         } ],
889         [ 'node_use_openssl=="true"', {
890           'sources': [
891             'src/node_crypto.cc',
892             'src/node_crypto_common.cc',
893             'src/node_crypto_bio.cc',
894             'src/node_crypto_clienthello.cc',
895             'src/node_crypto.h',
896             'src/node_crypto_common.h',
897             'src/node_crypto_bio.h',
898             'src/node_crypto_clienthello.h',
899             'src/node_crypto_clienthello-inl.h',
900             'src/node_crypto_groups.h',
901             'src/tls_wrap.cc',
902             'src/tls_wrap.h'
903           ],
904         }],
905         [ 'OS in "linux freebsd mac" and '
906           'target_arch=="x64" and '
907           'node_target_type=="executable"', {
908           'defines': [ 'NODE_ENABLE_LARGE_CODE_PAGES=1' ],
909         }],
910         [ 'use_openssl_def==1', {
911           # TODO(bnoordhuis) Make all platforms export the same list of symbols.
912           # Teach mkssldef.py to generate linker maps that UNIX linkers understand.
913           'variables': {
914             'mkssldef_flags': [
915               # Categories to export.
916               '-CAES,BF,BIO,DES,DH,DSA,EC,ECDH,ECDSA,ENGINE,EVP,HMAC,MD4,MD5,'
917               'PSK,RC2,RC4,RSA,SHA,SHA0,SHA1,SHA256,SHA512,SOCK,STDIO,TLSEXT,'
918               'UI,FP_API,TLS1_METHOD,TLS1_1_METHOD,TLS1_2_METHOD,SCRYPT,OCSP,'
919               'NEXTPROTONEG,RMD160,CAST,DEPRECATEDIN_1_1_0,DEPRECATEDIN_1_2_0',
920               # Defines.
921               '-DWIN32',
922               # Symbols to filter from the export list.
923               '-X^DSO',
924               '-X^_',
925               '-X^private_',
926               # Base generated DEF on zlib.def
927               '-Bdeps/zlib/win32/zlib.def'
928             ],
929           },
930           'conditions': [
931             ['openssl_fips!=""', {
932               'variables': { 'mkssldef_flags': ['-DOPENSSL_FIPS'] },
933             }],
934           ],
935           'actions': [
936             {
937               'action_name': 'mkssldef',
938               'inputs': [
939                 'deps/openssl/openssl/util/libcrypto.num',
940                 'deps/openssl/openssl/util/libssl.num',
941               ],
942               'outputs': ['<(SHARED_INTERMEDIATE_DIR)/openssl.def'],
943               'process_outputs_as_sources': 1,
944               'action': [
945                 'python',
946                 'tools/mkssldef.py',
947                 '<@(mkssldef_flags)',
948                 '-o',
949                 '<@(_outputs)',
950                 '<@(_inputs)',
951               ],
952             },
953           ],
954         }],
955       ],
956       'actions': [
957         {
958           'action_name': 'node_js2c',
959           'process_outputs_as_sources': 1,
960           'inputs': [
961             # Put the code first so it's a dependency and can be used for invocation.
962             'tools/js2c.py',
963             '<@(library_files)',
964             'config.gypi'
965           ],
966           'outputs': [
967             '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
968           ],
969           'action': [
970             'python', '<@(_inputs)',
971             '--target', '<@(_outputs)',
972           ],
973         },
974       ],
975     }, # node_lib_target_name
976     {
977        # generate ETW header and resource files
978       'target_name': 'node_etw',
979       'type': 'none',
980       'conditions': [
981         [ 'node_use_etw=="true"', {
982           'actions': [
983             {
984               'action_name': 'node_etw',
985               'inputs': [ 'src/res/node_etw_provider.man' ],
986               'outputs': [
987                 'tools/msvs/genfiles/node_etw_provider.rc',
988                 'tools/msvs/genfiles/node_etw_provider.h',
989                 'tools/msvs/genfiles/node_etw_providerTEMP.BIN',
990               ],
991               'action': [ 'mc <@(_inputs) -h tools/msvs/genfiles -r tools/msvs/genfiles' ]
992             }
993           ]
994         } ]
995       ]
996     }, # node_etw
997     {
998       'target_name': 'node_dtrace_header',
999       'type': 'none',
1000       'conditions': [
1001         [ 'node_use_dtrace=="true" and OS!="linux"', {
1002           'actions': [
1003             {
1004               'action_name': 'node_dtrace_header',
1005               'inputs': [ 'src/node_provider.d' ],
1006               'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_provider.h' ],
1007               'action': [ 'dtrace', '-h', '-xnolibs', '-s', '<@(_inputs)',
1008                 '-o', '<@(_outputs)' ]
1009             }
1010           ]
1011         } ],
1012         [ 'node_use_dtrace=="true" and OS=="linux"', {
1013           'actions': [
1014             {
1015               'action_name': 'node_dtrace_header',
1016               'inputs': [ 'src/node_provider.d' ],
1017               'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_provider.h' ],
1018               'action': [ 'dtrace', '-h', '-s', '<@(_inputs)',
1019                 '-o', '<@(_outputs)' ]
1020             }
1021           ]
1022         } ],
1023       ]
1024     }, # node_dtrace_header
1025     {
1026       'target_name': 'node_dtrace_provider',
1027       'type': 'none',
1028       'conditions': [
1029         [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
1030           'actions': [
1031             {
1032               'action_name': 'node_dtrace_provider_o',
1033               'inputs': [
1034                 '<(obj_dir)/<(node_lib_target_name)/src/node_dtrace.o',
1035               ],
1036               'outputs': [
1037                 '<(obj_dir)/<(node_lib_target_name)/src/node_dtrace_provider.o'
1038               ],
1039               'action': [ 'dtrace', '-G', '-xnolibs', '-s', 'src/node_provider.d',
1040                 '<@(_inputs)', '-o', '<@(_outputs)' ]
1041             }
1042           ]
1043         }],
1044         [ 'node_use_dtrace=="true" and OS=="linux"', {
1045           'actions': [
1046             {
1047               'action_name': 'node_dtrace_provider_o',
1048               'inputs': [ 'src/node_provider.d' ],
1049               'outputs': [
1050                 '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o'
1051               ],
1052               'action': [
1053                 'dtrace', '-C', '-G', '-s', '<@(_inputs)', '-o', '<@(_outputs)'
1054               ],
1055             }
1056           ],
1057         }],
1058       ]
1059     }, # node_dtrace_provider
1060     {
1061       'target_name': 'node_dtrace_ustack',
1062       'type': 'none',
1063       'conditions': [
1064         [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
1065           'actions': [
1066             {
1067               'action_name': 'node_dtrace_ustack_constants',
1068               'inputs': [
1069                 '<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)'
1070               ],
1071               'outputs': [
1072                 '<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
1073               ],
1074               'action': [
1075                 'tools/genv8constants.py',
1076                 '<@(_outputs)',
1077                 '<@(_inputs)'
1078               ]
1079             },
1080             {
1081               'action_name': 'node_dtrace_ustack',
1082               'inputs': [
1083                 'src/v8ustack.d',
1084                 '<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
1085               ],
1086               'outputs': [
1087                 '<(obj_dir)/<(node_lib_target_name)/src/node_dtrace_ustack.o'
1088               ],
1089               'conditions': [
1090                 [ 'target_arch=="ia32" or target_arch=="arm"', {
1091                   'action': [
1092                     'dtrace', '-32', '-I<(SHARED_INTERMEDIATE_DIR)', '-Isrc',
1093                     '-C', '-G', '-s', 'src/v8ustack.d', '-o', '<@(_outputs)',
1094                   ]
1095                 } ],
1096                 [ 'target_arch=="x64"', {
1097                   'action': [
1098                     'dtrace', '-64', '-I<(SHARED_INTERMEDIATE_DIR)', '-Isrc',
1099                     '-C', '-G', '-s', 'src/v8ustack.d', '-o', '<@(_outputs)',
1100                   ]
1101                 } ],
1102               ]
1103             },
1104           ]
1105         } ],
1106       ]
1107     }, # node_dtrace_ustack
1108     {
1109       'target_name': 'specialize_node_d',
1110       'type': 'none',
1111       'conditions': [
1112         [ 'node_use_dtrace=="true"', {
1113           'actions': [
1114             {
1115               'action_name': 'specialize_node_d',
1116               'inputs': [
1117                 'src/node.d'
1118               ],
1119               'outputs': [
1120                 '<(PRODUCT_DIR)/node.d',
1121               ],
1122               'action': [
1123                 'tools/specialize_node_d.py',
1124                 '<@(_outputs)',
1125                 '<@(_inputs)',
1126                 '<@(OS)',
1127                 '<@(target_arch)',
1128               ],
1129             },
1130           ],
1131         } ],
1132       ]
1133     }, # specialize_node_d
1134     { # fuzz_url
1135       'target_name': 'fuzz_url',
1136       'type': 'executable',
1137       'dependencies': [
1138         '<(node_lib_target_name)',
1139       ],
1140       'includes': [
1141         'node.gypi'
1142       ],
1143       'include_dirs': [
1144         'src',
1145       ],
1146       'defines': [
1147         'NODE_ARCH="<(target_arch)"',
1148         'NODE_PLATFORM="<(OS)"',
1149         'NODE_WANT_INTERNALS=1',
1150       ],
1151       'sources': [
1152         'src/node_snapshot_stub.cc',
1153         'src/node_code_cache_stub.cc',
1154         'test/fuzzers/fuzz_url.cc',
1155       ],
1156       'conditions': [
1157         ['OS=="linux"', {
1158           'ldflags': [ '-fsanitize=fuzzer' ]
1159         }],
1160         # Ensure that ossfuzz flag has been set and that we are on Linux
1161         [ 'OS!="linux" or ossfuzz!="true"', {
1162           'type': 'none',
1163         }],
1164       ],
1165     }, # fuzz_url
1166     { # fuzz_env
1167       'target_name': 'fuzz_env',
1168       'type': 'executable',
1169       'dependencies': [
1170         '<(node_lib_target_name)',
1171         'deps/histogram/histogram.gyp:histogram',
1172         'deps/uvwasi/uvwasi.gyp:uvwasi',
1173         'node_dtrace_header',
1174         'node_dtrace_ustack',
1175         'node_dtrace_provider',
1176       ],
1177       'includes': [
1178         'node.gypi'
1179       ],
1180       'include_dirs': [
1181         'src',
1182         'tools/msvs/genfiles',
1183         '<(lwnode_jsengine_path)/include',
1184         'deps/cares/include',
1185         'deps/uv/include',
1186         'deps/uvwasi/include',
1187         'test/cctest',
1188       ],
1189       'defines': [
1190         'NODE_ARCH="<(target_arch)"',
1191         'NODE_PLATFORM="<(OS)"',
1192         'NODE_WANT_INTERNALS=1',
1193       ],
1194       'sources': [
1195         'src/node_snapshot_stub.cc',
1196         'src/node_code_cache_stub.cc',
1197         'test/fuzzers/fuzz_env.cc',
1198       ],
1199       'conditions': [
1200         ['OS=="linux"', {
1201           'ldflags': [ '-fsanitize=fuzzer' ]
1202         }],
1203         # Ensure that ossfuzz flag has been set and that we are on Linux
1204         [ 'OS!="linux" or ossfuzz!="true"', {
1205           'type': 'none',
1206         }],
1207       ],
1208     }, # fuzz_env
1209     {
1210       'target_name': 'cctest',
1211       'type': 'executable',
1212
1213       'dependencies': [
1214         '<(node_lib_target_name)',
1215         'deps/histogram/histogram.gyp:histogram',
1216         'deps/uvwasi/uvwasi.gyp:uvwasi',
1217         'node_dtrace_header',
1218         'node_dtrace_ustack',
1219         'node_dtrace_provider',
1220       ],
1221
1222       'includes': [
1223         'node.gypi'
1224       ],
1225
1226       'include_dirs': [
1227         'src',
1228         'tools/msvs/genfiles',
1229         '<(lwnode_jsengine_path)/include',
1230         'deps/cares/include',
1231         'deps/uv/include',
1232         'deps/uvwasi/include',
1233         'test/cctest',
1234       ],
1235
1236       'defines': [
1237         'NODE_ARCH="<(target_arch)"',
1238         'NODE_PLATFORM="<(OS)"',
1239         'NODE_WANT_INTERNALS=1',
1240       ],
1241
1242       'sources': [
1243         'src/node_snapshot_stub.cc',
1244         'src/node_code_cache_stub.cc',
1245         'test/cctest/gtest/gtest-all.cc',
1246         'test/cctest/gtest/gtest_main.cc',
1247         'test/cctest/node_test_fixture.cc',
1248         'test/cctest/node_test_fixture.h',
1249         'test/cctest/test_aliased_buffer.cc',
1250         'test/cctest/test_base64.cc',
1251         'test/cctest/test_base_object_ptr.cc',
1252         'test/cctest/test_node_postmortem_metadata.cc',
1253         'test/cctest/test_environment.cc',
1254         'test/cctest/test_linked_binding.cc',
1255         'test/cctest/test_per_process.cc',
1256         'test/cctest/test_platform.cc',
1257         'test/cctest/test_json_utils.cc',
1258         'test/cctest/test_sockaddr.cc',
1259         'test/cctest/test_traced_value.cc',
1260         'test/cctest/test_util.cc',
1261         'test/cctest/test_url.cc',
1262       ],
1263
1264       'conditions': [
1265         [ 'node_use_openssl=="true"', {
1266           'defines': [
1267             'HAVE_OPENSSL=1',
1268           ],
1269         }],
1270         ['v8_enable_inspector==1', {
1271           'sources': [
1272             'test/cctest/test_inspector_socket.cc',
1273             'test/cctest/test_inspector_socket_server.cc'
1274           ],
1275           'defines': [
1276             'HAVE_INSPECTOR=1',
1277           ],
1278         }, {
1279            'defines': [
1280              'HAVE_INSPECTOR=0',
1281            ]
1282         }],
1283         ['OS=="solaris"', {
1284           'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ]
1285         }],
1286         # Skip cctest while building shared lib node for Windows
1287         [ 'OS=="win" and node_shared=="true"', {
1288           'type': 'none',
1289         }],
1290         [ 'node_shared=="true"', {
1291           'xcode_settings': {
1292             'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
1293           },
1294         }],
1295         ['OS=="win"', {
1296           'libraries': [
1297             'Dbghelp.lib',
1298             'winmm.lib',
1299             'Ws2_32.lib',
1300           ],
1301         }],
1302       ],
1303     }, # cctest
1304
1305     {
1306       'target_name': 'embedtest',
1307       'type': 'executable',
1308
1309       'dependencies': [
1310         '<(node_lib_target_name)',
1311         'deps/histogram/histogram.gyp:histogram',
1312         'deps/uvwasi/uvwasi.gyp:uvwasi',
1313         'node_dtrace_header',
1314         'node_dtrace_ustack',
1315         'node_dtrace_provider',
1316       ],
1317
1318       'includes': [
1319         'node.gypi'
1320       ],
1321
1322       'include_dirs': [
1323         'src',
1324         'tools/msvs/genfiles',
1325         '<(lwnode_jsengine_path)/include',
1326         'deps/cares/include',
1327         'deps/uv/include',
1328         'deps/uvwasi/include',
1329         'test/embedding',
1330       ],
1331
1332       'sources': [
1333         'src/node_snapshot_stub.cc',
1334         'src/node_code_cache_stub.cc',
1335         'test/embedding/embedtest.cc',
1336       ],
1337
1338       'conditions': [
1339         ['OS=="solaris"', {
1340           'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ]
1341         }],
1342         # Skip cctest while building shared lib node for Windows
1343         [ 'OS=="win" and node_shared=="true"', {
1344           'type': 'none',
1345         }],
1346         [ 'node_shared=="true"', {
1347           'xcode_settings': {
1348             'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
1349           },
1350         }],
1351         ['OS=="win"', {
1352           'libraries': [
1353             'Dbghelp.lib',
1354             'winmm.lib',
1355             'Ws2_32.lib',
1356           ],
1357         }],
1358       ],
1359     }, # embedtest
1360
1361     # TODO(joyeecheung): do not depend on node_lib,
1362     # instead create a smaller static library node_lib_base that does
1363     # just enough for node_native_module.cc and the cache builder to
1364     # compile without compiling the generated code cache C++ file.
1365     # So generate_code_cache -> mkcodecache -> node_lib_base,
1366     #    node_lib -> node_lib_base & generate_code_cache
1367     {
1368       'target_name': 'mkcodecache',
1369       'type': 'executable',
1370
1371       'dependencies': [
1372         '<(node_lib_target_name)',
1373         'deps/histogram/histogram.gyp:histogram',
1374         'deps/uvwasi/uvwasi.gyp:uvwasi',
1375       ],
1376
1377       'includes': [
1378         'node.gypi'
1379       ],
1380
1381       'include_dirs': [
1382         'src',
1383         'tools/msvs/genfiles',
1384         '<(lwnode_jsengine_path)/include',
1385         'deps/cares/include',
1386         'deps/uv/include',
1387         'deps/uvwasi/include',
1388       ],
1389
1390       'defines': [
1391         'NODE_WANT_INTERNALS=1'
1392       ],
1393       'sources': [
1394         'src/node_snapshot_stub.cc',
1395         'src/node_code_cache_stub.cc',
1396         'tools/code_cache/mkcodecache.cc',
1397         'tools/code_cache/cache_builder.cc',
1398         'tools/code_cache/cache_builder.h',
1399       ],
1400
1401       'conditions': [
1402         [ 'node_use_openssl=="true"', {
1403           'defines': [
1404             'HAVE_OPENSSL=1',
1405           ],
1406         }],
1407         ['v8_enable_inspector==1', {
1408           'defines': [
1409             'HAVE_INSPECTOR=1',
1410           ],
1411         }],
1412         ['OS=="win"', {
1413           'libraries': [
1414             'dbghelp.lib',
1415             'PsApi.lib',
1416             'winmm.lib',
1417             'Ws2_32.lib',
1418           ],
1419         }],
1420       ],
1421     }, # mkcodecache
1422     {
1423       'target_name': 'node_mksnapshot',
1424       'type': 'executable',
1425
1426       'dependencies': [
1427         '<(node_lib_target_name)',
1428         'deps/histogram/histogram.gyp:histogram',
1429         'deps/uvwasi/uvwasi.gyp:uvwasi',
1430       ],
1431
1432       'includes': [
1433         'node.gypi'
1434       ],
1435
1436       'include_dirs': [
1437         'src',
1438         'tools/msvs/genfiles',
1439         '<(lwnode_jsengine_path)/include',
1440         'deps/cares/include',
1441         'deps/uv/include',
1442         'deps/uvwasi/include',
1443       ],
1444
1445       'defines': [ 'NODE_WANT_INTERNALS=1' ],
1446
1447       'sources': [
1448         'src/node_snapshot_stub.cc',
1449         'src/node_code_cache_stub.cc',
1450         'tools/snapshot/node_mksnapshot.cc',
1451         'tools/snapshot/snapshot_builder.cc',
1452         'tools/snapshot/snapshot_builder.h',
1453       ],
1454
1455       'conditions': [
1456         [ 'node_use_openssl=="true"', {
1457           'defines': [
1458             'HAVE_OPENSSL=1',
1459           ],
1460         }],
1461         ['v8_enable_inspector==1', {
1462           'defines': [
1463             'HAVE_INSPECTOR=1',
1464           ],
1465         }],
1466         ['OS=="win"', {
1467           'libraries': [
1468             'Dbghelp.lib',
1469             'winmm.lib',
1470             'Ws2_32.lib',
1471           ],
1472         }],
1473       ],
1474     }, # node_mksnapshot
1475   ], # end targets
1476
1477   'conditions': [
1478     ['OS=="aix" and node_shared=="true"', {
1479       'targets': [
1480         {
1481           'target_name': 'node_aix_shared',
1482           'type': 'shared_library',
1483           'product_name': '<(node_core_target_name)',
1484           'ldflags': ['--shared'],
1485           'product_extension': '<(shlib_suffix)',
1486           'includes': [
1487             'node.gypi'
1488           ],
1489           'dependencies': ['<(node_lib_target_name)'],
1490           'include_dirs': [
1491             'src',
1492             '<(lwnode_jsengine_path)/include',
1493           ],
1494           'sources': [
1495             '<@(library_files)',
1496             'common.gypi',
1497           ],
1498           'direct_dependent_settings': {
1499             'ldflags': [ '-Wl,-brtl' ],
1500           },
1501         },
1502       ]
1503     }], # end aix section
1504   ], # end conditions block
1505 }