Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: gni/v8.gni

Issue 2054803003: [gn] Improve sharing common configuration (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Better sharing Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | test/cctest/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gni/v8.gni
diff --git a/gni/v8.gni b/gni/v8.gni
index 91c8d642870d2f0966827a256949caea197ffc8b..ec943a8fd435263281ce0772db9a63e80c10f82b 100644
--- a/gni/v8.gni
+++ b/gni/v8.gni
@@ -5,6 +5,9 @@
import("//build/config/sanitizers/sanitizers.gni")
declare_args() {
+ # Turns on compiler optimizations in V8 in Debug build.
+ v8_optimized_debug = true
+
# Enable the snapshot feature, for fast context creation.
# http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html
v8_use_snapshot = true
@@ -28,3 +31,56 @@ if (v8_target_arch == "") {
v8_target_arch = target_cpu
}
}
+
+###############################################################################
+# Templates
+#
+
+# 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.
+path_prefix = get_path_info("../", "abspath")
+
+# Common configs to remove or add in all v8 targets.
+remove_configs = [ "//build/config/compiler:chromium_code" ]
+add_configs = [
+ "//build/config/compiler:no_chromium_code",
+ path_prefix + ":features",
+ path_prefix + ":toolchain",
+]
+
+if (is_debug && !v8_optimized_debug) {
+ remove_configs += [ "//build/config/compiler:default_optimization" ]
+ add_configs += [ "//build/config/compiler:no_optimize" ]
+} else {
+ remove_configs += [ "//build/config/compiler:default_optimization" ]
+ add_configs += [ "//build/config/compiler:optimize_max" ]
+}
+
+# All templates should be kept in sync.
+template("v8_source_set") {
+ source_set(target_name) {
+ forward_variables_from(invoker, "*", [ "configs" ])
+ configs += invoker.configs
+ configs -= remove_configs
+ configs += add_configs
+ }
+}
+
+template("v8_executable") {
+ executable(target_name) {
+ forward_variables_from(invoker, "*", [ "configs" ])
+ configs += invoker.configs
+ configs -= remove_configs
+ configs += add_configs
+ }
+}
+
+template("v8_component") {
+ component(target_name) {
+ forward_variables_from(invoker, "*", [ "configs" ])
+ configs += invoker.configs
+ configs -= remove_configs
+ configs += add_configs
+ }
+}
« no previous file with comments | « BUILD.gn ('k') | test/cctest/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698