| OLD | NEW |
| 1 # Copyright 2016 the V8 project authors. All rights reserved. | 1 # Copyright 2016 the V8 project authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/v8_target_cpu.gni") | 5 import("//build/config/v8_target_cpu.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") |
| 6 | 7 |
| 7 declare_args() { | 8 declare_args() { |
| 8 # Turns on compiler optimizations in V8 in Debug build. | 9 # Turns on compiler optimizations in V8 in Debug build. |
| 9 v8_optimized_debug = true | 10 v8_optimized_debug = true |
| 10 | 11 |
| 11 # Enable the snapshot feature, for fast context creation. | 12 # Enable the snapshot feature, for fast context creation. |
| 12 # http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html | 13 # http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html |
| 13 v8_use_snapshot = true | 14 v8_use_snapshot = true |
| 14 | 15 |
| 15 # Use external files for startup data blobs: | 16 # Use external files for startup data blobs: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 32 "//build/config/compiler:no_chromium_code", | 33 "//build/config/compiler:no_chromium_code", |
| 33 path_prefix + ":features", | 34 path_prefix + ":features", |
| 34 path_prefix + ":toolchain", | 35 path_prefix + ":toolchain", |
| 35 ] | 36 ] |
| 36 | 37 |
| 37 if (is_debug && !v8_optimized_debug) { | 38 if (is_debug && !v8_optimized_debug) { |
| 38 remove_configs += [ "//build/config/compiler:default_optimization" ] | 39 remove_configs += [ "//build/config/compiler:default_optimization" ] |
| 39 add_configs += [ "//build/config/compiler:no_optimize" ] | 40 add_configs += [ "//build/config/compiler:no_optimize" ] |
| 40 } else { | 41 } else { |
| 41 remove_configs += [ "//build/config/compiler:default_optimization" ] | 42 remove_configs += [ "//build/config/compiler:default_optimization" ] |
| 42 add_configs += [ "//build/config/compiler:optimize_max" ] | 43 |
| 44 # TODO(crbug.com/621335) Rework this so that we don't have the confusion |
| 45 # between "optimize_speed" and "optimize_max". |
| 46 if (is_posix && !is_android && !is_nacl && !using_sanitizer) { |
| 47 add_configs += [ "//build/config/compiler:optimize_speed" ] |
| 48 } else { |
| 49 add_configs += [ "//build/config/compiler:optimize_max" ] |
| 50 } |
| 43 } | 51 } |
| 44 | 52 |
| 45 # All templates should be kept in sync. | 53 # All templates should be kept in sync. |
| 46 template("v8_source_set") { | 54 template("v8_source_set") { |
| 47 source_set(target_name) { | 55 source_set(target_name) { |
| 48 forward_variables_from(invoker, "*", [ "configs" ]) | 56 forward_variables_from(invoker, "*", [ "configs" ]) |
| 49 configs += invoker.configs | 57 configs += invoker.configs |
| 50 configs -= remove_configs | 58 configs -= remove_configs |
| 51 configs += add_configs | 59 configs += add_configs |
| 52 } | 60 } |
| 53 } | 61 } |
| 54 | 62 |
| 55 template("v8_executable") { | 63 template("v8_executable") { |
| 56 executable(target_name) { | 64 executable(target_name) { |
| 57 forward_variables_from(invoker, "*", [ "configs" ]) | 65 forward_variables_from(invoker, "*", [ "configs" ]) |
| 58 configs += invoker.configs | 66 configs += invoker.configs |
| 59 configs -= remove_configs | 67 configs -= remove_configs |
| 60 configs += add_configs | 68 configs += add_configs |
| 61 } | 69 } |
| 62 } | 70 } |
| 63 | 71 |
| 64 template("v8_component") { | 72 template("v8_component") { |
| 65 component(target_name) { | 73 component(target_name) { |
| 66 forward_variables_from(invoker, "*", [ "configs" ]) | 74 forward_variables_from(invoker, "*", [ "configs" ]) |
| 67 configs += invoker.configs | 75 configs += invoker.configs |
| 68 configs -= remove_configs | 76 configs -= remove_configs |
| 69 configs += add_configs | 77 configs += add_configs |
| 70 } | 78 } |
| 71 } | 79 } |
| OLD | NEW |