Upstream version 6.35.131.0
[platform/framework/web/crosswalk.git] / src / v8 / tools / gyp / v8.gyp
1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are
4 # met:
5 #
6 #     * Redistributions of source code must retain the above copyright
7 #       notice, this list of conditions and the following disclaimer.
8 #     * Redistributions in binary form must reproduce the above
9 #       copyright notice, this list of conditions and the following
10 #       disclaimer in the documentation and/or other materials provided
11 #       with the distribution.
12 #     * Neither the name of Google Inc. nor the names of its
13 #       contributors may be used to endorse or promote products derived
14 #       from this software without specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 {
29   'variables': {
30     'icu_use_data_file_flag%': 0,
31     'v8_code': 1,
32     'v8_random_seed%': 314159265,
33   },
34   'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'],
35   'targets': [
36     {
37       'target_name': 'v8',
38       'dependencies_traverse': 1,
39       'conditions': [
40         ['want_separate_host_toolset==1', {
41           'toolsets': ['host', 'target'],
42         }, {
43           'toolsets': ['target'],
44         }],
45         ['v8_use_snapshot=="true"', {
46           # The dependency on v8_base should come from a transitive
47           # dependency however the Android toolchain requires libv8_base.a
48           # to appear before libv8_snapshot.a so it's listed explicitly.
49           'dependencies': ['v8_base.<(v8_target_arch)', 'v8_snapshot'],
50         },
51         {
52           # The dependency on v8_base should come from a transitive
53           # dependency however the Android toolchain requires libv8_base.a
54           # to appear before libv8_snapshot.a so it's listed explicitly.
55           'dependencies': [
56             'v8_base.<(v8_target_arch)',
57             'v8_nosnapshot.<(v8_target_arch)',
58           ],
59         }],
60         ['component=="shared_library"', {
61           'type': '<(component)',
62           'sources': [
63             # Note: on non-Windows we still build this file so that gyp
64             # has some sources to link into the component.
65             '../../src/v8dll-main.cc',
66           ],
67           'defines': [
68             'V8_SHARED',
69             'BUILDING_V8_SHARED',
70           ],
71           'direct_dependent_settings': {
72             'defines': [
73               'V8_SHARED',
74               'USING_V8_SHARED',
75             ],
76           },
77           'target_conditions': [
78             ['OS=="android" and _toolset=="target"', {
79               'libraries': [
80                 '-llog',
81               ],
82               'include_dirs': [
83                 'src/common/android/include',
84               ],
85             }],
86           ],
87           'conditions': [
88             ['OS=="mac"', {
89               'xcode_settings': {
90                 'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']
91               },
92             }],
93             ['soname_version!=""', {
94               'product_extension': 'so.<(soname_version)',
95             }],
96           ],
97         },
98         {
99           'type': 'none',
100         }],
101       ],
102       'direct_dependent_settings': {
103         'include_dirs': [
104           '../../include',
105         ],
106       },
107     },
108     {
109       'target_name': 'v8_snapshot',
110       'type': 'static_library',
111       'conditions': [
112         ['want_separate_host_toolset==1', {
113           'toolsets': ['host', 'target'],
114           'dependencies': [
115             'mksnapshot.<(v8_target_arch)#host',
116             'js2c#host',
117             'generate_trig_table#host',
118           ],
119         }, {
120           'toolsets': ['target'],
121           'dependencies': [
122             'mksnapshot.<(v8_target_arch)',
123             'js2c',
124             'generate_trig_table',
125           ],
126         }],
127         ['component=="shared_library"', {
128           'defines': [
129             'V8_SHARED',
130             'BUILDING_V8_SHARED',
131           ],
132           'direct_dependent_settings': {
133             'defines': [
134               'V8_SHARED',
135               'USING_V8_SHARED',
136             ],
137           },
138         }],
139       ],
140       'dependencies': [
141         'v8_base.<(v8_target_arch)',
142       ],
143       'include_dirs+': [
144         '../../src',
145       ],
146       'sources': [
147         '<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
148         '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc',
149         '<(SHARED_INTERMEDIATE_DIR)/trig-table.cc',
150         '<(INTERMEDIATE_DIR)/snapshot.cc',
151       ],
152       'actions': [
153         {
154           'action_name': 'run_mksnapshot',
155           'inputs': [
156             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot.<(v8_target_arch)<(EXECUTABLE_SUFFIX)',
157           ],
158           'outputs': [
159             '<(INTERMEDIATE_DIR)/snapshot.cc',
160           ],
161           'variables': {
162             'mksnapshot_flags': [
163               '--log-snapshot-positions',
164               '--logfile', '<(INTERMEDIATE_DIR)/snapshot.log',
165             ],
166             'conditions': [
167               ['v8_random_seed!=0', {
168                 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'],
169               }],
170             ],
171           },
172           'action': [
173             '<@(_inputs)',
174             '<@(mksnapshot_flags)',
175             '<@(_outputs)'
176           ],
177         },
178       ],
179     },
180     {
181       'target_name': 'v8_nosnapshot.<(v8_target_arch)',
182       'type': 'static_library',
183       'dependencies': [
184         'v8_base.<(v8_target_arch)',
185       ],
186       'include_dirs+': [
187         '../../src',
188       ],
189       'sources': [
190         '<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
191         '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc',
192         '<(SHARED_INTERMEDIATE_DIR)/trig-table.cc',
193         '../../src/snapshot-empty.cc',
194       ],
195       'conditions': [
196         ['want_separate_host_toolset==1', {
197           'toolsets': ['host', 'target'],
198           'dependencies': ['js2c#host', 'generate_trig_table#host'],
199         }, {
200           'toolsets': ['target'],
201           'dependencies': ['js2c', 'generate_trig_table'],
202         }],
203         ['component=="shared_library"', {
204           'defines': [
205             'BUILDING_V8_SHARED',
206             'V8_SHARED',
207           ],
208         }],
209       ]
210     },
211     { 'target_name': 'generate_trig_table',
212       'type': 'none',
213       'conditions': [
214         ['want_separate_host_toolset==1', {
215           'toolsets': ['host'],
216         }, {
217           'toolsets': ['target'],
218         }],
219       ],
220       'actions': [
221         {
222           'action_name': 'generate',
223           'inputs': [
224             '../../tools/generate-trig-table.py',
225           ],
226           'outputs': [
227             '<(SHARED_INTERMEDIATE_DIR)/trig-table.cc',
228           ],
229           'action': [
230             'python',
231             '../../tools/generate-trig-table.py',
232             '<@(_outputs)',
233           ],
234         },
235       ]
236     },
237     {
238       'target_name': 'v8_base.<(v8_target_arch)',
239       'type': 'static_library',
240       'variables': {
241         'optimize': 'max',
242       },
243       'include_dirs+': [
244         '../../src',
245       ],
246       'sources': [  ### gcmole(all) ###
247         '../../src/accessors.cc',
248         '../../src/accessors.h',
249         '../../src/allocation.cc',
250         '../../src/allocation.h',
251         '../../src/allocation-site-scopes.cc',
252         '../../src/allocation-site-scopes.h',
253         '../../src/allocation-tracker.cc',
254         '../../src/allocation-tracker.h',
255         '../../src/api.cc',
256         '../../src/api.h',
257         '../../src/arguments.cc',
258         '../../src/arguments.h',
259         '../../src/assembler.cc',
260         '../../src/assembler.h',
261         '../../src/assert-scope.h',
262         '../../src/assert-scope.cc',
263         '../../src/ast.cc',
264         '../../src/ast.h',
265         '../../src/atomicops.h',
266         '../../src/atomicops_internals_x86_gcc.cc',
267         '../../src/bignum-dtoa.cc',
268         '../../src/bignum-dtoa.h',
269         '../../src/bignum.cc',
270         '../../src/bignum.h',
271         '../../src/bootstrapper.cc',
272         '../../src/bootstrapper.h',
273         '../../src/builtins.cc',
274         '../../src/builtins.h',
275         '../../src/bytecodes-irregexp.h',
276         '../../src/cached-powers.cc',
277         '../../src/cached-powers.h',
278         '../../src/char-predicates-inl.h',
279         '../../src/char-predicates.h',
280         '../../src/checks.cc',
281         '../../src/checks.h',
282         '../../src/circular-queue-inl.h',
283         '../../src/circular-queue.h',
284         '../../src/code-stubs.cc',
285         '../../src/code-stubs.h',
286         '../../src/code-stubs-hydrogen.cc',
287         '../../src/code.h',
288         '../../src/codegen.cc',
289         '../../src/codegen.h',
290         '../../src/compilation-cache.cc',
291         '../../src/compilation-cache.h',
292         '../../src/compiler.cc',
293         '../../src/compiler.h',
294         '../../src/contexts.cc',
295         '../../src/contexts.h',
296         '../../src/conversions-inl.h',
297         '../../src/conversions.cc',
298         '../../src/conversions.h',
299         '../../src/counters.cc',
300         '../../src/counters.h',
301         '../../src/cpu-profiler-inl.h',
302         '../../src/cpu-profiler.cc',
303         '../../src/cpu-profiler.h',
304         '../../src/cpu.cc',
305         '../../src/cpu.h',
306         '../../src/data-flow.cc',
307         '../../src/data-flow.h',
308         '../../src/date.cc',
309         '../../src/date.h',
310         '../../src/dateparser-inl.h',
311         '../../src/dateparser.cc',
312         '../../src/dateparser.h',
313         '../../src/debug-agent.cc',
314         '../../src/debug-agent.h',
315         '../../src/debug.cc',
316         '../../src/debug.h',
317         '../../src/deoptimizer.cc',
318         '../../src/deoptimizer.h',
319         '../../src/disasm.h',
320         '../../src/disassembler.cc',
321         '../../src/disassembler.h',
322         '../../src/diy-fp.cc',
323         '../../src/diy-fp.h',
324         '../../src/double.h',
325         '../../src/dtoa.cc',
326         '../../src/dtoa.h',
327         '../../src/effects.h',
328         '../../src/elements-kind.cc',
329         '../../src/elements-kind.h',
330         '../../src/elements.cc',
331         '../../src/elements.h',
332         '../../src/execution.cc',
333         '../../src/execution.h',
334         '../../src/extensions/externalize-string-extension.cc',
335         '../../src/extensions/externalize-string-extension.h',
336         '../../src/extensions/free-buffer-extension.cc',
337         '../../src/extensions/free-buffer-extension.h',
338         '../../src/extensions/gc-extension.cc',
339         '../../src/extensions/gc-extension.h',
340         '../../src/extensions/statistics-extension.cc',
341         '../../src/extensions/statistics-extension.h',
342         '../../src/extensions/trigger-failure-extension.cc',
343         '../../src/extensions/trigger-failure-extension.h',
344         '../../src/factory.cc',
345         '../../src/factory.h',
346         '../../src/fast-dtoa.cc',
347         '../../src/fast-dtoa.h',
348         '../../src/feedback-slots.h',
349         '../../src/fixed-dtoa.cc',
350         '../../src/fixed-dtoa.h',
351         '../../src/flag-definitions.h',
352         '../../src/flags.cc',
353         '../../src/flags.h',
354         '../../src/frames-inl.h',
355         '../../src/frames.cc',
356         '../../src/frames.h',
357         '../../src/full-codegen.cc',
358         '../../src/full-codegen.h',
359         '../../src/func-name-inferrer.cc',
360         '../../src/func-name-inferrer.h',
361         '../../src/gdb-jit.cc',
362         '../../src/gdb-jit.h',
363         '../../src/global-handles.cc',
364         '../../src/global-handles.h',
365         '../../src/globals.h',
366         '../../src/handles-inl.h',
367         '../../src/handles.cc',
368         '../../src/handles.h',
369         '../../src/hashmap.h',
370         '../../src/heap-inl.h',
371         '../../src/heap-profiler.cc',
372         '../../src/heap-profiler.h',
373         '../../src/heap-snapshot-generator-inl.h',
374         '../../src/heap-snapshot-generator.cc',
375         '../../src/heap-snapshot-generator.h',
376         '../../src/heap.cc',
377         '../../src/heap.h',
378         '../../src/hydrogen-alias-analysis.h',
379         '../../src/hydrogen-bce.cc',
380         '../../src/hydrogen-bce.h',
381         '../../src/hydrogen-bch.cc',
382         '../../src/hydrogen-bch.h',
383         '../../src/hydrogen-canonicalize.cc',
384         '../../src/hydrogen-canonicalize.h',
385         '../../src/hydrogen-check-elimination.cc',
386         '../../src/hydrogen-check-elimination.h',
387         '../../src/hydrogen-dce.cc',
388         '../../src/hydrogen-dce.h',
389         '../../src/hydrogen-dehoist.cc',
390         '../../src/hydrogen-dehoist.h',
391         '../../src/hydrogen-environment-liveness.cc',
392         '../../src/hydrogen-environment-liveness.h',
393         '../../src/hydrogen-escape-analysis.cc',
394         '../../src/hydrogen-escape-analysis.h',
395         '../../src/hydrogen-flow-engine.h',
396         '../../src/hydrogen-instructions.cc',
397         '../../src/hydrogen-instructions.h',
398         '../../src/hydrogen.cc',
399         '../../src/hydrogen.h',
400         '../../src/hydrogen-gvn.cc',
401         '../../src/hydrogen-gvn.h',
402         '../../src/hydrogen-infer-representation.cc',
403         '../../src/hydrogen-infer-representation.h',
404         '../../src/hydrogen-infer-types.cc',
405         '../../src/hydrogen-infer-types.h',
406         '../../src/hydrogen-load-elimination.cc',
407         '../../src/hydrogen-load-elimination.h',
408         '../../src/hydrogen-mark-deoptimize.cc',
409         '../../src/hydrogen-mark-deoptimize.h',
410         '../../src/hydrogen-mark-unreachable.cc',
411         '../../src/hydrogen-mark-unreachable.h',
412         '../../src/hydrogen-osr.cc',
413         '../../src/hydrogen-osr.h',
414         '../../src/hydrogen-range-analysis.cc',
415         '../../src/hydrogen-range-analysis.h',
416         '../../src/hydrogen-redundant-phi.cc',
417         '../../src/hydrogen-redundant-phi.h',
418         '../../src/hydrogen-removable-simulates.cc',
419         '../../src/hydrogen-removable-simulates.h',
420         '../../src/hydrogen-representation-changes.cc',
421         '../../src/hydrogen-representation-changes.h',
422         '../../src/hydrogen-sce.cc',
423         '../../src/hydrogen-sce.h',
424         '../../src/hydrogen-store-elimination.cc',
425         '../../src/hydrogen-store-elimination.h',
426         '../../src/hydrogen-uint32-analysis.cc',
427         '../../src/hydrogen-uint32-analysis.h',
428         '../../src/i18n.cc',
429         '../../src/i18n.h',
430         '../../src/icu_util.cc',
431         '../../src/icu_util.h',
432         '../../src/ic-inl.h',
433         '../../src/ic.cc',
434         '../../src/ic.h',
435         '../../src/incremental-marking.cc',
436         '../../src/incremental-marking.h',
437         '../../src/interface.cc',
438         '../../src/interface.h',
439         '../../src/interpreter-irregexp.cc',
440         '../../src/interpreter-irregexp.h',
441         '../../src/isolate.cc',
442         '../../src/isolate.h',
443         '../../src/json-parser.h',
444         '../../src/json-stringifier.h',
445         '../../src/jsregexp-inl.h',
446         '../../src/jsregexp.cc',
447         '../../src/jsregexp.h',
448         '../../src/lazy-instance.h',
449         # TODO(jochen): move libplatform/ files to their own target.
450         '../../src/libplatform/default-platform.cc',
451         '../../src/libplatform/default-platform.h',
452         '../../src/libplatform/task-queue.cc',
453         '../../src/libplatform/task-queue.h',
454         '../../src/libplatform/worker-thread.cc',
455         '../../src/libplatform/worker-thread.h',
456         '../../src/list-inl.h',
457         '../../src/list.h',
458         '../../src/lithium-allocator-inl.h',
459         '../../src/lithium-allocator.cc',
460         '../../src/lithium-allocator.h',
461         '../../src/lithium-codegen.cc',
462         '../../src/lithium-codegen.h',
463         '../../src/lithium.cc',
464         '../../src/lithium.h',
465         '../../src/liveedit.cc',
466         '../../src/liveedit.h',
467         '../../src/log-inl.h',
468         '../../src/log-utils.cc',
469         '../../src/log-utils.h',
470         '../../src/log.cc',
471         '../../src/log.h',
472         '../../src/macro-assembler.h',
473         '../../src/mark-compact.cc',
474         '../../src/mark-compact.h',
475         '../../src/messages.cc',
476         '../../src/messages.h',
477         '../../src/natives.h',
478         '../../src/objects-debug.cc',
479         '../../src/objects-inl.h',
480         '../../src/objects-printer.cc',
481         '../../src/objects-visiting.cc',
482         '../../src/objects-visiting.h',
483         '../../src/objects.cc',
484         '../../src/objects.h',
485         '../../src/once.cc',
486         '../../src/once.h',
487         '../../src/optimizing-compiler-thread.h',
488         '../../src/optimizing-compiler-thread.cc',
489         '../../src/parser.cc',
490         '../../src/parser.h',
491         '../../src/platform/elapsed-timer.h',
492         '../../src/platform/time.cc',
493         '../../src/platform/time.h',
494         '../../src/platform.h',
495         '../../src/platform/condition-variable.cc',
496         '../../src/platform/condition-variable.h',
497         '../../src/platform/mutex.cc',
498         '../../src/platform/mutex.h',
499         '../../src/platform/semaphore.cc',
500         '../../src/platform/semaphore.h',
501         '../../src/platform/socket.cc',
502         '../../src/platform/socket.h',
503         '../../src/preparse-data-format.h',
504         '../../src/preparse-data.cc',
505         '../../src/preparse-data.h',
506         '../../src/preparser.cc',
507         '../../src/preparser.h',
508         '../../src/prettyprinter.cc',
509         '../../src/prettyprinter.h',
510         '../../src/profile-generator-inl.h',
511         '../../src/profile-generator.cc',
512         '../../src/profile-generator.h',
513         '../../src/property-details.h',
514         '../../src/property.cc',
515         '../../src/property.h',
516         '../../src/regexp-macro-assembler-irregexp-inl.h',
517         '../../src/regexp-macro-assembler-irregexp.cc',
518         '../../src/regexp-macro-assembler-irregexp.h',
519         '../../src/regexp-macro-assembler-tracer.cc',
520         '../../src/regexp-macro-assembler-tracer.h',
521         '../../src/regexp-macro-assembler.cc',
522         '../../src/regexp-macro-assembler.h',
523         '../../src/regexp-stack.cc',
524         '../../src/regexp-stack.h',
525         '../../src/rewriter.cc',
526         '../../src/rewriter.h',
527         '../../src/runtime-profiler.cc',
528         '../../src/runtime-profiler.h',
529         '../../src/runtime.cc',
530         '../../src/runtime.h',
531         '../../src/safepoint-table.cc',
532         '../../src/safepoint-table.h',
533         '../../src/sampler.cc',
534         '../../src/sampler.h',
535         '../../src/scanner-character-streams.cc',
536         '../../src/scanner-character-streams.h',
537         '../../src/scanner.cc',
538         '../../src/scanner.h',
539         '../../src/scopeinfo.cc',
540         '../../src/scopeinfo.h',
541         '../../src/scopes.cc',
542         '../../src/scopes.h',
543         '../../src/serialize.cc',
544         '../../src/serialize.h',
545         '../../src/small-pointer-list.h',
546         '../../src/smart-pointers.h',
547         '../../src/snapshot-common.cc',
548         '../../src/snapshot.h',
549         '../../src/spaces-inl.h',
550         '../../src/spaces.cc',
551         '../../src/spaces.h',
552         '../../src/store-buffer-inl.h',
553         '../../src/store-buffer.cc',
554         '../../src/store-buffer.h',
555         '../../src/string-search.cc',
556         '../../src/string-search.h',
557         '../../src/string-stream.cc',
558         '../../src/string-stream.h',
559         '../../src/strtod.cc',
560         '../../src/strtod.h',
561         '../../src/stub-cache.cc',
562         '../../src/stub-cache.h',
563         '../../src/sweeper-thread.h',
564         '../../src/sweeper-thread.cc',
565         '../../src/token.cc',
566         '../../src/token.h',
567         '../../src/transitions-inl.h',
568         '../../src/transitions.cc',
569         '../../src/transitions.h',
570         '../../src/type-info.cc',
571         '../../src/type-info.h',
572         '../../src/types.cc',
573         '../../src/types.h',
574         '../../src/typing.cc',
575         '../../src/typing.h',
576         '../../src/unbound-queue-inl.h',
577         '../../src/unbound-queue.h',
578         '../../src/unicode-inl.h',
579         '../../src/unicode.cc',
580         '../../src/unicode.h',
581         '../../src/unique.h',
582         '../../src/uri.h',
583         '../../src/utils-inl.h',
584         '../../src/utils.cc',
585         '../../src/utils.h',
586         '../../src/utils/random-number-generator.cc',
587         '../../src/utils/random-number-generator.h',
588         '../../src/v8-counters.cc',
589         '../../src/v8-counters.h',
590         '../../src/v8.cc',
591         '../../src/v8.h',
592         '../../src/v8checks.h',
593         '../../src/v8conversions.cc',
594         '../../src/v8conversions.h',
595         '../../src/v8globals.h',
596         '../../src/v8memory.h',
597         '../../src/v8threads.cc',
598         '../../src/v8threads.h',
599         '../../src/v8utils.cc',
600         '../../src/v8utils.h',
601         '../../src/variables.cc',
602         '../../src/variables.h',
603         '../../src/version.cc',
604         '../../src/version.h',
605         '../../src/vm-state-inl.h',
606         '../../src/vm-state.h',
607         '../../src/zone-inl.h',
608         '../../src/zone.cc',
609         '../../src/zone.h',
610       ],
611       'conditions': [
612         ['want_separate_host_toolset==1', {
613           'toolsets': ['host', 'target'],
614         }, {
615           'toolsets': ['target'],
616         }],
617        ['v8_enable_xdkprof==1', {
618           'dependencies': ['../../src/third_party/xdk/xdk-v8.gyp:v8_xdk',],
619         }],
620         ['v8_target_arch=="arm"', {
621           'sources': [  ### gcmole(arch:arm) ###
622             '../../src/arm/assembler-arm-inl.h',
623             '../../src/arm/assembler-arm.cc',
624             '../../src/arm/assembler-arm.h',
625             '../../src/arm/builtins-arm.cc',
626             '../../src/arm/code-stubs-arm.cc',
627             '../../src/arm/code-stubs-arm.h',
628             '../../src/arm/codegen-arm.cc',
629             '../../src/arm/codegen-arm.h',
630             '../../src/arm/constants-arm.h',
631             '../../src/arm/constants-arm.cc',
632             '../../src/arm/cpu-arm.cc',
633             '../../src/arm/debug-arm.cc',
634             '../../src/arm/deoptimizer-arm.cc',
635             '../../src/arm/disasm-arm.cc',
636             '../../src/arm/frames-arm.cc',
637             '../../src/arm/frames-arm.h',
638             '../../src/arm/full-codegen-arm.cc',
639             '../../src/arm/ic-arm.cc',
640             '../../src/arm/lithium-arm.cc',
641             '../../src/arm/lithium-arm.h',
642             '../../src/arm/lithium-codegen-arm.cc',
643             '../../src/arm/lithium-codegen-arm.h',
644             '../../src/arm/lithium-gap-resolver-arm.cc',
645             '../../src/arm/lithium-gap-resolver-arm.h',
646             '../../src/arm/macro-assembler-arm.cc',
647             '../../src/arm/macro-assembler-arm.h',
648             '../../src/arm/regexp-macro-assembler-arm.cc',
649             '../../src/arm/regexp-macro-assembler-arm.h',
650             '../../src/arm/simulator-arm.cc',
651             '../../src/arm/stub-cache-arm.cc',
652           ],
653         }],
654         ['v8_target_arch=="arm64"', {
655           'sources': [  ### gcmole(arch:arm64) ###
656             '../../src/arm64/assembler-arm64.cc',
657             '../../src/arm64/assembler-arm64.h',
658             '../../src/arm64/assembler-arm64-inl.h',
659             '../../src/arm64/builtins-arm64.cc',
660             '../../src/arm64/codegen-arm64.cc',
661             '../../src/arm64/codegen-arm64.h',
662             '../../src/arm64/code-stubs-arm64.cc',
663             '../../src/arm64/code-stubs-arm64.h',
664             '../../src/arm64/constants-arm64.h',
665             '../../src/arm64/cpu-arm64.cc',
666             '../../src/arm64/cpu-arm64.h',
667             '../../src/arm64/debug-arm64.cc',
668             '../../src/arm64/decoder-arm64.cc',
669             '../../src/arm64/decoder-arm64.h',
670             '../../src/arm64/decoder-arm64-inl.h',
671             '../../src/arm64/deoptimizer-arm64.cc',
672             '../../src/arm64/disasm-arm64.cc',
673             '../../src/arm64/disasm-arm64.h',
674             '../../src/arm64/frames-arm64.cc',
675             '../../src/arm64/frames-arm64.h',
676             '../../src/arm64/full-codegen-arm64.cc',
677             '../../src/arm64/ic-arm64.cc',
678             '../../src/arm64/instructions-arm64.cc',
679             '../../src/arm64/instructions-arm64.h',
680             '../../src/arm64/instrument-arm64.cc',
681             '../../src/arm64/instrument-arm64.h',
682             '../../src/arm64/lithium-arm64.cc',
683             '../../src/arm64/lithium-arm64.h',
684             '../../src/arm64/lithium-codegen-arm64.cc',
685             '../../src/arm64/lithium-codegen-arm64.h',
686             '../../src/arm64/lithium-gap-resolver-arm64.cc',
687             '../../src/arm64/lithium-gap-resolver-arm64.h',
688             '../../src/arm64/macro-assembler-arm64.cc',
689             '../../src/arm64/macro-assembler-arm64.h',
690             '../../src/arm64/macro-assembler-arm64-inl.h',
691             '../../src/arm64/regexp-macro-assembler-arm64.cc',
692             '../../src/arm64/regexp-macro-assembler-arm64.h',
693             '../../src/arm64/simulator-arm64.cc',
694             '../../src/arm64/simulator-arm64.h',
695             '../../src/arm64/stub-cache-arm64.cc',
696             '../../src/arm64/utils-arm64.cc',
697             '../../src/arm64/utils-arm64.h',
698           ],
699         }],
700         ['v8_target_arch=="ia32" or v8_target_arch=="mac" or OS=="mac"', {
701           'sources': [  ### gcmole(arch:ia32) ###
702             '../../src/ia32/assembler-ia32-inl.h',
703             '../../src/ia32/assembler-ia32.cc',
704             '../../src/ia32/assembler-ia32.h',
705             '../../src/ia32/builtins-ia32.cc',
706             '../../src/ia32/code-stubs-ia32.cc',
707             '../../src/ia32/code-stubs-ia32.h',
708             '../../src/ia32/codegen-ia32.cc',
709             '../../src/ia32/codegen-ia32.h',
710             '../../src/ia32/cpu-ia32.cc',
711             '../../src/ia32/debug-ia32.cc',
712             '../../src/ia32/deoptimizer-ia32.cc',
713             '../../src/ia32/disasm-ia32.cc',
714             '../../src/ia32/frames-ia32.cc',
715             '../../src/ia32/frames-ia32.h',
716             '../../src/ia32/full-codegen-ia32.cc',
717             '../../src/ia32/ic-ia32.cc',
718             '../../src/ia32/lithium-codegen-ia32.cc',
719             '../../src/ia32/lithium-codegen-ia32.h',
720             '../../src/ia32/lithium-gap-resolver-ia32.cc',
721             '../../src/ia32/lithium-gap-resolver-ia32.h',
722             '../../src/ia32/lithium-ia32.cc',
723             '../../src/ia32/lithium-ia32.h',
724             '../../src/ia32/macro-assembler-ia32.cc',
725             '../../src/ia32/macro-assembler-ia32.h',
726             '../../src/ia32/regexp-macro-assembler-ia32.cc',
727             '../../src/ia32/regexp-macro-assembler-ia32.h',
728             '../../src/ia32/stub-cache-ia32.cc',
729           ],
730         }],
731         ['v8_target_arch=="mipsel"', {
732           'sources': [  ### gcmole(arch:mipsel) ###
733             '../../src/mips/assembler-mips.cc',
734             '../../src/mips/assembler-mips.h',
735             '../../src/mips/assembler-mips-inl.h',
736             '../../src/mips/builtins-mips.cc',
737             '../../src/mips/codegen-mips.cc',
738             '../../src/mips/codegen-mips.h',
739             '../../src/mips/code-stubs-mips.cc',
740             '../../src/mips/code-stubs-mips.h',
741             '../../src/mips/constants-mips.cc',
742             '../../src/mips/constants-mips.h',
743             '../../src/mips/cpu-mips.cc',
744             '../../src/mips/debug-mips.cc',
745             '../../src/mips/deoptimizer-mips.cc',
746             '../../src/mips/disasm-mips.cc',
747             '../../src/mips/frames-mips.cc',
748             '../../src/mips/frames-mips.h',
749             '../../src/mips/full-codegen-mips.cc',
750             '../../src/mips/ic-mips.cc',
751             '../../src/mips/lithium-codegen-mips.cc',
752             '../../src/mips/lithium-codegen-mips.h',
753             '../../src/mips/lithium-gap-resolver-mips.cc',
754             '../../src/mips/lithium-gap-resolver-mips.h',
755             '../../src/mips/lithium-mips.cc',
756             '../../src/mips/lithium-mips.h',
757             '../../src/mips/macro-assembler-mips.cc',
758             '../../src/mips/macro-assembler-mips.h',
759             '../../src/mips/regexp-macro-assembler-mips.cc',
760             '../../src/mips/regexp-macro-assembler-mips.h',
761             '../../src/mips/simulator-mips.cc',
762             '../../src/mips/stub-cache-mips.cc',
763           ],
764         }],
765         ['v8_target_arch=="x64" or v8_target_arch=="mac" or OS=="mac"', {
766           'sources': [  ### gcmole(arch:x64) ###
767             '../../src/x64/assembler-x64-inl.h',
768             '../../src/x64/assembler-x64.cc',
769             '../../src/x64/assembler-x64.h',
770             '../../src/x64/builtins-x64.cc',
771             '../../src/x64/code-stubs-x64.cc',
772             '../../src/x64/code-stubs-x64.h',
773             '../../src/x64/codegen-x64.cc',
774             '../../src/x64/codegen-x64.h',
775             '../../src/x64/cpu-x64.cc',
776             '../../src/x64/debug-x64.cc',
777             '../../src/x64/deoptimizer-x64.cc',
778             '../../src/x64/disasm-x64.cc',
779             '../../src/x64/frames-x64.cc',
780             '../../src/x64/frames-x64.h',
781             '../../src/x64/full-codegen-x64.cc',
782             '../../src/x64/ic-x64.cc',
783             '../../src/x64/lithium-codegen-x64.cc',
784             '../../src/x64/lithium-codegen-x64.h',
785             '../../src/x64/lithium-gap-resolver-x64.cc',
786             '../../src/x64/lithium-gap-resolver-x64.h',
787             '../../src/x64/lithium-x64.cc',
788             '../../src/x64/lithium-x64.h',
789             '../../src/x64/macro-assembler-x64.cc',
790             '../../src/x64/macro-assembler-x64.h',
791             '../../src/x64/regexp-macro-assembler-x64.cc',
792             '../../src/x64/regexp-macro-assembler-x64.h',
793             '../../src/x64/stub-cache-x64.cc',
794           ],
795         }],
796         ['OS=="linux"', {
797             'link_settings': {
798               'conditions': [
799                 ['v8_compress_startup_data=="bz2"', {
800                   'libraries': [
801                     '-lbz2',
802                   ]
803                 }],
804               ],
805               'libraries': [
806                 '-lrt'
807               ]
808             },
809             'sources': [  ### gcmole(os:linux) ###
810               '../../src/platform-linux.cc',
811               '../../src/platform-posix.cc'
812             ],
813           }
814         ],
815         ['OS=="android"', {
816             'defines': [
817               'CAN_USE_VFP_INSTRUCTIONS',
818             ],
819             'sources': [
820               '../../src/platform-posix.cc'
821             ],
822             'conditions': [
823               ['host_os=="mac"', {
824                 'target_conditions': [
825                   ['_toolset=="host"', {
826                     'sources': [
827                       '../../src/platform-macos.cc'
828                     ]
829                   }, {
830                     'sources': [
831                       '../../src/platform-linux.cc'
832                     ]
833                   }],
834                 ],
835               }, {
836                 # TODO(bmeurer): What we really want here, is this:
837                 #
838                 # 'link_settings': {
839                 #   'target_conditions': [
840                 #     ['_toolset=="host"', {
841                 #       'libraries': [
842                 #         '-lrt'
843                 #       ]
844                 #     }]
845                 #   ]
846                 # },
847                 #
848                 # but we can't do this right now, as the AOSP does not support
849                 # linking against the host librt, so we need to work around this
850                 # for now, using the following hack (see platform/time.cc):
851                 'target_conditions': [
852                   ['_toolset=="host"', {
853                     'defines': [
854                       'V8_LIBRT_NOT_AVAILABLE=1',
855                     ],
856                   }],
857                 ],
858                 'sources': [
859                   '../../src/platform-linux.cc'
860                 ]
861               }],
862             ],
863           },
864         ],
865         ['OS=="qnx"', {
866             'link_settings': {
867               'target_conditions': [
868                 ['_toolset=="host" and host_os=="linux"', {
869                   'libraries': [
870                     '-lrt'
871                   ],
872                 }],
873                 ['_toolset=="target"', {
874                   'libraries': [
875                     '-lbacktrace', '-lsocket'
876                   ],
877                 }],
878               ],
879             },
880             'sources': [
881               '../../src/platform-posix.cc',
882             ],
883             'target_conditions': [
884               ['_toolset=="host" and host_os=="linux"', {
885                 'sources': [
886                   '../../src/platform-linux.cc'
887                 ],
888               }],
889               ['_toolset=="host" and host_os=="mac"', {
890                 'sources': [
891                   '../../src/platform-macos.cc'
892                 ],
893               }],
894               ['_toolset=="target"', {
895                 'sources': [
896                   '../../src/platform-qnx.cc'
897                 ],
898               }],
899             ],
900           },
901         ],
902         ['OS=="freebsd"', {
903             'link_settings': {
904               'libraries': [
905                 '-L/usr/local/lib -lexecinfo',
906             ]},
907             'sources': [
908               '../../src/platform-freebsd.cc',
909               '../../src/platform-posix.cc'
910             ],
911           }
912         ],
913         ['OS=="openbsd"', {
914             'link_settings': {
915               'libraries': [
916                 '-L/usr/local/lib -lexecinfo',
917             ]},
918             'sources': [
919               '../../src/platform-openbsd.cc',
920               '../../src/platform-posix.cc'
921             ],
922           }
923         ],
924         ['OS=="netbsd"', {
925             'link_settings': {
926               'libraries': [
927                 '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo',
928             ]},
929             'sources': [
930               '../../src/platform-openbsd.cc',
931               '../../src/platform-posix.cc'
932             ],
933           }
934         ],
935         ['OS=="solaris"', {
936             'link_settings': {
937               'libraries': [
938                 '-lsocket -lnsl',
939             ]},
940             'sources': [
941               '../../src/platform-solaris.cc',
942               '../../src/platform-posix.cc'
943             ],
944           }
945         ],
946         ['OS=="mac"', {
947           'sources': [
948             '../../src/platform-macos.cc',
949             '../../src/platform-posix.cc'
950           ]},
951         ],
952         ['OS=="win"', {
953           'defines': [
954             '_CRT_RAND_S'  # for rand_s()
955           ],
956           'variables': {
957             'gyp_generators': '<!(echo $GYP_GENERATORS)',
958           },
959           'conditions': [
960             ['gyp_generators=="make"', {
961               'variables': {
962                 'build_env': '<!(uname -o)',
963               },
964               'conditions': [
965                 ['build_env=="Cygwin"', {
966                   'sources': [
967                     '../../src/platform-cygwin.cc',
968                     '../../src/platform-posix.cc'
969                   ],
970                 }, {
971                   'sources': [
972                     '../../src/platform-win32.cc',
973                     '../../src/win32-math.cc',
974                     '../../src/win32-math.h'
975                   ],
976                 }],
977               ],
978               'link_settings':  {
979                 'libraries': [ '-lwinmm', '-lws2_32' ],
980               },
981             }, {
982               'sources': [
983                 '../../src/platform-win32.cc',
984                 '../../src/win32-math.cc',
985                 '../../src/win32-math.h'
986               ],
987               'msvs_disabled_warnings': [4351, 4355, 4800],
988               'link_settings':  {
989                 'libraries': [ '-lwinmm.lib', '-lws2_32.lib' ],
990               },
991             }],
992           ],
993         }],
994         ['component=="shared_library"', {
995           'defines': [
996             'BUILDING_V8_SHARED',
997             'V8_SHARED',
998           ],
999         }],
1000         ['v8_postmortem_support=="true"', {
1001           'sources': [
1002             '<(SHARED_INTERMEDIATE_DIR)/debug-support.cc',
1003           ]
1004         }],
1005         ['v8_enable_i18n_support==1', {
1006           'dependencies': [
1007             '<(icu_gyp_path):icui18n',
1008             '<(icu_gyp_path):icuuc',
1009           ]
1010         }, {  # v8_enable_i18n_support==0
1011           'sources!': [
1012             '../../src/i18n.cc',
1013             '../../src/i18n.h',
1014           ],
1015         }],
1016         ['OS=="win" and v8_enable_i18n_support==1', {
1017           'dependencies': [
1018             '<(icu_gyp_path):icudata',
1019           ],
1020         }],
1021         ['v8_use_default_platform==0', {
1022           'sources!': [
1023             '../../src/default-platform.cc',
1024             '../../src/default-platform.h',
1025           ],
1026         }],
1027         ['icu_use_data_file_flag==1', {
1028           'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'],
1029         }, { # else icu_use_data_file_flag !=1
1030           'conditions': [
1031             ['OS=="win"', {
1032               'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'],
1033             }, {
1034               'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'],
1035             }],
1036           ],
1037         }],
1038       ],
1039     },
1040     {
1041       'target_name': 'js2c',
1042       'type': 'none',
1043       'conditions': [
1044         ['want_separate_host_toolset==1', {
1045           'toolsets': ['host'],
1046         }, {
1047           'toolsets': ['target'],
1048         }],
1049         ['v8_enable_i18n_support==1', {
1050           'variables': {
1051             'i18n_library_files': [
1052               '../../src/i18n.js',
1053             ],
1054           },
1055         }, {
1056           'variables': {
1057             'i18n_library_files': [],
1058           },
1059         }],
1060       ],
1061       'variables': {
1062         'library_files': [
1063           '../../src/runtime.js',
1064           '../../src/v8natives.js',
1065           '../../src/array.js',
1066           '../../src/string.js',
1067           '../../src/uri.js',
1068           '../../src/math.js',
1069           '../../src/messages.js',
1070           '../../src/apinatives.js',
1071           '../../src/debug-debugger.js',
1072           '../../src/mirror-debugger.js',
1073           '../../src/liveedit-debugger.js',
1074           '../../src/date.js',
1075           '../../src/json.js',
1076           '../../src/regexp.js',
1077           '../../src/arraybuffer.js',
1078           '../../src/typedarray.js',
1079           '../../src/object-observe.js',
1080           '../../src/macros.py',
1081         ],
1082         'experimental_library_files': [
1083           '../../src/macros.py',
1084           '../../src/symbol.js',
1085           '../../src/proxy.js',
1086           '../../src/collection.js',
1087           '../../src/weak_collection.js',
1088           '../../src/promise.js',
1089           '../../src/generator.js',
1090           '../../src/array-iterator.js',
1091           '../../src/harmony-string.js',
1092           '../../src/harmony-array.js',
1093           '../../src/harmony-math.js',
1094           '../../src/simd128.js',
1095         ],
1096       },
1097       'actions': [
1098         {
1099           'action_name': 'js2c',
1100           'inputs': [
1101             '../../tools/js2c.py',
1102             '<@(library_files)',
1103             '<@(i18n_library_files)',
1104           ],
1105           'outputs': [
1106             '<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
1107           ],
1108           'action': [
1109             'python',
1110             '../../tools/js2c.py',
1111             '<@(_outputs)',
1112             'CORE',
1113             '<(v8_compress_startup_data)',
1114             '<@(library_files)',
1115             '<@(i18n_library_files)',
1116           ],
1117         },
1118         {
1119           'action_name': 'js2c_experimental',
1120           'inputs': [
1121             '../../tools/js2c.py',
1122             '<@(experimental_library_files)',
1123           ],
1124           'outputs': [
1125             '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc',
1126           ],
1127           'action': [
1128             'python',
1129             '../../tools/js2c.py',
1130             '<@(_outputs)',
1131             'EXPERIMENTAL',
1132             '<(v8_compress_startup_data)',
1133             '<@(experimental_library_files)'
1134           ],
1135         },
1136       ],
1137     },
1138     {
1139       'target_name': 'postmortem-metadata',
1140       'type': 'none',
1141       'variables': {
1142         'heapobject_files': [
1143             '../../src/objects.h',
1144             '../../src/objects-inl.h',
1145         ],
1146       },
1147       'actions': [
1148           {
1149             'action_name': 'gen-postmortem-metadata',
1150             'inputs': [
1151               '../../tools/gen-postmortem-metadata.py',
1152               '<@(heapobject_files)',
1153             ],
1154             'outputs': [
1155               '<(SHARED_INTERMEDIATE_DIR)/debug-support.cc',
1156             ],
1157             'action': [
1158               'python',
1159               '../../tools/gen-postmortem-metadata.py',
1160               '<@(_outputs)',
1161               '<@(heapobject_files)'
1162             ]
1163           }
1164         ]
1165     },
1166     {
1167       'target_name': 'mksnapshot.<(v8_target_arch)',
1168       'type': 'executable',
1169       'dependencies': [
1170         'v8_base.<(v8_target_arch)',
1171         'v8_nosnapshot.<(v8_target_arch)',
1172       ],
1173       'include_dirs+': [
1174         '../../src',
1175       ],
1176       'sources': [
1177         '../../src/mksnapshot.cc',
1178       ],
1179       'conditions': [
1180         ['want_separate_host_toolset==1', {
1181           'toolsets': ['host'],
1182         }, {
1183           'toolsets': ['target'],
1184         }],
1185         ['v8_compress_startup_data=="bz2"', {
1186           'libraries': [
1187             '-lbz2',
1188           ]
1189         }],
1190       ],
1191     },
1192   ],
1193 }