1# Copyright 2012 the V8 project authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4{ 5 'variables': { 6 'V8_ROOT': '../../deps/v8', 7 'v8_code': 1, 8 'v8_random_seed%': 314159265, 9 'v8_vector_stores%': 0, 10 'v8_embed_script%': "", 11 'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)', 12 'v8_os_page_size%': 0, 13 'generate_bytecode_output_root': '<(SHARED_INTERMEDIATE_DIR)/generate-bytecode-output-root', 14 'generate_bytecode_builtins_list_output': '<(generate_bytecode_output_root)/builtins-generated/bytecodes-builtins-list.h', 15 'torque_files': [ 16 "<(V8_ROOT)/src/builtins/arguments.tq", 17 "<(V8_ROOT)/src/builtins/array-copywithin.tq", 18 "<(V8_ROOT)/src/builtins/array-every.tq", 19 "<(V8_ROOT)/src/builtins/array-filter.tq", 20 "<(V8_ROOT)/src/builtins/array-find.tq", 21 "<(V8_ROOT)/src/builtins/array-findindex.tq", 22 "<(V8_ROOT)/src/builtins/array-foreach.tq", 23 "<(V8_ROOT)/src/builtins/array-join.tq", 24 "<(V8_ROOT)/src/builtins/array-lastindexof.tq", 25 "<(V8_ROOT)/src/builtins/array-map.tq", 26 "<(V8_ROOT)/src/builtins/array-of.tq", 27 "<(V8_ROOT)/src/builtins/array-reduce-right.tq", 28 "<(V8_ROOT)/src/builtins/array-reduce.tq", 29 "<(V8_ROOT)/src/builtins/array-reverse.tq", 30 "<(V8_ROOT)/src/builtins/array-shift.tq", 31 "<(V8_ROOT)/src/builtins/array-slice.tq", 32 "<(V8_ROOT)/src/builtins/array-some.tq", 33 "<(V8_ROOT)/src/builtins/array-splice.tq", 34 "<(V8_ROOT)/src/builtins/array-unshift.tq", 35 "<(V8_ROOT)/src/builtins/array.tq", 36 "<(V8_ROOT)/src/builtins/base.tq", 37 "<(V8_ROOT)/src/builtins/bigint.tq", 38 "<(V8_ROOT)/src/builtins/boolean.tq", 39 "<(V8_ROOT)/src/builtins/collections.tq", 40 "<(V8_ROOT)/src/builtins/data-view.tq", 41 "<(V8_ROOT)/src/builtins/extras-utils.tq", 42 "<(V8_ROOT)/src/builtins/frames.tq", 43 "<(V8_ROOT)/src/builtins/growable-fixed-array.tq", 44 "<(V8_ROOT)/src/builtins/internal-coverage.tq", 45 "<(V8_ROOT)/src/builtins/iterator.tq", 46 "<(V8_ROOT)/src/builtins/math.tq", 47 "<(V8_ROOT)/src/builtins/object-fromentries.tq", 48 "<(V8_ROOT)/src/builtins/object.tq", 49 "<(V8_ROOT)/src/builtins/proxy-constructor.tq", 50 "<(V8_ROOT)/src/builtins/proxy-delete-property.tq", 51 "<(V8_ROOT)/src/builtins/proxy-get-property.tq", 52 "<(V8_ROOT)/src/builtins/proxy-get-prototype-of.tq", 53 "<(V8_ROOT)/src/builtins/proxy-has-property.tq", 54 "<(V8_ROOT)/src/builtins/proxy-is-extensible.tq", 55 "<(V8_ROOT)/src/builtins/proxy-prevent-extensions.tq", 56 "<(V8_ROOT)/src/builtins/proxy-revocable.tq", 57 "<(V8_ROOT)/src/builtins/proxy-revoke.tq", 58 "<(V8_ROOT)/src/builtins/proxy-set-property.tq", 59 "<(V8_ROOT)/src/builtins/proxy-set-prototype-of.tq", 60 "<(V8_ROOT)/src/builtins/proxy.tq", 61 "<(V8_ROOT)/src/builtins/reflect.tq", 62 "<(V8_ROOT)/src/builtins/regexp-match.tq", 63 "<(V8_ROOT)/src/builtins/regexp-replace.tq", 64 "<(V8_ROOT)/src/builtins/regexp-source.tq", 65 "<(V8_ROOT)/src/builtins/regexp-test.tq", 66 "<(V8_ROOT)/src/builtins/regexp.tq", 67 "<(V8_ROOT)/src/builtins/string.tq", 68 "<(V8_ROOT)/src/builtins/string-endswith.tq", 69 "<(V8_ROOT)/src/builtins/string-html.tq", 70 "<(V8_ROOT)/src/builtins/string-iterator.tq", 71 "<(V8_ROOT)/src/builtins/string-pad.tq", 72 "<(V8_ROOT)/src/builtins/string-repeat.tq", 73 "<(V8_ROOT)/src/builtins/string-slice.tq", 74 "<(V8_ROOT)/src/builtins/string-startswith.tq", 75 "<(V8_ROOT)/src/builtins/string-substring.tq", 76 "<(V8_ROOT)/src/builtins/torque-internal.tq", 77 "<(V8_ROOT)/src/builtins/typed-array-createtypedarray.tq", 78 "<(V8_ROOT)/src/builtins/typed-array-every.tq", 79 "<(V8_ROOT)/src/builtins/typed-array-filter.tq", 80 "<(V8_ROOT)/src/builtins/typed-array-find.tq", 81 "<(V8_ROOT)/src/builtins/typed-array-findindex.tq", 82 "<(V8_ROOT)/src/builtins/typed-array-foreach.tq", 83 "<(V8_ROOT)/src/builtins/typed-array-reduce.tq", 84 "<(V8_ROOT)/src/builtins/typed-array-reduceright.tq", 85 "<(V8_ROOT)/src/builtins/typed-array-slice.tq", 86 "<(V8_ROOT)/src/builtins/typed-array-some.tq", 87 "<(V8_ROOT)/src/builtins/typed-array-subarray.tq", 88 "<(V8_ROOT)/src/builtins/typed-array.tq", 89 "<(V8_ROOT)/third_party/v8/builtins/array-sort.tq", 90 "<(V8_ROOT)/test/torque/test-torque.tq", 91 ], 92 'torque_output_root': '<(SHARED_INTERMEDIATE_DIR)/torque-output-root', 93 'torque_files_replaced': ['<!@pymod_do_main(ForEachReplace ".tq" "-tq-csa" <@(torque_files))'], 94 'torque_outputs': ['<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/%s.cc" <@(torque_files_replaced))'], 95 'torque_outputs+': ['<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/%s.h" <@(torque_files_replaced))'], 96 'v8_compiler_sources': ['<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources = ")'], 97 98 'conditions': [ 99 ['v8_enable_i18n_support', { 100 'torque_files': [ 101 "<(V8_ROOT)/src/objects/intl-objects.tq", 102 ] 103 }] 104 ], 105 }, 106 'includes': ['toolchain.gypi', 'features.gypi'], 107 'target_defaults': { 108 'msvs_settings': { 109 'VCCLCompilerTool': { 110 'AdditionalOptions': ['/utf-8'] 111 } 112 }, 113 }, 114 'targets': [ 115 { 116 'target_name': 'run_torque', 117 'type': 'none', 118 'conditions': [ 119 ['want_separate_host_toolset', { 120 'dependencies': ['torque#host'], 121 'toolsets': ['host', 'target'], 122 }, { 123 'dependencies': ['torque'], 124 }], 125 ], 126 'hard_dependency': 1, 127 'direct_dependent_settings': { 128 'include_dirs': [ 129 '<(torque_output_root)', 130 ], 131 }, 132 'actions': [ 133 { 134 'action_name': 'run_torque_action', 135 'inputs': [ # Order matters. 136 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)', 137 '<@(torque_files)', 138 ], 139 'outputs': [ 140 '<(torque_output_root)/torque-generated/builtin-definitions-tq.h', 141 '<(torque_output_root)/torque-generated/field-offsets-tq.h', 142 '<(torque_output_root)/torque-generated/class-verifiers-tq.cc', 143 '<(torque_output_root)/torque-generated/class-verifiers-tq.h', 144 '<(torque_output_root)/torque-generated/objects-printer-tq.cc', 145 '<(torque_output_root)/torque-generated/class-definitions-tq.cc', 146 '<(torque_output_root)/torque-generated/class-definitions-tq-inl.h', 147 '<(torque_output_root)/torque-generated/class-definitions-tq.h', 148 '<(torque_output_root)/torque-generated/class-debug-readers-tq.cc', 149 '<(torque_output_root)/torque-generated/class-debug-readers-tq.h', 150 '<(torque_output_root)/torque-generated/exported-macros-assembler-tq.cc', 151 '<(torque_output_root)/torque-generated/exported-macros-assembler-tq.h', 152 '<(torque_output_root)/torque-generated/csa-types-tq.h', 153 '<(torque_output_root)/torque-generated/instance-types-tq.h', 154 '<@(torque_outputs)', 155 ], 156 'action': [ 157 '<@(_inputs)', 158 '-o', '<(torque_output_root)/torque-generated', 159 '-v8-root', '<(V8_ROOT)' 160 ], 161 }, 162 ], 163 }, # run_torque 164 { 165 'target_name': 'v8_maybe_icu', 166 'type': 'none', 167 'hard_dependency': 1, 168 'conditions': [ 169 ['want_separate_host_toolset', { 170 'toolsets': ['host', 'target'], 171 }], 172 ['v8_enable_i18n_support', { 173 'dependencies': [ 174 '<(icu_gyp_path):icui18n', 175 '<(icu_gyp_path):icuuc', 176 ], 177 'export_dependent_settings': [ 178 '<(icu_gyp_path):icui18n', 179 '<(icu_gyp_path):icuuc', 180 ], 181 }], 182 ], 183 }, # v8_maybe_icu 184 { 185 'target_name': 'torque_generated_initializers', 186 'type': 'none', 187 'hard_dependency': 1, 188 'conditions': [ 189 ['want_separate_host_toolset', { 190 'toolsets': ['host', 'target'], 191 }], 192 ], 193 'dependencies': [ 194 'generate_bytecode_builtins_list', 195 'run_torque', 196 'v8_maybe_icu', 197 ], 198 'direct_dependent_settings': { 199 'sources': [ 200 '<(torque_output_root)/torque-generated/exported-macros-assembler-tq.cc', 201 '<(torque_output_root)/torque-generated/exported-macros-assembler-tq.h', 202 '<(torque_output_root)/torque-generated/csa-types-tq.h', 203 '<@(torque_outputs)', 204 ], 205 } 206 }, # torque_generated_initializers 207 { 208 'target_name': 'torque_generated_definitions', 209 'type': 'none', 210 'hard_dependency': 1, 211 'conditions': [ 212 ['want_separate_host_toolset', { 213 'toolsets': ['host', 'target'], 214 }], 215 ], 216 'dependencies': [ 217 'generate_bytecode_builtins_list', 218 'run_torque', 219 'v8_maybe_icu', 220 ], 221 'direct_dependent_settings': { 222 'sources': [ 223 '<(torque_output_root)/torque-generated/class-definitions-tq.cc', 224 '<(torque_output_root)/torque-generated/class-verifiers-tq.cc', 225 '<(torque_output_root)/torque-generated/class-verifiers-tq.h', 226 '<(torque_output_root)/torque-generated/objects-printer-tq.cc', 227 ], 228 'include_dirs': [ 229 '<(torque_output_root)', 230 ], 231 }, 232 }, # torque_generated_definitions 233 { 234 'target_name': 'generate_bytecode_builtins_list', 235 'type': 'none', 236 'hard_dependency': 1, 237 'conditions': [ 238 ['want_separate_host_toolset', { 239 'dependencies': ['bytecode_builtins_list_generator#host'], 240 'toolsets': ['host', 'target'], 241 }, { 242 'dependencies': ['bytecode_builtins_list_generator'], 243 }], 244 ], 245 'direct_dependent_settings': { 246 'sources': [ 247 '<(generate_bytecode_builtins_list_output)', 248 ], 249 'include_dirs': [ 250 '<(generate_bytecode_output_root)', 251 '<(torque_output_root)', 252 ], 253 }, 254 'actions': [ 255 { 256 'action_name': 'generate_bytecode_builtins_list_action', 257 'inputs': [ 258 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)', 259 ], 260 'outputs': [ 261 '<(generate_bytecode_builtins_list_output)', 262 ], 263 'action': [ 264 'python', 265 '<(V8_ROOT)/tools/run.py', 266 '<@(_inputs)', 267 '<@(_outputs)', 268 ], 269 }, 270 ], 271 }, # generate_bytecode_builtins_list 272 273 { 274 # This rule delegates to either v8_snapshot or v8_nosnapshot depending on 275 # the current variables. 276 # The intention is to make the 'calling' rules a bit simpler. 277 'target_name': 'v8_maybe_snapshot', 278 'type': 'none', 279 'toolsets': ['target'], 280 'hard_dependency': 1, 281 'conditions': [ 282 # The dependency on v8_base should come from a transitive 283 # dependency however the Android toolchain requires libv8_base.a 284 # to appear before libv8_snapshot.a so it's listed explicitly. 285 ['v8_use_snapshot==1', { 286 'dependencies': ['v8_base', 'v8_snapshot'], 287 }, { 288 'dependencies': ['v8_base', 'v8_init', 'v8_nosnapshot'], 289 }], 290 ] 291 }, # v8_maybe_snapshot 292 { 293 'target_name': 'v8_init', 294 'type': 'static_library', 295 'conditions': [ 296 ['want_separate_host_toolset', { 297 'toolsets': ['host', 'target'], 298 }], 299 ], 300 'dependencies': [ 301 'generate_bytecode_builtins_list', 302 'run_torque', 303 'v8_initializers', 304 'v8_maybe_icu', 305 ], 306 'sources': [ 307 ### gcmole(all) ### 308 '<(V8_ROOT)/src/init/setup-isolate-full.cc', 309 310 # '<(generate_bytecode_builtins_list_output)', 311 ], 312 }, # v8_init 313 { 314 'target_name': 'v8_initializers', 315 'type': 'static_library', 316 'dependencies': [ 317 'torque_generated_initializers', 318 ], 319 'include_dirs': [ 320 '<(torque_output_root)', 321 '<(generate_bytecode_output_root)', 322 ], 323 'sources': [ 324 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?sources = ")', 325 326 '<@(torque_outputs)', 327 ], 328 'conditions': [ 329 ['want_separate_host_toolset', { 330 'toolsets': ['host', 'target'], 331 }], 332 ['v8_target_arch=="ia32"', { 333 'sources': [ 334 '<(V8_ROOT)/src/builtins/ia32/builtins-ia32.cc', 335 ], 336 }], 337 ['v8_target_arch=="x64"', { 338 'sources': [ 339 '<(V8_ROOT)/src/builtins/x64/builtins-x64.cc', 340 ], 341 }], 342 ['v8_target_arch=="arm"', { 343 'sources': [ 344 '<(V8_ROOT)/src/builtins/arm/builtins-arm.cc', 345 ], 346 }], 347 ['v8_target_arch=="arm64"', { 348 'sources': [ 349 '<(V8_ROOT)/src/builtins/arm64/builtins-arm64.cc', 350 ], 351 }], 352 ['v8_target_arch=="mips" or v8_target_arch=="mipsel"', { 353 'sources': [ 354 '<(V8_ROOT)/src/builtins/mips/builtins-mips.cc', 355 ], 356 }], 357 ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', { 358 'sources': [ 359 '<(V8_ROOT)/src/builtins/mips64/builtins-mips64.cc', 360 ], 361 }], 362 ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', { 363 'sources': [ 364 '<(V8_ROOT)/src/builtins/ppc/builtins-ppc.cc', 365 ], 366 }], 367 ['v8_target_arch=="s390x"', { 368 'sources': [ 369 '<(V8_ROOT)/src/builtins/s390/builtins-s390.cc', 370 ], 371 }], 372 ['v8_enable_i18n_support==1', { 373 'dependencies': [ 374 '<(icu_gyp_path):icui18n', 375 '<(icu_gyp_path):icuuc', 376 ], 377 }, { 378 'sources!': [ 379 '<(V8_ROOT)/src/builtins/builtins-intl-gen.cc', 380 ], 381 }], 382 ['OS=="win"', { 383 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 384 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 385 'sources': [ 386 '<(_msvs_precompiled_header)', 387 '<(_msvs_precompiled_source)', 388 ], 389 }], 390 ], 391 }, # v8_initializers 392 { 393 'target_name': 'v8_snapshot', 394 'type': 'static_library', 395 'toolsets': ['target'], 396 'conditions': [ 397 ['want_separate_host_toolset', { 398 'dependencies': [ 399 'generate_bytecode_builtins_list', 400 'run_torque', 401 'mksnapshot#host', 402 'v8_maybe_icu', 403 # [GYP] added explicitly, instead of inheriting from the other deps 404 'v8_base_without_compiler', 405 'v8_compiler_for_mksnapshot', 406 'v8_initializers', 407 'v8_libplatform', 408 ] 409 }, { 410 'dependencies': [ 411 'generate_bytecode_builtins_list', 412 'run_torque', 413 'mksnapshot', 414 'v8_maybe_icu', 415 # [GYP] added explicitly, instead of inheriting from the other deps 416 'v8_base_without_compiler', 417 'v8_compiler_for_mksnapshot', 418 'v8_initializers', 419 'v8_libplatform', 420 ] 421 }], 422 ], 423 'sources': [ 424 '<(V8_ROOT)/src/init/setup-isolate-deserialize.cc', 425 './extras-libraries.cc', 426 ], 427 'xcode_settings': { 428 # V8 7.4 over macOS10.11 compatibility 429 # Refs: https://github.com/nodejs/node/pull/26685 430 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', 431 }, 432 'actions': [ 433 { 434 'action_name': 'run_mksnapshot', 435 'message': 'generating: >@(_outputs)', 436 'variables': { 437 'mksnapshot_flags': [ 438 '--turbo_instruction_scheduling', 439 # In cross builds, the snapshot may be generated for both the host and 440 # target toolchains. The same host binary is used to generate both, so 441 # mksnapshot needs to know which target OS to use at runtime. It's weird, 442 # but the target OS is really <(OS). 443 '--target_os=<(OS)', 444 '--target_arch=<(v8_target_arch)', 445 '--startup_src', '<(INTERMEDIATE_DIR)/snapshot.cc', 446 ], 447 }, 448 'inputs': [ 449 '<(mksnapshot_exec)', 450 ], 451 'outputs': ["<(INTERMEDIATE_DIR)/snapshot.cc"], 452 'process_outputs_as_sources': 1, 453 'conditions': [ 454 ['v8_enable_embedded_builtins', { 455 # In this case we use `embedded_variant "Default"` 456 # and `suffix = ''` for the template `embedded${suffix}.S`. 457 'outputs': ['<(INTERMEDIATE_DIR)/embedded.S'], 458 'variables': { 459 'mksnapshot_flags': [ 460 '--embedded_variant', 'Default', 461 '--embedded_src', '<(INTERMEDIATE_DIR)/embedded.S', 462 ], 463 }, 464 }, { 465 'outputs': ['<(V8_ROOT)/src/snapshot/embedded/embedded-empty.cc'] 466 }], 467 ['v8_random_seed', { 468 'variables': { 469 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], 470 }, 471 }], 472 ['v8_os_page_size', { 473 'variables': { 474 'mksnapshot_flags': ['--v8_os_page_size', '<(v8_os_page_size)'], 475 }, 476 }], 477 ['v8_embed_script != ""', { 478 'inputs': ['<(v8_embed_script)'], 479 'variables': { 480 'mksnapshot_flags': ['<(v8_embed_script)'], 481 }, 482 }], 483 ['v8_enable_snapshot_code_comments', { 484 'variables': { 485 'mksnapshot_flags': ['--code-comments'], 486 }, 487 }], 488 ['v8_enable_snapshot_native_code_counters', { 489 'variables': { 490 'mksnapshot_flags': ['--native-code-counters'], 491 }, 492 }, { 493 # --native-code-counters is the default in debug mode so make sure we can 494 # unset it. 495 'variables': { 496 'mksnapshot_flags': ['--no-native-code-counters'], 497 }, 498 }], 499 ], 500 'action': [ 501 '>@(_inputs)', 502 '>@(mksnapshot_flags)', 503 ], 504 }, 505 ], 506 }, # v8_snapshot 507 { 508 'target_name': 'v8_nosnapshot', 509 'type': 'static_library', 510 'dependencies': [ 511 # 'js2c_extras', # Disabled for Node.js 512 'generate_bytecode_builtins_list', 513 'run_torque', 514 'v8_maybe_icu', 515 ], 516 'sources': [ 517 './extras-libraries.cc', 518 '<(V8_ROOT)/src/snapshot/embedded/embedded-empty.cc', 519 '<(V8_ROOT)/src/snapshot/snapshot-empty.cc', 520 ], 521 'conditions': [ 522 ['want_separate_host_toolset', { 523 'toolsets': ['host', 'target'], 524 }], 525 ['component=="shared_library"', { 526 'defines': [ 527 'BUILDING_V8_SHARED', 528 ], 529 }], 530 ] 531 }, # v8_nosnapshot 532 { 533 'target_name': 'v8_version', 534 'type': 'none', 535 'conditions': [ 536 ['want_separate_host_toolset', { 537 'toolsets': ['host', 'target'], 538 }], 539 ], 540 'direct_dependent_settings': { 541 'sources': [ 542 '<(V8_ROOT)/include/v8-value-serializer-version.h', 543 '<(V8_ROOT)/include/v8-version-string.h', 544 '<(V8_ROOT)/include/v8-version.h', 545 ], 546 }, 547 }, # v8_version 548 { 549 'target_name': 'v8_headers', 550 'type': 'none', 551 'conditions': [ 552 ['want_separate_host_toolset', { 553 'toolsets': ['host', 'target'], 554 }], 555 ], 556 'dependencies': [ 557 'v8_version', 558 ], 559 'direct_dependent_settings': { 560 'sources': [ 561 '<(V8_ROOT)/include/v8-internal.h', 562 '<(V8_ROOT)/include/v8.h', 563 '<(V8_ROOT)/include/v8config.h', 564 565 # The following headers cannot be platform-specific. The include validation 566 # of `gn gen $dir --check` requires all header files to be available on all 567 # platforms. 568 '<(V8_ROOT)/include/v8-wasm-trap-handler-posix.h', 569 '<(V8_ROOT)/include/v8-wasm-trap-handler-win.h', 570 ], 571 }, 572 }, # v8_headers 573 { 574 'target_name': 'v8_shared_internal_headers', 575 'type': 'none', 576 'conditions': [ 577 ['want_separate_host_toolset', { 578 'toolsets': ['host', 'target'], 579 }], 580 ], 581 'dependencies': [ 582 'v8_headers', 583 ], 584 'direct_dependent_settings': { 585 'sources': [ 586 '<(V8_ROOT)/src/common/globals.h', 587 ], 588 }, 589 }, # v8_shared_internal_headers 590 { 591 'target_name': 'v8_compiler_opt', 592 'type': 'static_library', 593 'dependencies': [ 594 'generate_bytecode_builtins_list', 595 'run_torque', 596 'v8_maybe_icu', 597 ], 598 'sources': ['<@(v8_compiler_sources)'], 599 'conditions': [ 600 ['want_separate_host_toolset', { 601 'toolsets': ['host', 'target'], 602 }], 603 ['OS=="win"', { 604 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 605 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 606 'sources': [ 607 '<(_msvs_precompiled_header)', 608 '<(_msvs_precompiled_source)', 609 ], 610 }], 611 ], 612 }, # v8_compiler_opt 613 { 614 'target_name': 'v8_compiler', 615 'type': 'static_library', 616 'dependencies': [ 617 'generate_bytecode_builtins_list', 618 'run_torque', 619 'v8_maybe_icu', 620 ], 621 'sources': ['<@(v8_compiler_sources)'], 622 'conditions': [ 623 ['want_separate_host_toolset', { 624 'toolsets': ['host', 'target'], 625 }], 626 ['OS=="win"', { 627 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 628 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 629 'sources': [ 630 '<(_msvs_precompiled_header)', 631 '<(_msvs_precompiled_source)', 632 ], 633 }], 634 ], 635 }, # v8_compiler 636 { 637 'target_name': 'v8_compiler_for_mksnapshot', 638 'type': 'none', 639 'hard_dependency': 1, 640 'dependencies': [ 641 'generate_bytecode_builtins_list', 642 'run_torque', 643 'v8_maybe_icu', 644 ], 645 'conditions': [ 646 ['want_separate_host_toolset', { 647 'toolsets': ['host', 'target'], 648 }], 649 ['is_component_build and not v8_optimized_debug and v8_enable_fast_mksnapshot', { 650 'dependencies': [ 651 'v8_compiler_opt', 652 ], 653 'export_dependent_settings': [ 654 'v8_compiler_opt', 655 ], 656 }, { 657 'dependencies': [ 658 'v8_compiler', 659 ], 660 'export_dependent_settings': [ 661 'v8_compiler', 662 ], 663 }], 664 ], 665 }, # v8_compiler_for_mksnapshot 666 { 667 'target_name': 'v8_base_without_compiler', 668 'type': 'static_library', 669 'dependencies': [ 670 # Code generators that only need to be build for the host. 671 'torque_generated_definitions', 672 'v8_headers', 673 'v8_libbase', 674 'v8_libsampler', 675 'v8_shared_internal_headers', 676 'v8_version', 677 # BUILD.gn public_deps 678 'generate_bytecode_builtins_list', 679 'run_torque', 680 'v8_maybe_icu', 681 ], 682 'includes': ['inspector.gypi'], 683 'direct_dependent_settings': { 684 'include_dirs': [ 685 '<(generate_bytecode_output_root)', 686 '<(torque_output_root)', 687 ], 688 }, 689 'sources': [ 690 # "//base/trace_event/common/trace_event_common.h", 691 692 ### gcmole(all) ### 693 '<(generate_bytecode_builtins_list_output)', 694 695 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?sources = ")', 696 697 '<@(inspector_all_sources)', 698 ], 699 'conditions': [ 700 ['want_separate_host_toolset', { 701 'toolsets': ['host', 'target'], 702 }], 703 ['v8_target_arch=="ia32"', { 704 'sources': [ ### gcmole(arch:ia32) ### 705 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x86.*?sources \+= ")', 706 ], 707 }], 708 ['v8_target_arch=="x64"', { 709 'sources': [ ### gcmole(arch:x64) ### 710 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64.*?sources \+= ")', 711 ], 712 'conditions': [ 713 # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both 714 # based on Darwin and thus POSIX-compliant to a similar degree. 715 ['OS=="linux" or OS=="mac" or OS=="ios"', { 716 'sources': [ 717 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_linux.*?sources \+= ")', 718 ], 719 }], 720 ['OS=="win"', { 721 'sources': [ 722 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_win.*?sources \+= ")', 723 ], 724 }], 725 ], 726 }], 727 ['v8_target_arch=="arm"', { 728 'sources': [ ### gcmole(arch:arm) ### 729 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"arm.*?sources \+= ")', 730 ], 731 }], 732 ['v8_target_arch=="arm64"', { 733 'sources': [ ### gcmole(arch:arm64) ### 734 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"arm64.*?sources \+= ")', 735 ], 736 }], 737 ['v8_target_arch=="mips" or v8_target_arch=="mipsel"', { 738 'sources': [ ### gcmole(arch:mipsel) ### 739 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"mips.*?sources \+= ")', 740 ], 741 }], 742 ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', { 743 'sources': [ ### gcmole(arch:mips64el) ### 744 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"mips64.*?sources \+= ")', 745 ], 746 }], 747 ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', { 748 'sources': [ ### gcmole(arch:ppc) ### 749 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"ppc.*?sources \+= ")', 750 ], 751 }], 752 ['v8_target_arch=="s390x"', { 753 'sources': [ ### gcmole(arch:s390) ### 754 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"s390.*?sources \+= ")', 755 ], 756 }], 757 ['OS=="win"', { 758 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', 759 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', 760 'sources': [ 761 '<(_msvs_precompiled_header)', 762 '<(_msvs_precompiled_source)', 763 ], 764 # This will prevent V8's .cc files conflicting with the inspector's 765 # .cpp files in the same shard. 766 'msvs_settings': { 767 'VCCLCompilerTool': { 768 'ObjectFile': '$(IntDir)%(Extension)\\', 769 }, 770 }, 771 }], 772 ['component=="shared_library"', { 773 'defines': [ 774 'BUILDING_V8_SHARED', 775 ], 776 }], 777 ['v8_enable_i18n_support', { 778 'dependencies': [ 779 'run_gen-regexp-special-case', 780 ], 781 'sources': [ 782 '<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc', 783 ], 784 'conditions': [ 785 ['icu_use_data_file_flag', { 786 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'], 787 }, { 788 'conditions': [ 789 ['OS=="win"', { 790 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'], 791 }, { 792 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'], 793 }], 794 ], 795 }], 796 ['OS=="win"', { 797 'dependencies': [ 798 '<(icu_gyp_path):icudata#target', 799 ], 800 }], 801 ], 802 }, { # v8_enable_i18n_support==0 803 'sources!': [ 804 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_i18n_support.*?sources -= ")', 805 ], 806 }], 807 ['v8_postmortem_support', { 808 'dependencies': ['postmortem-metadata#target'], 809 }], 810 # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library 811 # to implement atomic memory access 812 ['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm"]', { 813 'link_settings': { 814 'libraries': ['-latomic', ], 815 }, 816 }], 817 ], 818 }, # v8_base_without_compiler 819 { 820 'target_name': 'v8_base', 821 'type': 'none', 822 'conditions': [ 823 ['want_separate_host_toolset', { 824 'toolsets': ['host', 'target'], 825 }], 826 ], 827 'dependencies': [ 828 'v8_base_without_compiler', 829 'v8_compiler', 830 ], 831 }, # v8_base 832 { 833 'target_name': 'torque_base', 834 'type': 'static_library', 835 'conditions': [ 836 ['want_separate_host_toolset', { 837 'toolsets': ['host', 'target'], 838 }], 839 ], 840 'sources': [ 841 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"torque_base.*?sources = ")', 842 ], 843 'dependencies': [ 844 'v8_shared_internal_headers', 845 'v8_libbase', 846 ], 847 'defines!': [ 848 '_HAS_EXCEPTIONS=0', 849 'BUILDING_V8_SHARED=1', 850 ], 851 'cflags_cc!': ['-fno-exceptions'], 852 'cflags_cc': ['-fexceptions'], 853 'xcode_settings': { 854 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fexceptions 855 }, 856 'msvs_settings': { 857 'VCCLCompilerTool': { 858 'RuntimeTypeInfo': 'true', 859 'ExceptionHandling': 1, 860 }, 861 }, 862 }, # torque_base 863 { 864 'target_name': 'torque_ls_base', 865 'type': 'static_library', 866 'conditions': [ 867 ['want_separate_host_toolset', { 868 'toolsets': ['host', 'target'], 869 }], 870 ], 871 'sources': [ 872 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"torque_ls_base.*?sources = ")', 873 ], 874 'dependencies': [ 875 'torque_base', 876 ], 877 'defines!': [ 878 '_HAS_EXCEPTIONS=0', 879 'BUILDING_V8_SHARED=1', 880 ], 881 'cflags_cc!': ['-fno-exceptions'], 882 'cflags_cc': ['-fexceptions'], 883 'xcode_settings': { 884 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fexceptions 885 }, 886 'msvs_settings': { 887 'VCCLCompilerTool': { 888 'RuntimeTypeInfo': 'true', 889 'ExceptionHandling': 1, 890 }, 891 }, 892 }, # torque_ls_base 893 { 894 'target_name': 'v8_libbase', 895 'type': 'static_library', 896 'sources': [ 897 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_libbase.*?sources = ")', 898 ], 899 900 'dependencies': [ 901 'v8_headers', 902 ], 903 904 'conditions': [ 905 ['want_separate_host_toolset', { 906 'toolsets': ['host', 'target'], 907 }], 908 ['is_component_build', { 909 'defines': ["BUILDING_V8_BASE_SHARED"], 910 }], 911 ['is_posix or is_fuchsia', { 912 'sources': [ 913 '<(V8_ROOT)/src/base/platform/platform-posix.cc', 914 '<(V8_ROOT)/src/base/platform/platform-posix.h', 915 ], 916 'conditions': [ 917 ['OS != "aix" and OS != "solaris"', { 918 'sources': [ 919 '<(V8_ROOT)/src/base/platform/platform-posix-time.cc', 920 '<(V8_ROOT)/src/base/platform/platform-posix-time.h', 921 ], 922 }], 923 ], 924 }], 925 ['OS=="linux"', { 926 'sources': [ 927 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 928 '<(V8_ROOT)/src/base/platform/platform-linux.cc', 929 ], 930 'link_settings': { 931 'libraries': [ 932 '-ldl', 933 '-lrt' 934 ], 935 }, 936 }], 937 ['OS=="aix"', { 938 'variables': { 939 # Used to differentiate `AIX` and `OS400`(IBM i). 940 'aix_variant_name': '<!(uname -s)', 941 }, 942 'sources': [ 943 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 944 '<(V8_ROOT)/src/base/platform/platform-aix.cc', 945 ], 946 'conditions': [ 947 [ '"<(aix_variant_name)"=="AIX"', { # It is `AIX` 948 'link_settings': { 949 'libraries': [ 950 '-ldl', 951 '-lrt' 952 ], 953 }, 954 }], 955 ], 956 }], 957 ['is_android', { 958 'sources': [ 959 '<(V8_ROOT)/src/base/platform/platform-posix.cc', 960 '<(V8_ROOT)/src/base/platform/platform-posix.h', 961 '<(V8_ROOT)/src/base/platform/platform-posix-time.cc', 962 '<(V8_ROOT)/src/base/platform/platform-posix-time.h', 963 ], 964 'link_settings': { 965 'target_conditions': [ 966 ['_toolset=="host" and host_os=="linux"', { 967 'libraries': [ 968 '-ldl', 969 '-lrt' 970 ], 971 }], 972 ], 973 }, 974 'target_conditions': [ 975 ['_toolset=="host"', { 976 'sources': [ 977 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 978 '<(V8_ROOT)/src/base/platform/platform-linux.cc', 979 ], 980 }, { 981 'sources': [ 982 '<(V8_ROOT)/src/base/debug/stack_trace_android.cc', 983 '<(V8_ROOT)/src/base/platform/platform-linux.cc', 984 ], 985 }], 986 ], 987 }], 988 ['is_fuchsia', { 989 'sources': [ 990 '<(V8_ROOT)/src/base/debug/stack_trace_fuchsia.cc', 991 '<(V8_ROOT)/src/base/platform/platform-fuchsia.cc', 992 ] 993 }], 994 ['OS == "mac" or OS == "ios"', { 995 'sources': [ 996 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 997 '<(V8_ROOT)/src/base/platform/platform-macos.cc', 998 ] 999 }], 1000 ['is_win', { 1001 'sources': [ 1002 '<(V8_ROOT)/src/base/debug/stack_trace_win.cc', 1003 '<(V8_ROOT)/src/base/platform/platform-win32.cc', 1004 '<(V8_ROOT)/src/base/win32-headers.h', 1005 ], 1006 1007 'defines': ['_CRT_RAND_S'], # for rand_s() 1008 'direct_dependent_settings': { 1009 'msvs_settings': { 1010 'VCLinkerTool': { 1011 'AdditionalDependencies': [ 1012 'dbghelp.lib', 1013 'winmm.lib', 1014 'ws2_32.lib' 1015 ] 1016 } 1017 }, 1018 }, 1019 }], 1020 ['target_arch == "mips" or OS == "mips64"', { 1021 # here just for 'BUILD.gn' sync 1022 # 'data': [ 1023 # '<(V8_ROOT)/tools/mips_toolchain/sysroot/usr/lib/', 1024 # '<(V8_ROOT)/tools/mips_toolchain/sysroot/usr/lib/', 1025 # ], 1026 }], 1027 # end of conditions from 'BUILD.gn' 1028 1029 # Node.js validated 1030 ['OS=="solaris"', { 1031 'link_settings': { 1032 'libraries': [ 1033 '-lnsl', 1034 '-lrt', 1035 ] 1036 }, 1037 'sources': [ 1038 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 1039 '<(V8_ROOT)/src/base/platform/platform-solaris.cc', 1040 ], 1041 }], 1042 1043 # YMMV with the following conditions 1044 ['OS=="qnx"', { 1045 'link_settings': { 1046 'target_conditions': [ 1047 ['_toolset=="host" and host_os=="linux"', { 1048 'libraries': [ 1049 '-lrt' 1050 ], 1051 }], 1052 ['_toolset=="target"', { 1053 'libraries': [ 1054 '-lbacktrace' 1055 ], 1056 }], 1057 ], 1058 }, 1059 'sources': [ 1060 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 1061 '<(V8_ROOT)/src/base/platform/platform-posix.h', 1062 '<(V8_ROOT)/src/base/platform/platform-posix.cc', 1063 '<(V8_ROOT)/src/base/platform/platform-posix-time.h', 1064 '<(V8_ROOT)/src/base/platform/platform-posix-time.cc', 1065 '<(V8_ROOT)/src/base/qnx-math.h' 1066 ], 1067 'target_conditions': [ 1068 ['_toolset=="host" and host_os=="linux"', { 1069 'sources': [ 1070 '<(V8_ROOT)/src/base/platform/platform-linux.cc' 1071 ], 1072 }], 1073 ['_toolset=="host" and host_os=="mac"', { 1074 'sources': [ 1075 '<(V8_ROOT)/src/base/platform/platform-macos.cc' 1076 ], 1077 }], 1078 ['_toolset=="target"', { 1079 'sources': [ 1080 '<(V8_ROOT)/src/base/platform/platform-qnx.cc' 1081 ], 1082 }], 1083 ], 1084 }, 1085 ], 1086 ['OS=="freebsd"', { 1087 'link_settings': { 1088 'libraries': [ 1089 '-L/usr/local/lib -lexecinfo', 1090 ] 1091 }, 1092 'sources': [ 1093 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 1094 '<(V8_ROOT)/src/base/platform/platform-freebsd.cc', 1095 '<(V8_ROOT)/src/base/platform/platform-posix.h', 1096 '<(V8_ROOT)/src/base/platform/platform-posix.cc', 1097 '<(V8_ROOT)/src/base/platform/platform-posix-time.h', 1098 '<(V8_ROOT)/src/base/platform/platform-posix-time.cc', 1099 ], 1100 } 1101 ], 1102 ['OS=="openbsd"', { 1103 'link_settings': { 1104 'libraries': [ 1105 '-L/usr/local/lib -lexecinfo', 1106 ] 1107 }, 1108 'sources': [ 1109 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 1110 '<(V8_ROOT)/src/base/platform/platform-openbsd.cc', 1111 '<(V8_ROOT)/src/base/platform/platform-posix.h', 1112 '<(V8_ROOT)/src/base/platform/platform-posix.cc', 1113 '<(V8_ROOT)/src/base/platform/platform-posix-time.h', 1114 '<(V8_ROOT)/src/base/platform/platform-posix-time.cc', 1115 ], 1116 } 1117 ], 1118 ['OS=="netbsd"', { 1119 'link_settings': { 1120 'libraries': [ 1121 '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo', 1122 ] 1123 }, 1124 'sources': [ 1125 '<(V8_ROOT)/src/base/debug/stack_trace_posix.cc', 1126 '<(V8_ROOT)/src/base/platform/platform-openbsd.cc', 1127 '<(V8_ROOT)/src/base/platform/platform-posix.h', 1128 '<(V8_ROOT)/src/base/platform/platform-posix.cc', 1129 '<(V8_ROOT)/src/base/platform/platform-posix-time.h', 1130 '<(V8_ROOT)/src/base/platform/platform-posix-time.cc', 1131 ], 1132 } 1133 ], 1134 ], 1135 }, # v8_libbase 1136 { 1137 'target_name': 'v8_libplatform', 1138 'type': 'static_library', 1139 'dependencies': [ 1140 'v8_libbase', 1141 ], 1142 'sources': [ 1143 '<(V8_ROOT)/base/trace_event/common/trace_event_common.h', 1144 '<(V8_ROOT)/include/libplatform/libplatform-export.h', 1145 '<(V8_ROOT)/include/libplatform/libplatform.h', 1146 '<(V8_ROOT)/include/libplatform/v8-tracing.h', 1147 '<(V8_ROOT)/src/libplatform/default-foreground-task-runner.cc', 1148 '<(V8_ROOT)/src/libplatform/default-foreground-task-runner.h', 1149 '<(V8_ROOT)/src/libplatform/default-platform.cc', 1150 '<(V8_ROOT)/src/libplatform/default-platform.h', 1151 '<(V8_ROOT)/src/libplatform/default-worker-threads-task-runner.cc', 1152 '<(V8_ROOT)/src/libplatform/default-worker-threads-task-runner.h', 1153 '<(V8_ROOT)/src/libplatform/delayed-task-queue.cc', 1154 '<(V8_ROOT)/src/libplatform/delayed-task-queue.h', 1155 '<(V8_ROOT)/src/libplatform/task-queue.cc', 1156 '<(V8_ROOT)/src/libplatform/task-queue.h', 1157 '<(V8_ROOT)/src/libplatform/tracing/trace-buffer.cc', 1158 '<(V8_ROOT)/src/libplatform/tracing/trace-buffer.h', 1159 '<(V8_ROOT)/src/libplatform/tracing/trace-config.cc', 1160 '<(V8_ROOT)/src/libplatform/tracing/trace-object.cc', 1161 '<(V8_ROOT)/src/libplatform/tracing/trace-writer.cc', 1162 '<(V8_ROOT)/src/libplatform/tracing/trace-writer.h', 1163 '<(V8_ROOT)/src/libplatform/tracing/tracing-controller.cc', 1164 '<(V8_ROOT)/src/libplatform/worker-thread.cc', 1165 '<(V8_ROOT)/src/libplatform/worker-thread.h', 1166 ], 1167 'conditions': [ 1168 ['want_separate_host_toolset', { 1169 'toolsets': ['host', 'target'], 1170 }], 1171 ['component=="shared_library"', { 1172 'direct_dependent_settings': { 1173 'defines': ['USING_V8_PLATFORM_SHARED'], 1174 }, 1175 'defines': ['BUILDING_V8_PLATFORM_SHARED'], 1176 }], 1177 ['v8_use_perfetto', { 1178 'sources': [ 1179 '<(V8_ROOT)/src/libplatform/tracing/json-trace-event-listener.cc', 1180 '<(V8_ROOT)/src/libplatform/tracing/json-trace-event-listener.h', 1181 '<(V8_ROOT)/src/libplatform/tracing/trace-event-listener.cc', 1182 '<(V8_ROOT)/src/libplatform/tracing/trace-event-listener.h', 1183 ], 1184 'dependencies': [ 1185 '<(V8_ROOT)/third_party/perfetto:libperfetto', 1186 '<(V8_ROOT)/third_party/perfetto/protos/perfetto/trace:lite', 1187 ], 1188 }], 1189 ], 1190 'direct_dependent_settings': { 1191 'include_dirs': [ 1192 '<(V8_ROOT)/include', 1193 ], 1194 }, 1195 }, # v8_libplatform 1196 { 1197 'target_name': 'v8_libsampler', 1198 'type': 'static_library', 1199 'conditions': [ 1200 ['want_separate_host_toolset', { 1201 'toolsets': ['host', 'target'], 1202 }], 1203 ], 1204 'dependencies': [ 1205 'v8_libbase', 1206 ], 1207 'sources': [ 1208 '<(V8_ROOT)/src/libsampler/sampler.cc', 1209 '<(V8_ROOT)/src/libsampler/sampler.h' 1210 ], 1211 }, # v8_libsampler 1212 1213 # { 1214 # 'target_name': 'fuzzer_support', 1215 # 'type': 'static_library', 1216 # 'conditions': [ 1217 # ['want_separate_host_toolset', { 1218 # 'toolsets': ['host', 'target'], 1219 # }], 1220 # ], 1221 # 'dependencies': [ 1222 # 'v8', 1223 # 'v8_libbase', 1224 # 'v8_libplatform', 1225 # 'v8_maybe_icu', 1226 # ], 1227 # 'sources': [ 1228 # "<(V8_ROOT)/test/fuzzer/fuzzer-support.cc", 1229 # "<(V8_ROOT)/test/fuzzer/fuzzer-support.h", 1230 # ], 1231 # }, # fuzzer_support 1232 1233 # { 1234 # 'target_name': 'wee8', 1235 # 'type': 'static_library', 1236 # 'dependencies': [ 1237 # 'v8_base', 1238 # 'v8_libbase', 1239 # 'v8_libplatform', 1240 # 'v8_libsampler', 1241 # 'v8_maybe_snapshot', 1242 # # 'build/win:default_exe_manifest', 1243 # ], 1244 # 'sources': [ 1245 # "<(V8_ROOT)/src/wasm/c-api.cc", 1246 # "<(V8_ROOT)/third_party/wasm-api/wasm.h", 1247 # "<(V8_ROOT)/third_party/wasm-api/wasm.hh", 1248 # ], 1249 # }, # wee8 1250 1251 # ############################################################################### 1252 # # Executablesicu_path 1253 # # 1254 1255 { 1256 'target_name': 'bytecode_builtins_list_generator', 1257 'type': 'executable', 1258 'conditions': [ 1259 ['want_separate_host_toolset', { 1260 'toolsets': ['host'], 1261 }], 1262 ], 1263 'defines!': [ 1264 'BUILDING_V8_SHARED=1', 1265 ], 1266 'dependencies': [ 1267 "v8_libbase", 1268 # "build/win:default_exe_manifest", 1269 ], 1270 'sources': [ 1271 "<(V8_ROOT)/src/builtins/generate-bytecodes-builtins-list.cc", 1272 "<(V8_ROOT)/src/interpreter/bytecode-operands.cc", 1273 "<(V8_ROOT)/src/interpreter/bytecode-operands.h", 1274 "<(V8_ROOT)/src/interpreter/bytecodes.cc", 1275 "<(V8_ROOT)/src/interpreter/bytecodes.h", 1276 ], 1277 }, # bytecode_builtins_list_generator 1278 { 1279 'target_name': 'mksnapshot', 1280 'type': 'executable', 1281 'dependencies': [ 1282 'v8_base_without_compiler', 1283 'v8_compiler_for_mksnapshot', 1284 'v8_init', 1285 'v8_libbase', 1286 'v8_libplatform', 1287 'v8_nosnapshot', 1288 # "build/win:default_exe_manifest", 1289 'v8_maybe_icu', 1290 ], 1291 'sources': [ 1292 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"mksnapshot.*?sources = ")', 1293 ], 1294 'conditions': [ 1295 ['want_separate_host_toolset', { 1296 'toolsets': ['host'], 1297 }], 1298 ], 1299 }, # mksnapshot 1300 { 1301 'target_name': 'torque', 1302 'type': 'executable', 1303 'dependencies': [ 1304 'torque_base', 1305 # "build/win:default_exe_manifest", 1306 ], 1307 'conditions': [ 1308 ['want_separate_host_toolset', { 1309 'toolsets': ['host'], 1310 }], 1311 ], 1312 'defines!': [ 1313 '_HAS_EXCEPTIONS=0', 1314 'BUILDING_V8_SHARED=1', 1315 ], 1316 'cflags_cc!': ['-fno-exceptions'], 1317 'cflags_cc': ['-fexceptions'], 1318 'xcode_settings': { 1319 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fexceptions 1320 }, 1321 'msvs_settings': { 1322 'VCCLCompilerTool': { 1323 'RuntimeTypeInfo': 'true', 1324 'ExceptionHandling': 1, 1325 }, 1326 'VCLinkerTool': { 1327 'AdditionalDependencies': [ 1328 'dbghelp.lib', 1329 'winmm.lib', 1330 'ws2_32.lib' 1331 ] 1332 } 1333 }, 1334 'sources': [ 1335 "<(V8_ROOT)/src/torque/torque.cc", 1336 ], 1337 }, # torque 1338 { 1339 'target_name': 'torque-language-server', 1340 'type': 'executable', 1341 'conditions': [ 1342 ['want_separate_host_toolset', { 1343 'toolsets': ['host'], 1344 }], 1345 ], 1346 'dependencies': [ 1347 'torque_base', 1348 'torque_ls_base', 1349 # "build/win:default_exe_manifest", 1350 ], 1351 'defines!': [ 1352 '_HAS_EXCEPTIONS=0', 1353 'BUILDING_V8_SHARED=1', 1354 ], 1355 'msvs_settings': { 1356 'VCCLCompilerTool': { 1357 'RuntimeTypeInfo': 'true', 1358 'ExceptionHandling': 1, 1359 }, 1360 }, 1361 'sources': [ 1362 "<(V8_ROOT)/src/torque/ls/torque-language-server.cc", 1363 ], 1364 }, # torque-language-server 1365 { 1366 'target_name': 'gen-regexp-special-case', 1367 'type': 'executable', 1368 'dependencies': [ 1369 'v8_libbase', 1370 # "build/win:default_exe_manifest", 1371 'v8_maybe_icu', 1372 ], 1373 'conditions': [ 1374 ['want_separate_host_toolset', { 1375 'toolsets': ['host'], 1376 }], 1377 ], 1378 'sources': [ 1379 "<(V8_ROOT)/src/regexp/gen-regexp-special-case.cc", 1380 ], 1381 }, # gen-regexp-special-case 1382 { 1383 'target_name': 'run_gen-regexp-special-case', 1384 'type': 'none', 1385 'conditions': [ 1386 ['want_separate_host_toolset', { 1387 'dependencies': ['gen-regexp-special-case#host'], 1388 'toolsets': ['host', 'target'], 1389 }, { 1390 'dependencies': ['gen-regexp-special-case'], 1391 }], 1392 ], 1393 'actions': [ 1394 { 1395 'action_name': 'run_gen-regexp-special-case_action', 1396 'inputs': [ 1397 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)', 1398 ], 1399 'outputs': [ 1400 '<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc', 1401 ], 1402 'action': [ 1403 'python', 1404 '<(V8_ROOT)/tools/run.py', 1405 '<@(_inputs)', 1406 '<@(_outputs)', 1407 ], 1408 }, 1409 ], 1410 }, # run_gen-regexp-special-case 1411 1412 ############################################################################### 1413 # Public targets 1414 # 1415 1416 { 1417 'target_name': 'v8', 1418 'hard_dependency': 1, 1419 'toolsets': ['target'], 1420 'dependencies': [ 1421 'v8_maybe_snapshot' 1422 ], 1423 'conditions': [ 1424 ['component=="shared_library"', { 1425 'type': '<(component)', 1426 'sources': [ 1427 # Note: on non-Windows we still build this file so that gyp 1428 # has some sources to link into the component. 1429 '<(V8_ROOT)/src/utils/v8dll-main.cc', 1430 ], 1431 'defines': [ 1432 'BUILDING_V8_SHARED', 1433 ], 1434 'direct_dependent_settings': { 1435 'defines': [ 1436 'USING_V8_SHARED', 1437 ], 1438 }, 1439 'conditions': [ 1440 ['OS=="mac"', { 1441 'xcode_settings': { 1442 'OTHER_LDFLAGS': ['-dynamiclib', '-all_load'] 1443 }, 1444 }], 1445 ['soname_version!=""', { 1446 'product_extension': 'so.<(soname_version)', 1447 }], 1448 ], 1449 }, 1450 { 1451 'type': 'static_library', 1452 }], 1453 ], 1454 'direct_dependent_settings': { 1455 'include_dirs': [ 1456 '<(V8_ROOT)/include', 1457 ], 1458 }, 1459 'actions': [ 1460 { 1461 'action_name': 'v8_dump_build_config', 1462 'inputs': [ 1463 '<(V8_ROOT)/tools/testrunner/utils/dump_build_config_gyp.py', 1464 ], 1465 'outputs': [ 1466 '<(PRODUCT_DIR)/v8_build_config.json', 1467 ], 1468 'variables': { 1469 'v8_dump_build_config_args': [ 1470 '<(PRODUCT_DIR)/v8_build_config.json', 1471 'dcheck_always_on=<(dcheck_always_on)', 1472 'is_android=<(is_android)', 1473 'is_asan=<(asan)', 1474 'is_cfi=<(cfi_vptr)', 1475 'is_clang=<(clang)', 1476 'is_component_build=<(component)', 1477 'is_debug=<(CONFIGURATION_NAME)', 1478 # Not available in gyp. 1479 'is_gcov_coverage=0', 1480 'is_msan=<(msan)', 1481 'is_tsan=<(tsan)', 1482 # Not available in gyp. 1483 'is_ubsan_vptr=0', 1484 'target_cpu=<(target_arch)', 1485 'v8_enable_i18n_support=<(v8_enable_i18n_support)', 1486 'v8_enable_verify_predictable=<(v8_enable_verify_predictable)', 1487 'v8_target_cpu=<(v8_target_arch)', 1488 'v8_use_snapshot=<(v8_use_snapshot)', 1489 'v8_use_siphash=<(v8_use_siphash)', 1490 'v8_enable_embedded_builtins=<(v8_enable_embedded_builtins)', 1491 'v8_enable_verify_csa=<(v8_enable_verify_csa)', 1492 'v8_enable_lite_mode=<(v8_enable_lite_mode)', 1493 'v8_enable_pointer_compression=<(v8_enable_pointer_compression)', 1494 ] 1495 }, 1496 'conditions': [ 1497 ['v8_target_arch=="mips" or v8_target_arch=="mipsel" \ 1498 or v8_target_arch=="mips64" or v8_target_arch=="mips64el"', { 1499 'v8_dump_build_config_args': [ 1500 'mips_arch_variant=<(mips_arch_variant)', 1501 'mips_use_msa=<(mips_use_msa)', 1502 ], 1503 }], 1504 ], 1505 'action': [ 1506 'python', '<(V8_ROOT)/tools/testrunner/utils/dump_build_config_gyp.py', 1507 '<@(v8_dump_build_config_args)', 1508 ], 1509 }, 1510 ], 1511 }, # v8 1512 # missing a bunch of fuzzer targets 1513 1514 ############################################################################### 1515 # Protobuf targets, used only when building outside of chromium. 1516 # 1517 1518 { 1519 'target_name': 'postmortem-metadata', 1520 'type': 'none', 1521 'conditions': [ 1522 ['want_separate_host_toolset', { 1523 'toolsets': ['host', 'target'], 1524 }], 1525 ], 1526 'variables': { 1527 'heapobject_files': [ 1528 '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"postmortem-metadata.*?sources = ")', 1529 ], 1530 }, 1531 'actions': [ 1532 { 1533 'action_name': 'gen-postmortem-metadata', 1534 'inputs': [ 1535 '<(V8_ROOT)/tools/gen-postmortem-metadata.py', 1536 '<@(heapobject_files)', 1537 ], 1538 'outputs': [ 1539 '<(SHARED_INTERMEDIATE_DIR)/debug-support.cc', 1540 ], 1541 'action': [ 1542 'python', 1543 '<(V8_ROOT)/tools/gen-postmortem-metadata.py', 1544 '<@(_outputs)', 1545 '<@(heapobject_files)' 1546 ], 1547 }, 1548 ], 1549 'direct_dependent_settings': { 1550 'sources': ['<(SHARED_INTERMEDIATE_DIR)/debug-support.cc', ], 1551 }, 1552 }, # postmortem-metadata 1553 ], 1554} 1555