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