OLD | NEW |
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 # Because standalone V8 builds are not supported, assume this is part of a | 5 # Because standalone V8 builds are not supported, assume this is part of a |
6 # Chromium build. | 6 # Chromium build. |
7 import("//build/module_args/v8.gni") | 7 import("//build/module_args/v8.gni") |
8 | 8 |
9 # TODO(jochen): These will need to be user-settable to support standalone V8 | 9 # TODO(jochen): These will need to be user-settable to support standalone V8 |
10 # builds. | 10 # builds. |
11 v8_deprecation_warnings = false | 11 v8_deprecation_warnings = false |
12 v8_enable_disassembler = false | 12 v8_enable_disassembler = false |
13 v8_enable_gdbjit = false | 13 v8_enable_gdbjit = false |
14 v8_enable_handle_zapping = true | 14 v8_enable_handle_zapping = true |
15 v8_enable_i18n_support = true | 15 v8_enable_i18n_support = true |
16 v8_enable_verify_heap = false | 16 v8_enable_verify_heap = false |
17 v8_interpreted_regexp = false | 17 v8_interpreted_regexp = false |
18 v8_object_print = false | 18 v8_object_print = false |
19 v8_postmortem_support = false | 19 v8_postmortem_support = false |
20 v8_use_snapshot = true | 20 v8_use_snapshot = true |
21 v8_enable_extra_checks = is_debug | 21 v8_enable_extra_checks = is_debug |
22 v8_target_arch = cpu_arch | 22 v8_target_arch = cpu_arch |
23 v8_random_seed = "314159265" | 23 v8_random_seed = "314159265" |
24 | 24 |
| 25 |
25 ############################################################################### | 26 ############################################################################### |
26 # Configurations | 27 # Configurations |
27 # | 28 # |
28 config("internal_config") { | 29 config("internal_config") { |
29 visibility = [ ":*" ] # Only targets in this file can depend on this. | 30 visibility = [ ":*" ] # Only targets in this file can depend on this. |
30 | 31 |
31 include_dirs = [ "." ] | 32 include_dirs = [ "." ] |
32 | 33 |
33 if (component_mode == "shared_library") { | 34 if (component_mode == "shared_library") { |
34 defines = [ | 35 defines = [ |
(...skipping 20 matching lines...) Expand all Loading... |
55 } | 56 } |
56 include_dirs = [ "include" ] | 57 include_dirs = [ "include" ] |
57 } | 58 } |
58 | 59 |
59 config("features") { | 60 config("features") { |
60 visibility = [ ":*" ] # Only targets in this file can depend on this. | 61 visibility = [ ":*" ] # Only targets in this file can depend on this. |
61 | 62 |
62 defines = [] | 63 defines = [] |
63 | 64 |
64 if (v8_enable_disassembler == true) { | 65 if (v8_enable_disassembler == true) { |
65 defines += [ "ENABLE_DISASSEMBLER" ] | 66 defines += [ |
| 67 "ENABLE_DISASSEMBLER", |
| 68 ] |
66 } | 69 } |
67 if (v8_enable_gdbjit == true) { | 70 if (v8_enable_gdbjit == true) { |
68 defines += [ "ENABLE_GDB_JIT_INTERFACE" ] | 71 defines += [ |
| 72 "ENABLE_GDB_JIT_INTERFACE", |
| 73 ] |
69 } | 74 } |
70 if (v8_object_print == true) { | 75 if (v8_object_print == true) { |
71 defines += [ "OBJECT_PRINT" ] | 76 defines += [ |
| 77 "OBJECT_PRINT", |
| 78 ] |
72 } | 79 } |
73 if (v8_enable_verify_heap == true) { | 80 if (v8_enable_verify_heap == true) { |
74 defines += [ "VERIFY_HEAP" ] | 81 defines += [ |
| 82 "VERIFY_HEAP", |
| 83 ] |
75 } | 84 } |
76 if (v8_interpreted_regexp == true) { | 85 if (v8_interpreted_regexp == true) { |
77 defines += [ "V8_INTERPRETED_REGEXP" ] | 86 defines += [ |
| 87 "V8_INTERPRETED_REGEXP", |
| 88 ] |
78 } | 89 } |
79 if (v8_deprecation_warnings == true) { | 90 if (v8_deprecation_warnings == true) { |
80 defines += [ "V8_DEPRECATION_WARNINGS" ] | 91 defines += [ |
| 92 "V8_DEPRECATION_WARNINGS", |
| 93 ] |
81 } | 94 } |
82 if (v8_enable_i18n_support == true) { | 95 if (v8_enable_i18n_support == true) { |
83 defines += [ "V8_I18N_SUPPORT" ] | 96 defines += [ |
| 97 "V8_I18N_SUPPORT", |
| 98 ] |
84 } | 99 } |
85 if (v8_enable_extra_checks == true) { | 100 if (v8_enable_extra_checks == true) { |
86 defines += [ "ENABLE_EXTRA_CHECKS" ] | 101 defines += [ |
| 102 "ENABLE_EXTRA_CHECKS", |
| 103 ] |
87 } | 104 } |
88 if (v8_enable_handle_zapping == true) { | 105 if (v8_enable_handle_zapping == true) { |
89 defines += [ "ENABLE_HANDLE_ZAPPING" ] | 106 defines += [ |
| 107 "ENABLE_HANDLE_ZAPPING", |
| 108 ] |
90 } | 109 } |
91 if (v8_use_external_startup_data == true) { | 110 if (v8_use_external_startup_data == true) { |
92 defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ] | 111 defines += [ |
| 112 "V8_USE_EXTERNAL_STARTUP_DATA", |
| 113 ] |
93 } | 114 } |
94 } | 115 } |
95 | 116 |
96 config("toolchain") { | 117 config("toolchain") { |
97 visibility = [ ":*" ] # Only targets in this file can depend on this. | 118 visibility = [ ":*" ] # Only targets in this file can depend on this. |
98 | 119 |
99 defines = [] | 120 defines = [] |
100 cflags = [] | 121 cflags = [] |
101 | 122 |
102 # TODO(jochen): Add support for arm, mips, mipsel. | 123 # TODO(jochen): Add support for arm, mips, mipsel. |
103 | 124 |
104 if (v8_target_arch == "arm64") { | 125 if (v8_target_arch == "arm64") { |
105 defines += [ "V8_TARGET_ARCH_ARM64" ] | 126 defines += [ |
| 127 "V8_TARGET_ARCH_ARM64", |
| 128 ] |
106 } | 129 } |
107 if (v8_target_arch == "x86") { | 130 if (v8_target_arch == "x86") { |
108 defines += [ "V8_TARGET_ARCH_IA32" ] | 131 defines += [ |
| 132 "V8_TARGET_ARCH_IA32", |
| 133 ] |
109 } | 134 } |
110 if (v8_target_arch == "x64") { | 135 if (v8_target_arch == "x64") { |
111 defines += [ "V8_TARGET_ARCH_X64" ] | 136 defines += [ |
| 137 "V8_TARGET_ARCH_X64", |
| 138 ] |
112 } | 139 } |
113 if (is_win) { | 140 if (is_win) { |
114 defines += [ "WIN32" ] | 141 defines += [ |
| 142 "WIN32", |
| 143 ] |
115 # TODO(jochen): Support v8_enable_prof. | 144 # TODO(jochen): Support v8_enable_prof. |
116 } | 145 } |
117 | 146 |
118 # TODO(jochen): Add support for compiling with simulators. | 147 # TODO(jochen): Add support for compiling with simulators. |
119 | 148 |
120 if (is_debug) { | 149 if (is_debug) { |
121 # TODO(jochen): Add support for different debug optimization levels. | 150 # TODO(jochen): Add support for different debug optimization levels. |
122 defines += [ | 151 defines += [ |
123 "ENABLE_DISASSEMBLER", | 152 "ENABLE_DISASSEMBLER", |
124 "V8_ENABLE_CHECKS", | 153 "V8_ENABLE_CHECKS", |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 "src/json.js", | 196 "src/json.js", |
168 "src/array-iterator.js", | 197 "src/array-iterator.js", |
169 "src/string-iterator.js", | 198 "src/string-iterator.js", |
170 "src/debug-debugger.js", | 199 "src/debug-debugger.js", |
171 "src/mirror-debugger.js", | 200 "src/mirror-debugger.js", |
172 "src/liveedit-debugger.js", | 201 "src/liveedit-debugger.js", |
173 "src/macros.py", | 202 "src/macros.py", |
174 ] | 203 ] |
175 | 204 |
176 outputs = [ | 205 outputs = [ |
177 "$target_gen_dir/libraries.cc", | 206 "$target_gen_dir/libraries.cc" |
178 ] | 207 ] |
179 | 208 |
180 if (v8_enable_i18n_support) { | 209 if (v8_enable_i18n_support) { |
181 sources += [ "src/i18n.js" ] | 210 sources += [ "src/i18n.js" ] |
182 } | 211 } |
183 | 212 |
184 args = [ | 213 args = [ |
185 rebase_path("$target_gen_dir/libraries.cc", root_build_dir), | 214 rebase_path("$target_gen_dir/libraries.cc", root_build_dir), |
186 "CORE", | 215 "CORE", |
187 ] + rebase_path(sources, root_build_dir) | 216 ] + rebase_path(sources, root_build_dir) |
188 | 217 |
189 if (v8_use_external_startup_data) { | 218 if (v8_use_external_startup_data) { |
190 outputs += [ "$target_gen_dir/libraries.bin" ] | 219 outputs += [ "$target_gen_dir/libraries.bin" ] |
191 args += [ | 220 args += [ |
192 "--startup_blob", | 221 "--startup_blob", |
193 rebase_path("$target_gen_dir/libraries.bin", root_build_dir), | 222 rebase_path("$target_gen_dir/libraries.bin", root_build_dir) |
194 ] | 223 ] |
195 } | 224 } |
196 } | 225 } |
197 | 226 |
198 action("d8_js2c") { | |
199 visibility = [ ":*" ] # Only targets in this file can depend on this. | |
200 | |
201 script = "tools/js2c.py" | |
202 | |
203 inputs = [ | |
204 "src/d8.js", | |
205 "src/macros.py", | |
206 ] | |
207 outputs = [ | |
208 "$target_gen_dir/d8-js.cc", | |
209 ] | |
210 | |
211 args = rebase_path(outputs, root_build_dir) + [ "D8" ] + | |
212 rebase_path(inputs, root_build_dir) | |
213 } | |
214 | |
215 action("js2c_experimental") { | 227 action("js2c_experimental") { |
216 visibility = [ ":*" ] # Only targets in this file can depend on this. | 228 visibility = [ ":*" ] # Only targets in this file can depend on this. |
217 | 229 |
218 script = "tools/js2c.py" | 230 script = "tools/js2c.py" |
219 | 231 |
220 # The script depends on this other script, this rule causes a rebuild if it | 232 # The script depends on this other script, this rule causes a rebuild if it |
221 # changes. | 233 # changes. |
222 source_prereqs = [ "tools/jsmin.py" ] | 234 source_prereqs = [ "tools/jsmin.py" ] |
223 | 235 |
224 sources = [ | 236 sources = [ |
225 "src/macros.py", | 237 "src/macros.py", |
226 "src/proxy.js", | 238 "src/proxy.js", |
227 "src/generator.js", | 239 "src/generator.js", |
228 "src/harmony-string.js", | 240 "src/harmony-string.js", |
229 "src/harmony-array.js", | 241 "src/harmony-array.js", |
230 "src/harmony-array-includes.js", | 242 "src/harmony-array-includes.js", |
231 "src/harmony-typedarray.js", | 243 "src/harmony-typedarray.js", |
232 "src/harmony-classes.js", | 244 "src/harmony-classes.js", |
233 "src/harmony-tostring.js", | 245 "src/harmony-tostring.js", |
234 "src/harmony-templates.js", | 246 "src/harmony-templates.js", |
235 "src/harmony-regexp.js", | 247 "src/harmony-regexp.js" |
236 ] | 248 ] |
237 | 249 |
238 outputs = [ | 250 outputs = [ |
239 "$target_gen_dir/experimental-libraries.cc", | 251 "$target_gen_dir/experimental-libraries.cc" |
240 ] | 252 ] |
241 | 253 |
242 args = [ | 254 args = [ |
243 rebase_path("$target_gen_dir/experimental-libraries.cc", | 255 rebase_path("$target_gen_dir/experimental-libraries.cc", root_build_dir), |
244 root_build_dir), | 256 "EXPERIMENTAL", |
245 "EXPERIMENTAL", | 257 ] + rebase_path(sources, root_build_dir) |
246 ] + rebase_path(sources, root_build_dir) | |
247 | 258 |
248 if (v8_use_external_startup_data) { | 259 if (v8_use_external_startup_data) { |
249 outputs += [ "$target_gen_dir/libraries_experimental.bin" ] | 260 outputs += [ "$target_gen_dir/libraries_experimental.bin" ] |
250 args += [ | 261 args += [ |
251 "--startup_blob", | 262 "--startup_blob", |
252 rebase_path("$target_gen_dir/libraries_experimental.bin", root_build_dir), | 263 rebase_path("$target_gen_dir/libraries_experimental.bin", root_build_dir) |
253 ] | 264 ] |
254 } | 265 } |
255 } | 266 } |
256 | 267 |
257 if (v8_use_external_startup_data) { | 268 if (v8_use_external_startup_data) { |
258 action("natives_blob") { | 269 action("natives_blob") { |
259 visibility = [ ":*" ] # Only targets in this file can depend on this. | 270 visibility = [ ":*" ] # Only targets in this file can depend on this. |
260 | 271 |
261 deps = [ | 272 deps = [ |
262 ":js2c", | 273 ":js2c", |
263 ":js2c_experimental", | 274 ":js2c_experimental" |
264 ] | 275 ] |
265 | 276 |
266 sources = [ | 277 sources = [ |
267 "$target_gen_dir/libraries.bin", | 278 "$target_gen_dir/libraries.bin", |
268 "$target_gen_dir/libraries_experimental.bin", | 279 "$target_gen_dir/libraries_experimental.bin" |
269 ] | 280 ] |
270 | 281 |
271 outputs = [ | 282 outputs = [ |
272 "$root_out_dir/natives_blob.bin", | 283 "$root_out_dir/natives_blob.bin" |
273 ] | 284 ] |
274 | 285 |
275 script = "tools/concatenate-files.py" | 286 script = "tools/concatenate-files.py" |
276 | 287 |
277 args = rebase_path(sources + outputs, root_build_dir) | 288 args = rebase_path(sources + outputs, root_build_dir) |
278 } | 289 } |
279 } | 290 } |
280 | 291 |
281 action("postmortem-metadata") { | 292 action("postmortem-metadata") { |
282 visibility = [ ":*" ] # Only targets in this file can depend on this. | 293 visibility = [ ":*" ] # Only targets in this file can depend on this. |
283 | 294 |
284 script = "tools/gen-postmortem-metadata.py" | 295 script = "tools/gen-postmortem-metadata.py" |
285 | 296 |
286 sources = [ | 297 sources = [ |
287 "src/objects.h", | 298 "src/objects.h", |
288 "src/objects-inl.h", | 299 "src/objects-inl.h", |
289 ] | 300 ] |
290 | 301 |
291 outputs = [ | 302 outputs = [ |
292 "$target_gen_dir/debug-support.cc", | 303 "$target_gen_dir/debug-support.cc" |
293 ] | 304 ] |
294 | 305 |
295 args = rebase_path(outputs, root_build_dir) + | 306 args = |
296 rebase_path(sources, root_build_dir) | 307 rebase_path(outputs, root_build_dir) + |
| 308 rebase_path(sources, root_build_dir) |
297 } | 309 } |
298 | 310 |
299 action("run_mksnapshot") { | 311 action("run_mksnapshot") { |
300 visibility = [ ":*" ] # Only targets in this file can depend on this. | 312 visibility = [ ":*" ] # Only targets in this file can depend on this. |
301 | 313 |
302 deps = [ | 314 deps = [ ":mksnapshot($host_toolchain)" ] |
303 ":mksnapshot($host_toolchain)", | |
304 ] | |
305 | 315 |
306 script = "tools/run.py" | 316 script = "tools/run.py" |
307 | 317 |
308 outputs = [ | 318 outputs = [ |
309 "$target_gen_dir/snapshot.cc", | 319 "$target_gen_dir/snapshot.cc" |
310 ] | 320 ] |
311 | 321 |
312 args = [ | 322 args = [ |
313 "./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)", | 323 "./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)", |
314 "root_out_dir") + "/mksnapshot", | 324 "root_out_dir") + "/mksnapshot", |
315 root_build_dir), | 325 root_build_dir), |
316 "--log-snapshot-positions", | 326 "--log-snapshot-positions", |
317 "--logfile", | 327 "--logfile", rebase_path("$target_gen_dir/snapshot.log", root_build_dir), |
318 rebase_path("$target_gen_dir/snapshot.log", root_build_dir), | 328 rebase_path("$target_gen_dir/snapshot.cc", root_build_dir) |
319 rebase_path("$target_gen_dir/snapshot.cc", root_build_dir), | |
320 ] | 329 ] |
321 | 330 |
322 if (v8_random_seed != "0") { | 331 if (v8_random_seed != "0") { |
323 args += [ | 332 args += [ "--random-seed", v8_random_seed ] |
324 "--random-seed", | |
325 v8_random_seed, | |
326 ] | |
327 } | 333 } |
328 | 334 |
329 if (v8_use_external_startup_data) { | 335 if (v8_use_external_startup_data) { |
330 outputs += [ "$root_out_dir/snapshot_blob.bin" ] | 336 outputs += [ "$root_out_dir/snapshot_blob.bin" ] |
331 args += [ | 337 args += [ |
332 "--startup_blob", | 338 "--startup_blob", |
333 rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir), | 339 rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir) |
334 ] | 340 ] |
335 } | 341 } |
336 } | 342 } |
337 | 343 |
| 344 |
338 ############################################################################### | 345 ############################################################################### |
339 # Source Sets (aka static libraries) | 346 # Source Sets (aka static libraries) |
340 # | 347 # |
341 | 348 |
342 source_set("v8_nosnapshot") { | 349 source_set("v8_nosnapshot") { |
343 visibility = [ ":*" ] # Only targets in this file can depend on this. | 350 visibility = [ ":*" ] # Only targets in this file can depend on this. |
344 | 351 |
345 deps = [ | 352 deps = [ |
346 ":js2c", | 353 ":js2c", |
347 ":js2c_experimental", | 354 ":js2c_experimental", |
348 ":v8_base", | 355 ":v8_base", |
349 ] | 356 ] |
350 | 357 |
351 sources = [ | 358 sources = [ |
352 "$target_gen_dir/libraries.cc", | 359 "$target_gen_dir/libraries.cc", |
353 "$target_gen_dir/experimental-libraries.cc", | 360 "$target_gen_dir/experimental-libraries.cc", |
354 "src/snapshot-empty.cc", | 361 "src/snapshot-empty.cc", |
355 ] | 362 ] |
356 | 363 |
357 configs -= [ "//build/config/compiler:chromium_code" ] | 364 configs -= [ "//build/config/compiler:chromium_code" ] |
358 configs += [ "//build/config/compiler:no_chromium_code" ] | 365 configs += [ "//build/config/compiler:no_chromium_code" ] |
359 configs += [ | 366 configs += [ ":internal_config", ":features", ":toolchain" ] |
360 ":internal_config", | |
361 ":features", | |
362 ":toolchain", | |
363 ] | |
364 } | 367 } |
365 | 368 |
366 source_set("v8_snapshot") { | 369 source_set("v8_snapshot") { |
367 visibility = [ ":*" ] # Only targets in this file can depend on this. | 370 visibility = [ ":*" ] # Only targets in this file can depend on this. |
368 | 371 |
369 deps = [ | 372 deps = [ |
370 ":js2c", | 373 ":js2c", |
371 ":js2c_experimental", | 374 ":js2c_experimental", |
372 ":run_mksnapshot", | 375 ":run_mksnapshot", |
373 ":v8_base", | 376 ":v8_base", |
374 ] | 377 ] |
375 | 378 |
376 sources = [ | 379 sources = [ |
377 "$target_gen_dir/libraries.cc", | 380 "$target_gen_dir/libraries.cc", |
378 "$target_gen_dir/experimental-libraries.cc", | 381 "$target_gen_dir/experimental-libraries.cc", |
379 "$target_gen_dir/snapshot.cc", | 382 "$target_gen_dir/snapshot.cc", |
380 ] | 383 ] |
381 | 384 |
382 configs -= [ "//build/config/compiler:chromium_code" ] | 385 configs -= [ "//build/config/compiler:chromium_code" ] |
383 configs += [ "//build/config/compiler:no_chromium_code" ] | 386 configs += [ "//build/config/compiler:no_chromium_code" ] |
384 configs += [ | 387 configs += [ ":internal_config", ":features", ":toolchain" ] |
385 ":internal_config", | |
386 ":features", | |
387 ":toolchain", | |
388 ] | |
389 } | 388 } |
390 | 389 |
391 if (v8_use_external_startup_data) { | 390 if (v8_use_external_startup_data) { |
392 source_set("v8_external_snapshot") { | 391 source_set("v8_external_snapshot") { |
393 visibility = [ ":*" ] # Only targets in this file can depend on this. | 392 visibility = [ ":*" ] # Only targets in this file can depend on this. |
394 | 393 |
395 deps = [ | 394 deps = [ |
396 ":js2c", | 395 ":js2c", |
397 ":js2c_experimental", | 396 ":js2c_experimental", |
398 ":run_mksnapshot", | 397 ":run_mksnapshot", |
399 ":v8_base", | 398 ":v8_base", |
400 ":natives_blob", | 399 ":natives_blob", |
401 ] | 400 ] |
402 | 401 |
403 sources = [ | 402 sources = [ |
404 "src/natives-external.cc", | 403 "src/natives-external.cc", |
405 "src/snapshot-external.cc", | 404 "src/snapshot-external.cc", |
406 ] | 405 ] |
407 | 406 |
408 configs -= [ "//build/config/compiler:chromium_code" ] | 407 configs -= [ "//build/config/compiler:chromium_code" ] |
409 configs += [ "//build/config/compiler:no_chromium_code" ] | 408 configs += [ "//build/config/compiler:no_chromium_code" ] |
410 configs += [ | 409 configs += [ ":internal_config", ":features", ":toolchain" ] |
411 ":internal_config", | |
412 ":features", | |
413 ":toolchain", | |
414 ] | |
415 } | 410 } |
416 } | 411 } |
417 | 412 |
418 source_set("v8_base") { | 413 source_set("v8_base") { |
419 visibility = [ ":*" ] # Only targets in this file can depend on this. | 414 visibility = [ ":*" ] # Only targets in this file can depend on this. |
420 | 415 |
421 sources = [ | 416 sources = [ |
422 "src/accessors.cc", | 417 "src/accessors.cc", |
423 "src/accessors.h", | 418 "src/accessors.h", |
424 "src/allocation.cc", | 419 "src/allocation.cc", |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 "src/ic/mips64/access-compiler-mips64.cc", | 1202 "src/ic/mips64/access-compiler-mips64.cc", |
1208 "src/ic/mips64/handler-compiler-mips64.cc", | 1203 "src/ic/mips64/handler-compiler-mips64.cc", |
1209 "src/ic/mips64/ic-mips64.cc", | 1204 "src/ic/mips64/ic-mips64.cc", |
1210 "src/ic/mips64/ic-compiler-mips64.cc", | 1205 "src/ic/mips64/ic-compiler-mips64.cc", |
1211 "src/ic/mips64/stub-cache-mips64.cc", | 1206 "src/ic/mips64/stub-cache-mips64.cc", |
1212 ] | 1207 ] |
1213 } | 1208 } |
1214 | 1209 |
1215 configs -= [ "//build/config/compiler:chromium_code" ] | 1210 configs -= [ "//build/config/compiler:chromium_code" ] |
1216 configs += [ "//build/config/compiler:no_chromium_code" ] | 1211 configs += [ "//build/config/compiler:no_chromium_code" ] |
1217 configs += [ | 1212 configs += [ ":internal_config", ":features", ":toolchain" ] |
1218 ":internal_config", | |
1219 ":features", | |
1220 ":toolchain", | |
1221 ] | |
1222 | 1213 |
1223 if (!is_debug) { | 1214 if (!is_debug) { |
1224 configs -= [ "//build/config/compiler:optimize" ] | 1215 configs -= [ "//build/config/compiler:optimize" ] |
1225 configs += [ "//build/config/compiler:optimize_max" ] | 1216 configs += [ "//build/config/compiler:optimize_max" ] |
1226 } | 1217 } |
1227 | 1218 |
1228 defines = [] | 1219 defines = [] |
1229 deps = [ | 1220 deps = [ ":v8_libbase" ] |
1230 ":v8_libbase", | |
1231 ] | |
1232 | 1221 |
1233 if (is_win) { | 1222 if (is_win) { |
1234 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 1223 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
1235 cflags = [ "/wd4267" ] | 1224 cflags = [ "/wd4267" ] |
1236 } | 1225 } |
1237 | 1226 |
1238 if (v8_enable_i18n_support) { | 1227 if (v8_enable_i18n_support) { |
1239 deps += [ "//third_party/icu" ] | 1228 deps += [ "//third_party/icu" ] |
1240 if (is_win) { | 1229 if (is_win) { |
1241 deps += [ "//third_party/icu:icudata" ] | 1230 deps += [ "//third_party/icu:icudata" ] |
1242 } | 1231 } |
1243 | |
1244 # TODO(jochen): Add support for icu_use_data_file_flag | 1232 # TODO(jochen): Add support for icu_use_data_file_flag |
1245 defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ] | 1233 defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ] |
1246 } else { | 1234 } else { |
1247 sources -= [ | 1235 sources -= [ |
1248 "src/i18n.cc", | 1236 "src/i18n.cc", |
1249 "src/i18n.h", | 1237 "src/i18n.h", |
1250 ] | 1238 ] |
1251 } | 1239 } |
1252 | 1240 |
1253 if (v8_postmortem_support) { | 1241 if (v8_postmortem_support) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 "src/base/safe_math.h", | 1290 "src/base/safe_math.h", |
1303 "src/base/safe_math_impl.h", | 1291 "src/base/safe_math_impl.h", |
1304 "src/base/sys-info.cc", | 1292 "src/base/sys-info.cc", |
1305 "src/base/sys-info.h", | 1293 "src/base/sys-info.h", |
1306 "src/base/utils/random-number-generator.cc", | 1294 "src/base/utils/random-number-generator.cc", |
1307 "src/base/utils/random-number-generator.h", | 1295 "src/base/utils/random-number-generator.h", |
1308 ] | 1296 ] |
1309 | 1297 |
1310 configs -= [ "//build/config/compiler:chromium_code" ] | 1298 configs -= [ "//build/config/compiler:chromium_code" ] |
1311 configs += [ "//build/config/compiler:no_chromium_code" ] | 1299 configs += [ "//build/config/compiler:no_chromium_code" ] |
1312 configs += [ | 1300 configs += [ ":internal_config_base", ":features", ":toolchain" ] |
1313 ":internal_config_base", | |
1314 ":features", | |
1315 ":toolchain", | |
1316 ] | |
1317 | 1301 |
1318 if (!is_debug) { | 1302 if (!is_debug) { |
1319 configs -= [ "//build/config/compiler:optimize" ] | 1303 configs -= [ "//build/config/compiler:optimize" ] |
1320 configs += [ "//build/config/compiler:optimize_max" ] | 1304 configs += [ "//build/config/compiler:optimize_max" ] |
1321 } | 1305 } |
1322 | 1306 |
1323 defines = [] | 1307 defines = [] |
1324 | 1308 |
1325 if (is_posix) { | 1309 if (is_posix) { |
1326 sources += [ "src/base/platform/platform-posix.cc" ] | 1310 sources += [ |
| 1311 "src/base/platform/platform-posix.cc" |
| 1312 ] |
1327 } | 1313 } |
1328 | 1314 |
1329 if (is_linux) { | 1315 if (is_linux) { |
1330 sources += [ "src/base/platform/platform-linux.cc" ] | 1316 sources += [ |
| 1317 "src/base/platform/platform-linux.cc" |
| 1318 ] |
1331 | 1319 |
1332 libs = [ "rt" ] | 1320 libs = [ "rt" ] |
1333 } else if (is_android) { | 1321 } else if (is_android) { |
1334 defines += [ "CAN_USE_VFP_INSTRUCTIONS" ] | 1322 defines += [ "CAN_USE_VFP_INSTRUCTIONS" ] |
1335 | 1323 |
1336 if (build_os == "mac") { | 1324 if (build_os == "mac") { |
1337 if (current_toolchain == host_toolchain) { | 1325 if (current_toolchain == host_toolchain) { |
1338 sources += [ "src/base/platform/platform-macos.cc" ] | 1326 sources += [ "src/base/platform/platform-macos.cc" ] |
1339 } else { | 1327 } else { |
1340 sources += [ "src/base/platform/platform-linux.cc" ] | 1328 sources += [ "src/base/platform/platform-linux.cc" ] |
1341 } | 1329 } |
1342 } else { | 1330 } else { |
1343 sources += [ "src/base/platform/platform-linux.cc" ] | 1331 sources += [ "src/base/platform/platform-linux.cc" ] |
1344 if (current_toolchain == host_toolchain) { | 1332 if (current_toolchain == host_toolchain) { |
1345 defines += [ "V8_LIBRT_NOT_AVAILABLE" ] | 1333 defines += [ "V8_LIBRT_NOT_AVAILABLE" ] |
1346 } | 1334 } |
1347 } | 1335 } |
1348 } else if (is_mac) { | 1336 } else if (is_mac) { |
1349 sources += [ "src/base/platform/platform-macos.cc" ] | 1337 sources += [ "src/base/platform/platform-macos.cc" ] |
1350 } else if (is_win) { | 1338 } else if (is_win) { |
1351 # TODO(jochen): Add support for cygwin. | 1339 # TODO(jochen): Add support for cygwin. |
1352 sources += [ | 1340 sources += [ |
1353 "src/base/platform/platform-win32.cc", | 1341 "src/base/platform/platform-win32.cc", |
1354 "src/base/win32-headers.h", | 1342 "src/base/win32-headers.h", |
1355 ] | 1343 ] |
1356 | 1344 |
1357 defines += [ "_CRT_RAND_S" ] # for rand_s() | 1345 defines += [ "_CRT_RAND_S" ] # for rand_s() |
1358 | 1346 |
1359 libs = [ | 1347 libs = [ "winmm.lib", "ws2_32.lib" ] |
1360 "winmm.lib", | |
1361 "ws2_32.lib", | |
1362 ] | |
1363 } | 1348 } |
1364 | 1349 |
1365 # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris. | 1350 # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris. |
1366 } | 1351 } |
1367 | 1352 |
1368 source_set("v8_libplatform") { | 1353 source_set("v8_libplatform") { |
1369 sources = [ | 1354 sources = [ |
1370 "include/libplatform/libplatform.h", | 1355 "include/libplatform/libplatform.h", |
1371 "src/libplatform/default-platform.cc", | 1356 "src/libplatform/default-platform.cc", |
1372 "src/libplatform/default-platform.h", | 1357 "src/libplatform/default-platform.h", |
1373 "src/libplatform/task-queue.cc", | 1358 "src/libplatform/task-queue.cc", |
1374 "src/libplatform/task-queue.h", | 1359 "src/libplatform/task-queue.h", |
1375 "src/libplatform/worker-thread.cc", | 1360 "src/libplatform/worker-thread.cc", |
1376 "src/libplatform/worker-thread.h", | 1361 "src/libplatform/worker-thread.h", |
1377 ] | 1362 ] |
1378 | 1363 |
1379 configs -= [ "//build/config/compiler:chromium_code" ] | 1364 configs -= [ "//build/config/compiler:chromium_code" ] |
1380 configs += [ "//build/config/compiler:no_chromium_code" ] | 1365 configs += [ "//build/config/compiler:no_chromium_code" ] |
1381 configs += [ | 1366 configs += [ ":internal_config_base", ":features", ":toolchain" ] |
1382 ":internal_config_base", | |
1383 ":features", | |
1384 ":toolchain", | |
1385 ] | |
1386 | 1367 |
1387 if (!is_debug) { | 1368 if (!is_debug) { |
1388 configs -= [ "//build/config/compiler:optimize" ] | 1369 configs -= [ "//build/config/compiler:optimize" ] |
1389 configs += [ "//build/config/compiler:optimize_max" ] | 1370 configs += [ "//build/config/compiler:optimize_max" ] |
1390 } | 1371 } |
1391 | 1372 |
1392 deps = [ | 1373 deps = [ |
1393 ":v8_libbase", | 1374 ":v8_libbase", |
1394 ] | 1375 ] |
1395 } | 1376 } |
1396 | 1377 |
1397 ############################################################################### | 1378 ############################################################################### |
1398 # Executables | 1379 # Executables |
1399 # | 1380 # |
1400 | 1381 |
1401 if (current_toolchain == host_toolchain) { | 1382 if (current_toolchain == host_toolchain) { |
1402 executable("mksnapshot") { | 1383 executable("mksnapshot") { |
1403 visibility = [ ":*" ] # Only targets in this file can depend on this. | 1384 visibility = [ ":*" ] # Only targets in this file can depend on this. |
1404 | 1385 |
1405 sources = [ | 1386 sources = [ |
1406 "src/mksnapshot.cc", | 1387 "src/mksnapshot.cc", |
1407 ] | 1388 ] |
1408 | 1389 |
1409 configs -= [ "//build/config/compiler:chromium_code" ] | 1390 configs -= [ "//build/config/compiler:chromium_code" ] |
1410 configs += [ "//build/config/compiler:no_chromium_code" ] | 1391 configs += [ "//build/config/compiler:no_chromium_code" ] |
1411 configs += [ | 1392 configs += [ ":internal_config", ":features", ":toolchain" ] |
1412 ":internal_config", | |
1413 ":features", | |
1414 ":toolchain", | |
1415 ] | |
1416 | 1393 |
1417 deps = [ | 1394 deps = [ |
1418 ":v8_base", | 1395 ":v8_base", |
1419 ":v8_libplatform", | 1396 ":v8_libplatform", |
1420 ":v8_nosnapshot", | 1397 ":v8_nosnapshot", |
1421 "//build/config/sanitizers:deps", | 1398 "//build/config/sanitizers:deps", |
1422 ] | 1399 ] |
1423 } | 1400 } |
1424 | |
1425 executable("d8") { | |
1426 sources = [ | |
1427 "src/d8.cc", | |
1428 ] | |
1429 deps = [ | |
1430 ":d8_js2c", | |
1431 ":v8", | |
1432 ":v8_libplatform", | |
1433 ] | |
1434 | |
1435 configs += [ | |
1436 ":internal_config", | |
1437 ":features", | |
1438 ":toolchain", | |
1439 ] | |
1440 | |
1441 # TODO(GYP): Build option for readline support. | |
1442 | |
1443 if (is_posix) { | |
1444 sources += [ "src/d8-posix.cc" ] | |
1445 } else if (is_win) { | |
1446 sources += [ "src/d8-windows.cc" ] | |
1447 } | |
1448 | |
1449 if (component_mode != "shared_library") { | |
1450 sources += [ | |
1451 "src/d8-debug.cc", | |
1452 "$target_gen_dir/d8-js.cc", | |
1453 ] | |
1454 } | |
1455 if (v8_enable_i18n_support) { | |
1456 deps += [ "//third_party/icu" ] | |
1457 } | |
1458 | |
1459 # TODO(GYP) v8_enable_vtunejit support in d8. | |
1460 } | |
1461 } | 1401 } |
1462 | 1402 |
1463 ############################################################################### | 1403 ############################################################################### |
1464 # Public targets | 1404 # Public targets |
1465 # | 1405 # |
1466 | 1406 |
1467 if (component_mode == "shared_library") { | 1407 if (component_mode == "shared_library") { |
1468 component("v8") { | 1408 |
1469 sources = [ | 1409 component("v8") { |
1470 "src/v8dll-main.cc", | 1410 sources = [ |
| 1411 "src/v8dll-main.cc", |
| 1412 ] |
| 1413 |
| 1414 if (v8_use_snapshot && v8_use_external_startup_data) { |
| 1415 deps = [ |
| 1416 ":v8_base", |
| 1417 ":v8_external_snapshot", |
1471 ] | 1418 ] |
| 1419 } else if (v8_use_snapshot) { |
| 1420 deps = [ |
| 1421 ":v8_base", |
| 1422 ":v8_snapshot", |
| 1423 ] |
| 1424 } else { |
| 1425 assert(!v8_use_external_startup_data) |
| 1426 deps = [ |
| 1427 ":v8_base", |
| 1428 ":v8_nosnapshot", |
| 1429 ] |
| 1430 } |
1472 | 1431 |
1473 if (v8_use_snapshot && v8_use_external_startup_data) { | 1432 configs -= [ "//build/config/compiler:chromium_code" ] |
1474 deps = [ | 1433 configs += [ "//build/config/compiler:no_chromium_code" ] |
1475 ":v8_base", | 1434 configs += [ ":internal_config", ":features", ":toolchain" ] |
1476 ":v8_external_snapshot", | |
1477 ] | |
1478 } else if (v8_use_snapshot) { | |
1479 deps = [ | |
1480 ":v8_base", | |
1481 ":v8_snapshot", | |
1482 ] | |
1483 } else { | |
1484 assert(!v8_use_external_startup_data) | |
1485 deps = [ | |
1486 ":v8_base", | |
1487 ":v8_nosnapshot", | |
1488 ] | |
1489 } | |
1490 | 1435 |
1491 configs -= [ "//build/config/compiler:chromium_code" ] | 1436 direct_dependent_configs = [ ":external_config" ] |
1492 configs += [ "//build/config/compiler:no_chromium_code" ] | |
1493 configs += [ | |
1494 ":internal_config", | |
1495 ":features", | |
1496 ":toolchain", | |
1497 ] | |
1498 | 1437 |
1499 direct_dependent_configs = [ ":external_config" ] | 1438 libs = [] |
1500 | 1439 if (is_android && current_toolchain != host_toolchain) { |
1501 libs = [] | 1440 libs += [ "log" ] |
1502 if (is_android && current_toolchain != host_toolchain) { | |
1503 libs += [ "log" ] | |
1504 } | |
1505 } | |
1506 } else { | |
1507 group("v8") { | |
1508 if (v8_use_snapshot && v8_use_external_startup_data) { | |
1509 deps = [ | |
1510 ":v8_base", | |
1511 ":v8_external_snapshot", | |
1512 ] | |
1513 } else if (v8_use_snapshot) { | |
1514 deps = [ | |
1515 ":v8_base", | |
1516 ":v8_snapshot", | |
1517 ] | |
1518 } else { | |
1519 assert(!v8_use_external_startup_data) | |
1520 deps = [ | |
1521 ":v8_base", | |
1522 ":v8_nosnapshot", | |
1523 ] | |
1524 } | |
1525 | |
1526 direct_dependent_configs = [ ":external_config" ] | |
1527 } | 1441 } |
1528 } | 1442 } |
| 1443 |
| 1444 } else { |
| 1445 |
| 1446 group("v8") { |
| 1447 if (v8_use_snapshot && v8_use_external_startup_data) { |
| 1448 deps = [ |
| 1449 ":v8_base", |
| 1450 ":v8_external_snapshot", |
| 1451 ] |
| 1452 } else if (v8_use_snapshot) { |
| 1453 deps = [ |
| 1454 ":v8_base", |
| 1455 ":v8_snapshot", |
| 1456 ] |
| 1457 } else { |
| 1458 assert(!v8_use_external_startup_data) |
| 1459 deps = [ |
| 1460 ":v8_base", |
| 1461 ":v8_nosnapshot", |
| 1462 ] |
| 1463 } |
| 1464 |
| 1465 direct_dependent_configs = [ ":external_config" ] |
| 1466 } |
| 1467 |
| 1468 } |
OLD | NEW |