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

Side by Side Diff: BUILD.gn

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 unified diff | Download patch
« no previous file with comments | « no previous file | gni/v8.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium 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/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/arm.gni") 6 import("//build/config/arm.gni")
7 import("//build/config/dcheck_always_on.gni") 7 import("//build/config/dcheck_always_on.gni")
8 import("//build/config/mips.gni") 8 import("//build/config/mips.gni")
9 import("//build/config/sanitizers/sanitizers.gni") 9 import("//build/config/sanitizers/sanitizers.gni")
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 # Enable slow dchecks. 44 # Enable slow dchecks.
45 v8_enable_slow_dchecks = false 45 v8_enable_slow_dchecks = false
46 46
47 # Interpreted regexp engine exists as platform-independent alternative 47 # Interpreted regexp engine exists as platform-independent alternative
48 # based where the regular expression is compiled to a bytecode. 48 # based where the regular expression is compiled to a bytecode.
49 v8_interpreted_regexp = false 49 v8_interpreted_regexp = false
50 50
51 # Sets -dOBJECT_PRINT. 51 # Sets -dOBJECT_PRINT.
52 v8_object_print = false 52 v8_object_print = false
53 53
54 # Turns on compiler optimizations in V8 in Debug build.
55 v8_optimized_debug = true
56
57 # With post mortem support enabled, metadata is embedded into libv8 that 54 # With post mortem support enabled, metadata is embedded into libv8 that
58 # describes various parameters of the VM for use by debuggers. See 55 # describes various parameters of the VM for use by debuggers. See
59 # tools/gen-postmortem-metadata.py for details. 56 # tools/gen-postmortem-metadata.py for details.
60 v8_postmortem_support = false 57 v8_postmortem_support = false
61 58
62 # Similar to vfp but on MIPS. 59 # Similar to vfp but on MIPS.
63 v8_can_use_fpu_instructions = true 60 v8_can_use_fpu_instructions = true
64 61
65 # Similar to the ARM hard float ABI but on MIPS. 62 # Similar to the ARM hard float ABI but on MIPS.
66 v8_use_mips_abi_hardfloat = true 63 v8_use_mips_abi_hardfloat = true
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 ] 293 ]
297 if (v8_enable_slow_dchecks) { 294 if (v8_enable_slow_dchecks) {
298 defines += [ "ENABLE_SLOW_DCHECKS" ] 295 defines += [ "ENABLE_SLOW_DCHECKS" ]
299 } 296 }
300 } else if (dcheck_always_on) { 297 } else if (dcheck_always_on) {
301 defines += [ "DEBUG" ] 298 defines += [ "DEBUG" ]
302 } 299 }
303 } 300 }
304 301
305 ############################################################################### 302 ###############################################################################
306 # Templates
307 #
308
309 template("v8_source_set") {
310 source_set(target_name) {
311 forward_variables_from(invoker, "*", [ "configs" ])
312 configs += invoker.configs
313 configs -= [ "//build/config/compiler:chromium_code" ]
314 configs += [ "//build/config/compiler:no_chromium_code" ]
315 configs += [
316 ":features",
317 ":toolchain",
318 ]
319
320 # TODO(machenbach): This config doesn't affect executables and components.
321 # It should be moved to a common place.
322 if (is_debug && !v8_optimized_debug) {
323 configs -= [ "//build/config/compiler:default_optimization" ]
324 configs += [ "//build/config/compiler:no_optimize" ]
325 } else {
326 configs -= [ "//build/config/compiler:default_optimization" ]
327 configs += [ "//build/config/compiler:optimize_max" ]
328 }
329 }
330 }
331
332 ###############################################################################
333 # Actions 303 # Actions
334 # 304 #
335 305
336 action("js2c") { 306 action("js2c") {
337 visibility = [ ":*" ] # Only targets in this file can depend on this. 307 visibility = [ ":*" ] # Only targets in this file can depend on this.
338 308
339 script = "tools/js2c.py" 309 script = "tools/js2c.py"
340 310
341 # The script depends on this other script, this rule causes a rebuild if it 311 # The script depends on this other script, this rule causes a rebuild if it
342 # changes. 312 # changes.
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2037 ] 2007 ]
2038 2008
2039 configs = [ ":internal_config_base" ] 2009 configs = [ ":internal_config_base" ]
2040 } 2010 }
2041 2011
2042 ############################################################################### 2012 ###############################################################################
2043 # Executables 2013 # Executables
2044 # 2014 #
2045 2015
2046 if (current_toolchain == v8_snapshot_toolchain) { 2016 if (current_toolchain == v8_snapshot_toolchain) {
2047 executable("mksnapshot") { 2017 v8_executable("mksnapshot") {
2048 visibility = [ ":*" ] # Only targets in this file can depend on this. 2018 visibility = [ ":*" ] # Only targets in this file can depend on this.
2049 2019
2050 sources = [ 2020 sources = [
2051 "src/snapshot/mksnapshot.cc", 2021 "src/snapshot/mksnapshot.cc",
2052 ] 2022 ]
2053 2023
2054 configs -= [ "//build/config/compiler:chromium_code" ] 2024 configs = [
2055 configs += [ "//build/config/compiler:no_chromium_code" ]
2056 configs += [
2057 ":internal_config", 2025 ":internal_config",
2058 ":features",
2059 ":toolchain",
2060 ] 2026 ]
2061 2027
2062 deps = [ 2028 deps = [
2063 ":v8_base", 2029 ":v8_base",
2064 ":v8_libplatform", 2030 ":v8_libplatform",
2065 ":v8_nosnapshot", 2031 ":v8_nosnapshot",
2066 "//build/config/sanitizers:deps", 2032 "//build/config/sanitizers:deps",
2067 "//build/win:default_exe_manifest", 2033 "//build/win:default_exe_manifest",
2068 ] 2034 ]
2069 } 2035 }
(...skipping 26 matching lines...) Expand all
2096 if (want_v8_shell) { 2062 if (want_v8_shell) {
2097 deps += [ ":v8_shell" ] 2063 deps += [ ":v8_shell" ]
2098 } 2064 }
2099 2065
2100 if (v8_test_isolation_mode != "noop") { 2066 if (v8_test_isolation_mode != "noop") {
2101 deps += [ ":d8_run" ] 2067 deps += [ ":d8_run" ]
2102 } 2068 }
2103 } 2069 }
2104 2070
2105 if (is_component_build) { 2071 if (is_component_build) {
2106 component("v8") { 2072 v8_component("v8") {
2107 sources = [ 2073 sources = [
2108 "src/v8dll-main.cc", 2074 "src/v8dll-main.cc",
2109 ] 2075 ]
2110 2076
2111 public_deps = [ 2077 public_deps = [
2112 ":v8_base", 2078 ":v8_base",
2113 ":v8_maybe_snapshot", 2079 ":v8_maybe_snapshot",
2114 ] 2080 ]
2115 2081
2116 configs -= [ "//build/config/compiler:chromium_code" ] 2082 configs = [
2117 configs += [ "//build/config/compiler:no_chromium_code" ]
2118 configs += [
2119 ":internal_config", 2083 ":internal_config",
2120 ":features",
2121 ":toolchain",
2122 ] 2084 ]
2123 2085
2124 public_configs = [ ":external_config" ] 2086 public_configs = [ ":external_config" ]
2125 } 2087 }
2126 } else { 2088 } else {
2127 group("v8") { 2089 group("v8") {
2128 public_deps = [ 2090 public_deps = [
2129 ":v8_base", 2091 ":v8_base",
2130 ":v8_maybe_snapshot", 2092 ":v8_maybe_snapshot",
2131 ] 2093 ]
2132 public_configs = [ ":external_config" ] 2094 public_configs = [ ":external_config" ]
2133 } 2095 }
2134 } 2096 }
2135 2097
2136 executable("d8") { 2098 v8_executable("d8") {
2137 sources = [ 2099 sources = [
2138 "src/d8.cc", 2100 "src/d8.cc",
2139 "src/d8.h", 2101 "src/d8.h",
2140 ] 2102 ]
2141 2103
2142 configs -= [ "//build/config/compiler:chromium_code" ] 2104 configs = [
2143 configs += [ "//build/config/compiler:no_chromium_code" ]
2144 configs += [
2145 # Note: don't use :internal_config here because this target will get 2105 # Note: don't use :internal_config here because this target will get
2146 # the :external_config applied to it by virtue of depending on :v8, and 2106 # the :external_config applied to it by virtue of depending on :v8, and
2147 # you can't have both applied to the same target. 2107 # you can't have both applied to the same target.
2148 ":internal_config_base", 2108 ":internal_config_base",
2149 ":features",
2150 ":toolchain",
2151 ] 2109 ]
2152 2110
2153 deps = [ 2111 deps = [
2154 ":d8_js2c", 2112 ":d8_js2c",
2155 ":v8", 2113 ":v8",
2156 ":v8_libplatform", 2114 ":v8_libplatform",
2157 "//build/config/sanitizers:deps", 2115 "//build/config/sanitizers:deps",
2158 "//build/win:default_exe_manifest", 2116 "//build/win:default_exe_manifest",
2159 ] 2117 ]
2160 2118
(...skipping 15 matching lines...) Expand all
2176 2134
2177 v8_isolate_run("d8") { 2135 v8_isolate_run("d8") {
2178 deps = [ 2136 deps = [
2179 ":d8", 2137 ":d8",
2180 ] 2138 ]
2181 2139
2182 isolate = "//src/d8.isolate" 2140 isolate = "//src/d8.isolate"
2183 } 2141 }
2184 2142
2185 if (want_v8_shell) { 2143 if (want_v8_shell) {
2186 executable("v8_shell") { 2144 v8_executable("v8_shell") {
2187 sources = [ 2145 sources = [
2188 "samples/shell.cc", 2146 "samples/shell.cc",
2189 ] 2147 ]
2190 2148
2191 configs -= [ "//build/config/compiler:chromium_code" ] 2149 configs = [
2192 configs += [ "//build/config/compiler:no_chromium_code" ]
2193 configs += [
2194 # Note: don't use :internal_config here because this target will get 2150 # Note: don't use :internal_config here because this target will get
2195 # the :external_config applied to it by virtue of depending on :v8, and 2151 # the :external_config applied to it by virtue of depending on :v8, and
2196 # you can't have both applied to the same target. 2152 # you can't have both applied to the same target.
2197 ":internal_config_base", 2153 ":internal_config_base",
2198 ":features",
2199 ":toolchain",
2200 ] 2154 ]
2201 2155
2202 deps = [ 2156 deps = [
2203 ":v8", 2157 ":v8",
2204 ":v8_libplatform", 2158 ":v8_libplatform",
2205 "//build/config/sanitizers:deps", 2159 "//build/config/sanitizers:deps",
2206 "//build/win:default_exe_manifest", 2160 "//build/win:default_exe_manifest",
2207 ] 2161 ]
2208 2162
2209 if (v8_enable_i18n_support) { 2163 if (v8_enable_i18n_support) {
2210 deps += [ "//third_party/icu" ] 2164 deps += [ "//third_party/icu" ]
2211 } 2165 }
2212 } 2166 }
2213 } 2167 }
2214 2168
2215 template("v8_fuzzer") { 2169 template("v8_fuzzer") {
2216 name = target_name 2170 name = target_name
2217 forward_variables_from(invoker, "*") 2171 forward_variables_from(invoker, "*")
2218 executable("v8_simple_" + name) { 2172 v8_executable("v8_simple_" + name) {
2219 deps = [ 2173 deps = [
2220 ":" + name, 2174 ":" + name,
2221 ":simple_fuzzer", 2175 ":simple_fuzzer",
2222 "//build/win:default_exe_manifest", 2176 "//build/win:default_exe_manifest",
2223 ] 2177 ]
2224 2178
2225 configs += [ ":external_config" ] 2179 configs = [ ":external_config" ]
2226 } 2180 }
2227 } 2181 }
2228 2182
2229 v8_source_set("json_fuzzer") { 2183 v8_source_set("json_fuzzer") {
2230 sources = [ 2184 sources = [
2231 "test/fuzzer/json.cc", 2185 "test/fuzzer/json.cc",
2232 ] 2186 ]
2233 2187
2234 deps = [ 2188 deps = [
2235 ":fuzzer_support", 2189 ":fuzzer_support",
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2293 2247
2294 deps = [ 2248 deps = [
2295 ":fuzzer_support", 2249 ":fuzzer_support",
2296 ] 2250 ]
2297 2251
2298 configs = [ ":internal_config" ] 2252 configs = [ ":internal_config" ]
2299 } 2253 }
2300 2254
2301 v8_fuzzer("wasm_asmjs_fuzzer") { 2255 v8_fuzzer("wasm_asmjs_fuzzer") {
2302 } 2256 }
OLDNEW
« no previous file with comments | « no previous file | gni/v8.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698