2016-05-24 08:54:42 +00:00
|
|
|
# Copyright 2016 the V8 project authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2020-07-02 18:24:48 +00:00
|
|
|
import("//build/config/gclient_args.gni")
|
2016-06-21 23:35:19 +00:00
|
|
|
import("//build/config/sanitizers/sanitizers.gni")
|
2016-07-15 22:32:55 +00:00
|
|
|
import("//build/config/v8_target_cpu.gni")
|
2022-01-20 10:29:27 +00:00
|
|
|
import("release_branch_toggle.gni")
|
2022-02-01 13:09:42 +00:00
|
|
|
import("split_static_library.gni")
|
2016-05-24 10:39:57 +00:00
|
|
|
|
2016-05-24 08:54:42 +00:00
|
|
|
declare_args() {
|
2017-06-27 11:49:13 +00:00
|
|
|
# Set flags for tracking code coverage. Uses gcov with gcc and sanitizer
|
|
|
|
# coverage with clang.
|
|
|
|
v8_code_coverage = false
|
|
|
|
|
2017-01-10 10:19:21 +00:00
|
|
|
# Includes files needed for correctness fuzzing.
|
|
|
|
v8_correctness_fuzzer = false
|
|
|
|
|
2017-02-02 11:32:52 +00:00
|
|
|
# Adds additional compile target for building multiple architectures at once.
|
|
|
|
v8_multi_arch_build = false
|
|
|
|
|
2016-06-30 08:58:09 +00:00
|
|
|
# Indicate if valgrind was fetched as a custom deps to make it available on
|
|
|
|
# swarming.
|
|
|
|
v8_has_valgrind = false
|
|
|
|
|
2016-07-04 07:52:08 +00:00
|
|
|
# Indicate if gcmole was fetched as a hook to make it available on swarming.
|
|
|
|
v8_gcmole = false
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
# Turns on compiler optimizations in V8 in Debug build.
|
|
|
|
v8_optimized_debug = true
|
|
|
|
|
2016-07-20 12:52:27 +00:00
|
|
|
# Support for backtrace_symbols on linux.
|
|
|
|
v8_enable_backtrace = ""
|
|
|
|
|
2016-06-03 08:16:50 +00:00
|
|
|
# Use external files for startup data blobs:
|
|
|
|
# the JS builtins sources and the start snapshot.
|
2016-07-06 15:14:07 +00:00
|
|
|
v8_use_external_startup_data = ""
|
2016-11-14 10:00:58 +00:00
|
|
|
|
|
|
|
# Enable ECMAScript Internationalization API. Enabling this feature will
|
|
|
|
# add a dependency on the ICU library.
|
|
|
|
v8_enable_i18n_support = true
|
2016-11-21 19:29:02 +00:00
|
|
|
|
2017-01-25 00:20:56 +00:00
|
|
|
# Use static libraries instead of source_sets.
|
|
|
|
v8_static_library = false
|
2018-01-05 15:39:29 +00:00
|
|
|
|
|
|
|
# Enable monolithic static library for embedders.
|
|
|
|
v8_monolithic = false
|
2019-02-13 12:51:56 +00:00
|
|
|
|
|
|
|
# Expose symbols for dynamic linking.
|
|
|
|
v8_expose_symbols = false
|
2019-05-27 12:46:35 +00:00
|
|
|
|
2020-04-17 20:46:18 +00:00
|
|
|
# Implement tracing using Perfetto (https://perfetto.dev).
|
2019-05-27 12:46:35 +00:00
|
|
|
v8_use_perfetto = false
|
2020-02-13 01:00:59 +00:00
|
|
|
|
2020-06-02 10:14:03 +00:00
|
|
|
# Override global symbol level setting for v8.
|
2020-02-13 01:00:59 +00:00
|
|
|
v8_symbol_level = symbol_level
|
2020-02-17 05:01:29 +00:00
|
|
|
|
|
|
|
# Enable WebAssembly debugging via GDB-remote protocol.
|
|
|
|
v8_enable_wasm_gdb_remote_debugging = false
|
2020-06-02 10:14:03 +00:00
|
|
|
|
2021-02-23 12:43:57 +00:00
|
|
|
# Lite mode disables a number of performance optimizations to reduce memory
|
|
|
|
# at the cost of performance.
|
|
|
|
# Sets -DV8_LITE_MODE.
|
|
|
|
v8_enable_lite_mode = false
|
|
|
|
|
[turbofan] Add the v8_enable_turbofan build option
When disabled, Turbofan is fully excluded from the compilation result.
This is expected to reduce V8's contribution to chromium's binary size
by roughly 20%.
If Turbofan is disabled, Maglev and Webassembly must also be disabled
(since both depend on TF).
Note this new configuration (v8_enable_turbofan=false) is not yet
used anywhere - we'll probably enable it for lite_mode bots in an
upcoming CL for test coverage.
Changes in detail:
- Split out all src/compiler files from the main source sets. This
was mostly done already, here we only clean up the few files that
were left.
- Define a new main TF entry point in turbofan.h. `NewCompilationJob`
replaces `Pipeline::NewCompilationJob`.
- When TF is enabled, turbofan-enabled.cc implements the above.
- When disabled, turbofan-disabled stubs out the above with a runtime
FATAL message.
- The build process is modified s.t. mksnapshot always has TF
available since it's needed to generate builtins. When disabled,
TF is removed from other components, in particular it is no longer
included in v8_compiler and transitively in v8_base.
- When disabled, v8_for_testing no longer has v8_initializers
available. These were only needed for test-serialize.cc, which
is now excluded from this build mode.
- When disabled, remove all related cctest/ und unittest/ files from
the build.
Bug: v8:13629
Change-Id: I63ab7632f03d0ee4a787cfc01574b5fdb08fd80b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4128529
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85210}
2023-01-11 10:08:53 +00:00
|
|
|
# Enable the Turbofan compiler.
|
|
|
|
# Sets -dV8_ENABLE_TURBOFAN.
|
|
|
|
v8_enable_turbofan = ""
|
|
|
|
|
|
|
|
# Enable the Maglev compiler.
|
|
|
|
# Sets -dV8_ENABLE_MAGLEV
|
|
|
|
v8_enable_maglev = ""
|
|
|
|
|
2021-02-22 13:28:17 +00:00
|
|
|
# Include support for WebAssembly. If disabled, the 'WebAssembly' global
|
|
|
|
# will not be available, and embedder APIs to generate WebAssembly modules
|
|
|
|
# will fail. Also, asm.js will not be translated to WebAssembly and will be
|
|
|
|
# executed as standard JavaScript instead.
|
[turbofan] Add the v8_enable_turbofan build option
When disabled, Turbofan is fully excluded from the compilation result.
This is expected to reduce V8's contribution to chromium's binary size
by roughly 20%.
If Turbofan is disabled, Maglev and Webassembly must also be disabled
(since both depend on TF).
Note this new configuration (v8_enable_turbofan=false) is not yet
used anywhere - we'll probably enable it for lite_mode bots in an
upcoming CL for test coverage.
Changes in detail:
- Split out all src/compiler files from the main source sets. This
was mostly done already, here we only clean up the few files that
were left.
- Define a new main TF entry point in turbofan.h. `NewCompilationJob`
replaces `Pipeline::NewCompilationJob`.
- When TF is enabled, turbofan-enabled.cc implements the above.
- When disabled, turbofan-disabled stubs out the above with a runtime
FATAL message.
- The build process is modified s.t. mksnapshot always has TF
available since it's needed to generate builtins. When disabled,
TF is removed from other components, in particular it is no longer
included in v8_compiler and transitively in v8_base.
- When disabled, v8_for_testing no longer has v8_initializers
available. These were only needed for test-serialize.cc, which
is now excluded from this build mode.
- When disabled, remove all related cctest/ und unittest/ files from
the build.
Bug: v8:13629
Change-Id: I63ab7632f03d0ee4a787cfc01574b5fdb08fd80b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4128529
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85210}
2023-01-11 10:08:53 +00:00
|
|
|
# Sets -dV8_ENABLE_WEBASSEMBLY.
|
2021-02-23 12:43:57 +00:00
|
|
|
v8_enable_webassembly = ""
|
2021-02-22 13:28:17 +00:00
|
|
|
|
2022-06-06 09:29:40 +00:00
|
|
|
# Enable 256-bit long vector re-vectorization pass in WASM compilation pipeline.
|
|
|
|
v8_enable_wasm_simd256_revec = false
|
|
|
|
|
2021-04-12 14:38:06 +00:00
|
|
|
# Enable runtime call stats.
|
2022-01-20 10:29:27 +00:00
|
|
|
v8_enable_runtime_call_stats = !is_on_release_branch
|
2021-04-12 14:38:06 +00:00
|
|
|
|
2020-06-02 10:14:03 +00:00
|
|
|
# Add fuzzilli fuzzer support.
|
|
|
|
v8_fuzzilli = false
|
2020-07-02 18:24:48 +00:00
|
|
|
|
2020-08-28 20:48:41 +00:00
|
|
|
# Scan the call stack conservatively during garbage collection.
|
|
|
|
v8_enable_conservative_stack_scanning = false
|
|
|
|
|
2022-06-21 18:51:34 +00:00
|
|
|
# Use the object start bitmap for inner pointer resolution.
|
|
|
|
v8_enable_inner_pointer_resolution_osb = false
|
|
|
|
|
2022-06-27 14:25:17 +00:00
|
|
|
# Use the marking bitmap for inner pointer resolution.
|
|
|
|
v8_enable_inner_pointer_resolution_mb = false
|
|
|
|
|
2021-04-21 09:04:33 +00:00
|
|
|
v8_enable_google_benchmark = false
|
2020-11-24 02:11:37 +00:00
|
|
|
|
|
|
|
cppgc_is_standalone = false
|
2021-07-05 13:56:10 +00:00
|
|
|
|
2022-02-16 13:58:49 +00:00
|
|
|
# Enable object names in cppgc for debug purposes.
|
|
|
|
cppgc_enable_object_names = false
|
|
|
|
|
2022-02-01 13:09:42 +00:00
|
|
|
# Enable young generation in cppgc.
|
|
|
|
cppgc_enable_young_generation = false
|
|
|
|
|
2023-01-11 13:12:51 +00:00
|
|
|
# Enables a slim write barrier that only performs a single check in the fast
|
|
|
|
# path and delegates all further checks to a slow path call. This is fast
|
|
|
|
# in a setting with few slow-path checks, i.e., with disabled young generation
|
|
|
|
# GC.
|
|
|
|
cppgc_enable_slim_write_barrier = true
|
|
|
|
|
2022-05-12 13:54:22 +00:00
|
|
|
# Enable pointer compression in cppgc.
|
|
|
|
cppgc_enable_pointer_compression = false
|
|
|
|
|
2022-08-30 14:52:38 +00:00
|
|
|
# Enable 2gb cage for fast compression/decompression. Currently disabled
|
|
|
|
# due to an increased number of OOMs.
|
|
|
|
cppgc_enable_2gb_cage = false
|
|
|
|
|
2021-07-05 13:56:10 +00:00
|
|
|
# Enable advanced BigInt algorithms, costing about 10-30 KB binary size
|
|
|
|
# depending on platform. Disabled on Android to save binary size.
|
|
|
|
v8_advanced_bigint_algorithms = !is_android
|
2022-12-01 17:02:12 +00:00
|
|
|
|
|
|
|
# TODO: macros for determining endian type are clang specific.
|
|
|
|
v8_use_libm_trig_functions = is_clang
|
2016-07-06 15:14:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (v8_use_external_startup_data == "") {
|
|
|
|
# If not specified as a gn arg, use external startup data by default if
|
2019-10-15 06:51:14 +00:00
|
|
|
# we're not on ios.
|
|
|
|
v8_use_external_startup_data = !is_ios
|
2016-05-24 10:39:57 +00:00
|
|
|
}
|
2016-06-14 10:07:22 +00:00
|
|
|
|
2016-07-20 12:52:27 +00:00
|
|
|
if (v8_enable_backtrace == "") {
|
2016-07-22 18:13:08 +00:00
|
|
|
v8_enable_backtrace = is_debug && !v8_optimized_debug
|
2016-07-20 12:52:27 +00:00
|
|
|
}
|
|
|
|
|
2020-05-05 17:13:11 +00:00
|
|
|
# If chromium is configured to use the perfetto client library, v8 should also
|
|
|
|
# use perfetto for tracing.
|
|
|
|
if (build_with_chromium && use_perfetto_client_library) {
|
|
|
|
v8_use_perfetto = true
|
|
|
|
}
|
|
|
|
|
2021-02-23 12:43:57 +00:00
|
|
|
# WebAssembly is enabled by default, except in lite mode.
|
|
|
|
if (v8_enable_webassembly == "") {
|
|
|
|
v8_enable_webassembly = !v8_enable_lite_mode
|
|
|
|
}
|
|
|
|
assert(!(v8_enable_webassembly && v8_enable_lite_mode),
|
|
|
|
"Webassembly is not available in lite mode.")
|
|
|
|
|
2023-01-11 08:03:55 +00:00
|
|
|
# Turbofan is enabled by default, except in lite mode.
|
[turbofan] Add the v8_enable_turbofan build option
When disabled, Turbofan is fully excluded from the compilation result.
This is expected to reduce V8's contribution to chromium's binary size
by roughly 20%.
If Turbofan is disabled, Maglev and Webassembly must also be disabled
(since both depend on TF).
Note this new configuration (v8_enable_turbofan=false) is not yet
used anywhere - we'll probably enable it for lite_mode bots in an
upcoming CL for test coverage.
Changes in detail:
- Split out all src/compiler files from the main source sets. This
was mostly done already, here we only clean up the few files that
were left.
- Define a new main TF entry point in turbofan.h. `NewCompilationJob`
replaces `Pipeline::NewCompilationJob`.
- When TF is enabled, turbofan-enabled.cc implements the above.
- When disabled, turbofan-disabled stubs out the above with a runtime
FATAL message.
- The build process is modified s.t. mksnapshot always has TF
available since it's needed to generate builtins. When disabled,
TF is removed from other components, in particular it is no longer
included in v8_compiler and transitively in v8_base.
- When disabled, v8_for_testing no longer has v8_initializers
available. These were only needed for test-serialize.cc, which
is now excluded from this build mode.
- When disabled, remove all related cctest/ und unittest/ files from
the build.
Bug: v8:13629
Change-Id: I63ab7632f03d0ee4a787cfc01574b5fdb08fd80b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4128529
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85210}
2023-01-11 10:08:53 +00:00
|
|
|
if (v8_enable_turbofan == "") {
|
2023-01-11 08:03:55 +00:00
|
|
|
v8_enable_turbofan = !v8_enable_lite_mode
|
[turbofan] Add the v8_enable_turbofan build option
When disabled, Turbofan is fully excluded from the compilation result.
This is expected to reduce V8's contribution to chromium's binary size
by roughly 20%.
If Turbofan is disabled, Maglev and Webassembly must also be disabled
(since both depend on TF).
Note this new configuration (v8_enable_turbofan=false) is not yet
used anywhere - we'll probably enable it for lite_mode bots in an
upcoming CL for test coverage.
Changes in detail:
- Split out all src/compiler files from the main source sets. This
was mostly done already, here we only clean up the few files that
were left.
- Define a new main TF entry point in turbofan.h. `NewCompilationJob`
replaces `Pipeline::NewCompilationJob`.
- When TF is enabled, turbofan-enabled.cc implements the above.
- When disabled, turbofan-disabled stubs out the above with a runtime
FATAL message.
- The build process is modified s.t. mksnapshot always has TF
available since it's needed to generate builtins. When disabled,
TF is removed from other components, in particular it is no longer
included in v8_compiler and transitively in v8_base.
- When disabled, v8_for_testing no longer has v8_initializers
available. These were only needed for test-serialize.cc, which
is now excluded from this build mode.
- When disabled, remove all related cctest/ und unittest/ files from
the build.
Bug: v8:13629
Change-Id: I63ab7632f03d0ee4a787cfc01574b5fdb08fd80b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4128529
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85210}
2023-01-11 10:08:53 +00:00
|
|
|
}
|
|
|
|
assert(v8_enable_turbofan || !v8_enable_webassembly,
|
|
|
|
"Webassembly is not available when Turbofan is disabled.")
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
# Points to // in v8 stand-alone or to //v8/ in chromium. We need absolute
|
|
|
|
# paths for all configs in templates as they are shared in different
|
|
|
|
# subdirectories.
|
2016-07-20 09:16:27 +00:00
|
|
|
v8_path_prefix = get_path_info("../", "abspath")
|
2016-06-14 10:07:22 +00:00
|
|
|
|
2019-02-26 22:09:46 +00:00
|
|
|
v8_inspector_js_protocol = v8_path_prefix + "/include/js_protocol.pdl"
|
2016-10-12 14:10:57 +00:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Templates
|
|
|
|
#
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
# Common configs to remove or add in all v8 targets.
|
2017-03-17 15:18:18 +00:00
|
|
|
v8_remove_configs = []
|
2016-07-20 09:16:27 +00:00
|
|
|
v8_add_configs = [
|
|
|
|
v8_path_prefix + ":features",
|
|
|
|
v8_path_prefix + ":toolchain",
|
2016-06-14 10:07:22 +00:00
|
|
|
]
|
|
|
|
|
2019-04-02 14:35:58 +00:00
|
|
|
if (is_debug && !v8_optimized_debug) {
|
|
|
|
v8_remove_configs += [ "//build/config/compiler:default_optimization" ]
|
|
|
|
v8_add_configs += [ "//build/config/compiler:no_optimize" ]
|
|
|
|
} else {
|
|
|
|
v8_remove_configs += [ "//build/config/compiler:default_optimization" ]
|
|
|
|
|
|
|
|
# TODO(crbug.com/621335) Rework this so that we don't have the confusion
|
|
|
|
# between "optimize_speed" and "optimize_max".
|
2022-08-30 14:52:38 +00:00
|
|
|
if (is_posix && !is_android && !using_sanitizer) {
|
2019-04-02 14:35:58 +00:00
|
|
|
v8_add_configs += [ "//build/config/compiler:optimize_speed" ]
|
|
|
|
} else {
|
|
|
|
v8_add_configs += [ "//build/config/compiler:optimize_max" ]
|
|
|
|
}
|
|
|
|
}
|
2016-06-14 10:07:22 +00:00
|
|
|
|
2020-03-06 13:56:06 +00:00
|
|
|
if (!is_debug) {
|
|
|
|
v8_remove_configs += [
|
|
|
|
# Too much performance impact, unclear security benefit.
|
|
|
|
"//build/config/compiler:default_init_stack_vars",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-06-27 11:49:13 +00:00
|
|
|
if (v8_code_coverage && !is_clang) {
|
|
|
|
v8_add_configs += [
|
|
|
|
v8_path_prefix + ":v8_gcov_coverage_cflags",
|
|
|
|
v8_path_prefix + ":v8_gcov_coverage_ldflags",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-02-13 01:00:59 +00:00
|
|
|
if (v8_symbol_level != symbol_level) {
|
|
|
|
v8_remove_configs += [ "//build/config/compiler:default_symbols" ]
|
|
|
|
if (v8_symbol_level == 0) {
|
|
|
|
v8_add_configs += [ "//build/config/compiler:no_symbols" ]
|
|
|
|
} else if (v8_symbol_level == 1) {
|
|
|
|
v8_add_configs += [ "//build/config/compiler:minimal_symbols" ]
|
|
|
|
} else if (v8_symbol_level == 2) {
|
|
|
|
v8_add_configs += [ "//build/config/compiler:symbols" ]
|
|
|
|
} else {
|
|
|
|
assert(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-13 12:51:56 +00:00
|
|
|
if ((is_posix || is_fuchsia) &&
|
|
|
|
(v8_enable_backtrace || v8_monolithic || v8_expose_symbols)) {
|
2016-07-20 12:52:27 +00:00
|
|
|
v8_remove_configs += [ "//build/config/gcc:symbol_visibility_hidden" ]
|
|
|
|
v8_add_configs += [ "//build/config/gcc:symbol_visibility_default" ]
|
|
|
|
}
|
|
|
|
|
2018-01-29 09:56:47 +00:00
|
|
|
# On MIPS gcc_target_rpath and ldso_path might be needed for all builds.
|
2022-09-08 11:39:11 +00:00
|
|
|
if (target_cpu == "mips64el" || target_cpu == "mips64") {
|
2018-01-29 09:56:47 +00:00
|
|
|
v8_add_configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
|
|
|
|
}
|
|
|
|
|
2018-04-06 12:30:02 +00:00
|
|
|
if (!build_with_chromium && is_clang) {
|
|
|
|
v8_remove_configs += [ "//build/config/clang:find_bad_constructs" ]
|
|
|
|
}
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
# All templates should be kept in sync.
|
|
|
|
template("v8_source_set") {
|
2017-06-13 14:21:07 +00:00
|
|
|
if (defined(invoker.split_count) && invoker.split_count > 1 &&
|
|
|
|
defined(v8_static_library) && v8_static_library && is_win) {
|
2019-10-29 09:29:15 +00:00
|
|
|
link_target_type = "split_static_library"
|
2017-06-13 14:21:07 +00:00
|
|
|
} else if (defined(v8_static_library) && v8_static_library) {
|
2019-10-30 10:20:26 +00:00
|
|
|
link_target_type = "static_library"
|
2016-11-28 10:41:47 +00:00
|
|
|
} else {
|
2019-10-30 10:20:26 +00:00
|
|
|
link_target_type = "source_set"
|
2017-06-13 14:21:07 +00:00
|
|
|
}
|
|
|
|
target(link_target_type, target_name) {
|
2018-10-10 09:58:16 +00:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
"*",
|
|
|
|
[
|
|
|
|
"configs",
|
|
|
|
"remove_configs",
|
|
|
|
])
|
2019-04-09 12:34:36 +00:00
|
|
|
configs -= v8_remove_configs
|
|
|
|
configs += v8_add_configs
|
2018-10-10 09:58:16 +00:00
|
|
|
if (defined(invoker.remove_configs)) {
|
|
|
|
configs -= invoker.remove_configs
|
|
|
|
}
|
2017-06-13 14:21:07 +00:00
|
|
|
configs += invoker.configs
|
2016-06-14 10:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-09 13:28:10 +00:00
|
|
|
template("v8_header_set") {
|
2019-10-30 10:20:26 +00:00
|
|
|
source_set(target_name) {
|
2017-02-09 13:28:10 +00:00
|
|
|
forward_variables_from(invoker, "*", [ "configs" ])
|
|
|
|
configs -= v8_remove_configs
|
|
|
|
configs += v8_add_configs
|
2019-04-09 12:34:36 +00:00
|
|
|
configs += invoker.configs
|
2017-02-09 13:28:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
template("v8_executable") {
|
|
|
|
executable(target_name) {
|
2016-10-12 09:59:31 +00:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
"*",
|
|
|
|
[
|
|
|
|
"configs",
|
|
|
|
"remove_configs",
|
|
|
|
])
|
2019-04-09 12:34:36 +00:00
|
|
|
configs -= v8_remove_configs
|
|
|
|
configs += v8_add_configs
|
2016-10-12 09:59:31 +00:00
|
|
|
if (defined(invoker.remove_configs)) {
|
|
|
|
configs -= invoker.remove_configs
|
|
|
|
}
|
2016-06-14 10:07:22 +00:00
|
|
|
configs += invoker.configs
|
2020-09-11 08:11:42 +00:00
|
|
|
if (is_linux || is_chromeos) {
|
2016-07-27 11:43:42 +00:00
|
|
|
# For enabling ASLR.
|
|
|
|
ldflags = [ "-pie" ]
|
2016-07-15 14:53:57 +00:00
|
|
|
}
|
2017-06-27 11:49:13 +00:00
|
|
|
if (defined(testonly) && testonly && v8_code_coverage) {
|
2017-06-26 11:06:03 +00:00
|
|
|
# Only add code coverage cflags for non-test files for performance
|
|
|
|
# reasons.
|
2017-06-27 11:49:13 +00:00
|
|
|
if (is_clang) {
|
|
|
|
configs -= [ "//build/config/sanitizers:default_sanitizer_flags" ]
|
2017-08-09 08:11:21 +00:00
|
|
|
configs +=
|
|
|
|
[ "//build/config/sanitizers:default_sanitizer_flags_but_coverage" ]
|
2017-06-27 11:49:13 +00:00
|
|
|
} else {
|
|
|
|
configs -= [ v8_path_prefix + ":v8_gcov_coverage_cflags" ]
|
|
|
|
}
|
2017-06-26 11:06:03 +00:00
|
|
|
}
|
2017-08-09 08:11:21 +00:00
|
|
|
deps += [ v8_path_prefix + ":v8_dump_build_config" ]
|
2016-06-14 10:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template("v8_component") {
|
|
|
|
component(target_name) {
|
2023-01-26 10:55:18 +00:00
|
|
|
output_name = target_name
|
2019-09-19 20:23:39 +00:00
|
|
|
forward_variables_from(invoker,
|
|
|
|
"*",
|
|
|
|
[
|
|
|
|
"configs",
|
|
|
|
"remove_configs",
|
|
|
|
])
|
2016-07-20 09:16:27 +00:00
|
|
|
configs -= v8_remove_configs
|
|
|
|
configs += v8_add_configs
|
2019-09-19 20:23:39 +00:00
|
|
|
if (defined(invoker.remove_configs)) {
|
|
|
|
configs -= invoker.remove_configs
|
|
|
|
}
|
2019-04-09 12:34:36 +00:00
|
|
|
configs += invoker.configs
|
2016-06-14 10:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
2017-11-27 09:36:01 +00:00
|
|
|
|
2020-02-11 22:45:54 +00:00
|
|
|
template("v8_shared_library") {
|
|
|
|
shared_library(target_name) {
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
"*",
|
|
|
|
[
|
|
|
|
"configs",
|
|
|
|
"remove_configs",
|
|
|
|
])
|
|
|
|
configs -= v8_remove_configs
|
|
|
|
configs += v8_add_configs
|
|
|
|
if (defined(invoker.remove_configs)) {
|
|
|
|
configs -= invoker.remove_configs
|
|
|
|
}
|
|
|
|
if (defined(invoker.configs)) {
|
|
|
|
configs += invoker.configs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-27 09:36:01 +00:00
|
|
|
template("v8_static_library") {
|
|
|
|
static_library(target_name) {
|
|
|
|
complete_static_lib = true
|
|
|
|
forward_variables_from(invoker, "*", [ "configs" ])
|
|
|
|
configs -= v8_remove_configs
|
2018-03-21 00:18:34 +00:00
|
|
|
configs -= [ "//build/config/compiler:thin_archive" ]
|
2017-11-27 09:36:01 +00:00
|
|
|
configs += v8_add_configs
|
2019-04-09 12:34:36 +00:00
|
|
|
configs += invoker.configs
|
2017-11-27 09:36:01 +00:00
|
|
|
}
|
|
|
|
}
|