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