From 925ed598e338df20afdcfb8f49bff8beedae0359 Mon Sep 17 00:00:00 2001 From: Yang Guo Date: Mon, 27 Nov 2017 10:36:01 +0100 Subject: [PATCH] [gn] Add v8_monolith static library target. R=machenbach@chromium.org Bug: v8:6105 Change-Id: I51d7d38897d1b20469304345d11228a8f78d3489 Reviewed-on: https://chromium-review.googlesource.com/788376 Commit-Queue: Yang Guo Reviewed-by: Michael Achenbach Cr-Commit-Position: refs/heads/master@{#49627} --- BUILD.gn | 26 ++++++++++++++++++++++++++ gni/v8.gni | 10 ++++++++++ 2 files changed, 36 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 0f9f43605e..62e96e36c9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -132,6 +132,8 @@ declare_args() { # Temporary flag to allow embedders to update their microtasks scopes # while rolling in a new version of V8. v8_check_microtasks_scopes_consistency = "" + + v8_monolithic = false } # Derived defaults. @@ -2680,6 +2682,30 @@ v8_source_set("fuzzer_support") { ] } +############################################################################### +# Produce a single static library for embedders +# + +if (v8_monolithic) { + # A component build is not monolithic. + assert(!is_component_build) + + # Using external startup data would produce separate files. + assert(!v8_use_external_startup_data) + v8_static_library("v8_monolith") { + deps = [ + ":v8", + ":v8_libbase", + ":v8_libplatform", + ":v8_libsampler", + "//build/config:exe_and_shlib_deps", + "//build/win:default_exe_manifest", + ] + + configs = [ ":internal_config" ] + } +} + ############################################################################### # Executables # diff --git a/gni/v8.gni b/gni/v8.gni index 0467720f45..4b8292a244 100644 --- a/gni/v8.gni +++ b/gni/v8.gni @@ -174,3 +174,13 @@ template("v8_component") { configs += v8_add_configs } } + +template("v8_static_library") { + static_library(target_name) { + complete_static_lib = true + forward_variables_from(invoker, "*", [ "configs" ]) + configs += invoker.configs + configs -= v8_remove_configs + configs += v8_add_configs + } +}