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