Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/nodejs/common.gypi
$ cat -n /usr/include/nodejs/common.gypi 1 { 2 'variables': { 3 'configuring_node%': 0, 4 'asan%': 0, 5 'werror': '', # Turn off -Werror in V8 build. 6 'visibility%': 'hidden', # V8's visibility setting 7 'target_arch%': 'ia32', # set v8's target architecture 8 'host_arch%': 'ia32', # set v8's host architecture 9 'want_separate_host_toolset%': 0, # V8 should not build target and host 10 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds 11 'component%': 'static_library', # NB. these names match with what V8 expects 12 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way 13 'enable_pgo_generate%': '0', 14 'enable_pgo_use%': '0', 15 'python%': 'python', 16 17 'node_shared%': 'false', 18 'force_dynamic_crt%': 0, 19 'node_use_v8_platform%': 'true', 20 'node_use_bundled_v8%': 'true', 21 'node_module_version%': '', 22 'node_with_ltcg%': '', 23 'node_shared_openssl%': 'false', 24 25 'node_tag%': '', 26 'uv_library%': 'static_library', 27 28 'clang%': 0, 29 'error_on_warn%': 'false', 30 31 'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)', 32 'openssl_no_asm%': 0, 33 34 # Don't use ICU data file (icudtl.dat) from V8, we use our own. 35 'icu_use_data_file_flag%': 0, 36 37 # Reset this number to 0 on major V8 upgrades. 38 # Increment by one for each non-official patch applied to deps/v8. 39 'v8_embedder_string': '-node.28', 40 41 ##### V8 defaults for Node.js ##### 42 43 # Turn on SipHash for hash seed generation, addresses HashWick 44 'v8_use_siphash': 'true', 45 46 # These are more relevant for V8 internal development. 47 # Refs: https://github.com/nodejs/node/issues/23122 48 # Refs: https://github.com/nodejs/node/issues/23167 49 # Enable compiler warnings when using V8_DEPRECATED apis from V8 code. 50 'v8_deprecation_warnings': 0, 51 # Enable compiler warnings when using V8_DEPRECATE_SOON apis from V8 code. 52 'v8_imminent_deprecation_warnings': 0, 53 54 # Enable disassembler for `--print-code` v8 options 55 'v8_enable_disassembler': 1, 56 57 # Sets -dOBJECT_PRINT. 58 'v8_enable_object_print%': 1, 59 60 # https://github.com/nodejs/node/pull/22920/files#r222779926 61 'v8_enable_handle_zapping': 0, 62 63 # Disable pointer compression. Can be enabled at build time via configure 64 # options but default values are required here as this file is also used by 65 # node-gyp to build addons. 66 'v8_enable_pointer_compression%': 0, 67 'v8_enable_31bit_smis_on_64bit_arch%': 0, 68 69 # Disable v8 hugepage by default. 70 'v8_enable_hugepage%': 0, 71 72 # This is more of a V8 dev setting 73 # https://github.com/nodejs/node/pull/22920/files#r222779926 74 'v8_enable_fast_mksnapshot': 0, 75 76 'v8_win64_unwinding_info': 1, 77 78 # TODO(refack): make v8-perfetto happen 79 'v8_use_perfetto': 0, 80 81 ##### end V8 defaults ##### 82 83 'conditions': [ 84 ['OS == "win"', { 85 'os_posix': 0, 86 'v8_postmortem_support%': 0, 87 'obj_dir': '<(PRODUCT_DIR)/obj', 88 'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a', 89 }, { 90 'os_posix': 1, 91 'v8_postmortem_support%': 1, 92 }], 93 ['GENERATOR == "ninja"', { 94 'obj_dir': '<(PRODUCT_DIR)/obj', 95 'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a', 96 }, { 97 'obj_dir%': '<(PRODUCT_DIR)/obj.target', 98 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a', 99 }], 100 ['OS=="mac"', { 101 'clang%': 1, 102 'obj_dir%': '<(PRODUCT_DIR)/obj.target', 103 'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a', 104 }], 105 # V8 pointer compression only supports 64bit architectures. 106 ['target_arch in "arm ia32 mips mipsel ppc"', { 107 'v8_enable_pointer_compression': 0, 108 'v8_enable_31bit_smis_on_64bit_arch': 0, 109 }], 110 ['target_arch in "ppc64 s390x"', { 111 'v8_enable_backtrace': 1, 112 }], 113 ['OS=="linux"', { 114 'node_section_ordering_info%': '' 115 }], 116 ['OS == "zos"', { 117 # use ICU data file on z/OS 118 'icu_use_data_file_flag%': 1 119 }] 120 ], 121 }, 122 123 'target_defaults': { 124 'default_configuration': 'Release', 125 'configurations': { 126 'Debug': { 127 'variables': { 128 'v8_enable_handle_zapping': 1, 129 'conditions': [ 130 ['node_shared != "true"', { 131 'MSVC_runtimeType': 1, # MultiThreadedDebug (/MTd) 132 }, { 133 'MSVC_runtimeType': 3, # MultiThreadedDebugDLL (/MDd) 134 }], 135 ], 136 }, 137 'defines': [ 'DEBUG', '_DEBUG', 'V8_ENABLE_CHECKS' ], 138 'cflags': [ '-g', '-O0' ], 139 'conditions': [ 140 ['OS in "aix os400"', { 141 'cflags': [ '-gxcoff' ], 142 'ldflags': [ '-Wl,-bbigtoc' ], 143 }], 144 ['OS == "android"', { 145 'cflags': [ '-fPIC' ], 146 'ldflags': [ '-fPIC' ] 147 }], 148 ], 149 'msvs_settings': { 150 'VCCLCompilerTool': { 151 'BasicRuntimeChecks': 3, # /RTC1 152 'MinimalRebuild': 'false', 153 'OmitFramePointers': 'false', 154 'Optimization': 0, # /Od, no optimization 155 'RuntimeLibrary': '<(MSVC_runtimeType)', 156 }, 157 'VCLinkerTool': { 158 'LinkIncremental': 2, # enable incremental linking 159 }, 160 }, 161 'xcode_settings': { 162 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os 163 }, 164 }, 165 'Release': { 166 'variables': { 167 'v8_enable_handle_zapping': 0, 168 'pgo_generate': ' -fprofile-generate ', 169 'pgo_use': ' -fprofile-use -fprofile-correction ', 170 'conditions': [ 171 ['node_shared != "true"', { 172 'MSVC_runtimeType': 0 # MultiThreaded (/MT) 173 }, { 174 'MSVC_runtimeType': 2 # MultiThreadedDLL (/MD) 175 }], 176 ['llvm_version=="0.0"', { 177 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC 178 }, { 179 'lto': ' -flto ', # Clang 180 }], 181 ], 182 }, 183 'cflags': [ '-O3' ], 184 'conditions': [ 185 ['enable_lto=="true"', { 186 'cflags': ['<(lto)'], 187 'ldflags': ['<(lto)'], 188 'xcode_settings': { 189 'LLVM_LTO': 'YES', 190 }, 191 }], 192 ['OS=="linux"', { 193 'conditions': [ 194 ['node_section_ordering_info!=""', { 195 'cflags': [ 196 '-fuse-ld=gold', 197 '-ffunction-sections', 198 ], 199 'ldflags': [ 200 '-fuse-ld=gold', 201 '-Wl,--section-ordering-file=<(node_section_ordering_info)', 202 ], 203 }], 204 ], 205 }], 206 ['OS=="solaris"', { 207 # pull in V8's postmortem metadata 208 'ldflags': [ '-Wl,-z,allextract' ] 209 }], 210 ['OS=="zos"', { 211 # increase performance, number from experimentation 212 'cflags': [ '-qINLINE=::150:100000' ] 213 }], 214 ['OS!="mac" and OS!="win" and OS!="zos"', { 215 # -fno-omit-frame-pointer is necessary for the --perf_basic_prof 216 # flag to work correctly. perf(1) gets confused about JS stack 217 # frames otherwise, even with --call-graph dwarf. 218 'cflags': [ '-fno-omit-frame-pointer' ], 219 }], 220 ['OS=="linux"', { 221 'conditions': [ 222 ['enable_pgo_generate=="true"', { 223 'cflags': ['<(pgo_generate)'], 224 'ldflags': ['<(pgo_generate)'], 225 },], 226 ['enable_pgo_use=="true"', { 227 'cflags': ['<(pgo_use)'], 228 'ldflags': ['<(pgo_use)'], 229 },], 230 ], 231 },], 232 ['OS == "android"', { 233 'cflags': [ '-fPIC' ], 234 'ldflags': [ '-fPIC' ] 235 }], 236 ], 237 'msvs_settings': { 238 'VCCLCompilerTool': { 239 'conditions': [ 240 ['target_arch=="arm64"', { 241 'FloatingPointModel': 1 # /fp:strict 242 }] 243 ], 244 'EnableFunctionLevelLinking': 'true', 245 'EnableIntrinsicFunctions': 'true', 246 'FavorSizeOrSpeed': 1, # /Ot, favor speed over size 247 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible 248 'OmitFramePointers': 'true', 249 'Optimization': 3, # /Ox, full optimization 250 'RuntimeLibrary': '<(MSVC_runtimeType)', 251 'RuntimeTypeInfo': 'false', 252 } 253 }, 254 'xcode_settings': { 255 'GCC_OPTIMIZATION_LEVEL': '3', # stop gyp from defaulting to -Os 256 }, 257 } 258 }, 259 260 # Defines these mostly for node-gyp to pickup, and warn addon authors of 261 # imminent V8 deprecations, also to sync how dependencies are configured. 262 'defines': [ 263 'V8_DEPRECATION_WARNINGS', 264 'V8_IMMINENT_DEPRECATION_WARNINGS', 265 '_GLIBCXX_USE_CXX11_ABI=1', 266 ], 267 268 # Forcibly disable -Werror. We support a wide range of compilers, it's 269 # simply not feasible to squelch all warnings, never mind that the 270 # libraries in deps/ are not under our control. 271 'conditions': [ 272 [ 'error_on_warn=="false"', { 273 'cflags!': ['-Werror'], 274 }, '(_target_name!="<(node_lib_target_name)" or ' 275 '_target_name!="<(node_core_target_name)")', { 276 'cflags!': ['-Werror'], 277 }], 278 ], 279 'msvs_settings': { 280 'VCCLCompilerTool': { 281 'AdditionalOptions': [ 282 '/Zc:__cplusplus', 283 '-std:c++17' 284 ], 285 'BufferSecurityCheck': 'true', 286 'DebugInformationFormat': 1, # /Z7 embed info in .obj files 287 'ExceptionHandling': 0, # /EHsc 288 'MultiProcessorCompilation': 'true', 289 'StringPooling': 'true', # pool string literals 290 'SuppressStartupBanner': 'true', 291 'WarnAsError': 'false', 292 'WarningLevel': 3, # /W3 293 }, 294 'VCLinkerTool': { 295 'target_conditions': [ 296 ['_type=="executable"', { 297 'SubSystem': 1, # /SUBSYSTEM:CONSOLE 298 }], 299 ], 300 'conditions': [ 301 ['target_arch=="ia32"', { 302 'TargetMachine' : 1, # /MACHINE:X86 303 }], 304 ['target_arch=="x64"', { 305 'TargetMachine' : 17, # /MACHINE:X64 306 }], 307 ['target_arch=="arm64"', { 308 'TargetMachine' : 0, # NotSet. MACHINE:ARM64 is inferred from the input files. 309 }], 310 ], 311 'GenerateDebugInformation': 'true', 312 'SuppressStartupBanner': 'true', 313 }, 314 }, 315 # Disable warnings: 316 # - "C4251: class needs to have dll-interface" 317 # - "C4275: non-DLL-interface used as base for DLL-interface" 318 # Over 10k of these warnings are generated when compiling node, 319 # originating from v8.h. Most of them are false positives. 320 # See also: https://github.com/nodejs/node/pull/15570 321 # TODO: re-enable when Visual Studio fixes these upstream. 322 # 323 # - "C4267: conversion from 'size_t' to 'int'" 324 # Many any originate from our dependencies, and their sheer number 325 # drowns out other, more legitimate warnings. 326 # - "C4244: conversion from 'type1' to 'type2', possible loss of data" 327 # Ususaly safe. Disable for `dep`, enable for `src` 328 'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267], 329 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin 330 331 'conditions': [ 332 [ 'configuring_node', { 333 'msvs_configuration_attributes': { 334 'OutputDirectory': '<(DEPTH)/out/$(Configuration)/', 335 'IntermediateDirectory': '$(OutDir)obj/$(ProjectName)/' 336 }, 337 }], 338 [ 'target_arch=="x64"', { 339 'msvs_configuration_platform': 'x64', 340 }], 341 [ 'target_arch=="arm64"', { 342 'msvs_configuration_platform': 'arm64', 343 }], 344 ['asan == 1 and OS != "mac" and OS != "zos"', { 345 'cflags+': [ 346 '-fno-omit-frame-pointer', 347 '-fsanitize=address', 348 '-fsanitize-address-use-after-scope', 349 ], 350 'defines': [ 'LEAK_SANITIZER', 'V8_USE_ADDRESS_SANITIZER' ], 351 'cflags!': [ '-fomit-frame-pointer' ], 352 'ldflags': [ '-fsanitize=address' ], 353 }], 354 ['asan == 1 and OS == "mac"', { 355 'xcode_settings': { 356 'OTHER_CFLAGS+': [ 357 '-fno-omit-frame-pointer', 358 '-gline-tables-only', 359 '-fsanitize=address', 360 '-DLEAK_SANITIZER' 361 ], 362 'OTHER_CFLAGS!': [ 363 '-fomit-frame-pointer', 364 ], 365 }, 366 'target_conditions': [ 367 ['_type!="static_library"', { 368 'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']}, 369 }], 370 ], 371 }], 372 ['v8_enable_pointer_compression == 1', { 373 'defines': [ 374 'V8_COMPRESS_POINTERS', 375 'V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE', 376 ], 377 }], 378 ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', { 379 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'], 380 }], 381 ['OS == "win"', { 382 'defines': [ 383 'WIN32', 384 # we don't really want VC++ warning us about 385 # how dangerous C functions are... 386 '_CRT_SECURE_NO_DEPRECATE', 387 # ... or that C implementations shouldn't use 388 # POSIX names 389 '_CRT_NONSTDC_NO_DEPRECATE', 390 # Make sure the STL doesn't try to use exceptions 391 '_HAS_EXCEPTIONS=0', 392 'BUILDING_V8_SHARED=1', 393 'BUILDING_UV_SHARED=1', 394 ], 395 }], 396 [ 'OS in "linux freebsd openbsd solaris aix os400"', { 397 'cflags': [ '-pthread' ], 398 'ldflags': [ '-pthread' ], 399 }], 400 [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', { 401 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], 402 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ], 403 'defines': [ '__STDC_FORMAT_MACROS' ], 404 'ldflags': [ '-rdynamic' ], 405 'target_conditions': [ 406 # The 1990s toolchain on SmartOS can't handle thin archives. 407 ['_type=="static_library" and OS=="solaris"', { 408 'standalone_static_library': 1, 409 }], 410 ['OS=="openbsd"', { 411 'cflags': [ '-I/usr/local/include' ], 412 'ldflags': [ '-Wl,-z,wxneeded' ], 413 }], 414 ['_toolset=="host"', { 415 'conditions': [ 416 [ 'host_arch=="ia32"', { 417 'cflags': [ '-m32' ], 418 'ldflags': [ '-m32' ], 419 }], 420 [ 'host_arch=="x64"', { 421 'cflags': [ '-m64' ], 422 'ldflags': [ '-m64' ], 423 }], 424 [ 'host_arch=="ppc" and OS not in "aix os400"', { 425 'cflags': [ '-m32' ], 426 'ldflags': [ '-m32' ], 427 }], 428 [ 'host_arch=="ppc64" and OS not in "aix os400"', { 429 'cflags': [ '-m64', '-mminimal-toc' ], 430 'ldflags': [ '-m64' ], 431 }], 432 [ 'host_arch=="s390x" and OS=="linux"', { 433 'cflags': [ '-m64', '-march=z196' ], 434 'ldflags': [ '-m64', '-march=z196' ], 435 }], 436 ], 437 }], 438 ['_toolset=="target"', { 439 'conditions': [ 440 [ 'target_arch=="ia32"', { 441 'cflags': [ '-m32' ], 442 'ldflags': [ '-m32' ], 443 }], 444 [ 'target_arch=="x64"', { 445 'cflags': [ '-m64' ], 446 'ldflags': [ '-m64' ], 447 }], 448 [ 'target_arch=="ppc" and OS not in "aix os400"', { 449 'cflags': [ '-m32' ], 450 'ldflags': [ '-m32' ], 451 }], 452 [ 'target_arch=="ppc64" and OS not in "aix os400"', { 453 'cflags': [ '-m64', '-mminimal-toc' ], 454 'ldflags': [ '-m64' ], 455 }], 456 [ 'target_arch=="s390x" and OS=="linux"', { 457 'cflags': [ '-m64', '-march=z196' ], 458 'ldflags': [ '-m64', '-march=z196' ], 459 }], 460 ], 461 }], 462 ], 463 'conditions': [ 464 [ 'OS=="solaris"', { 465 'cflags': [ '-pthreads' ], 466 'ldflags': [ '-pthreads' ], 467 'cflags!': [ '-pthread' ], 468 'ldflags!': [ '-pthread' ], 469 }], 470 [ 'node_shared=="true"', { 471 'cflags': [ '-fPIC' ], 472 }], 473 ], 474 }], 475 [ 'OS in "aix os400"', { 476 'variables': { 477 # Used to differentiate `AIX` and `OS400`(IBM i). 478 'aix_variant_name': '
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™