blob: b11a7ffaa100836ec40e532f82f75a15e63b3bb4 [file] [log] [blame]
ager@chromium.org3a37e9b2009-04-27 09:26:21 +00001# Copyright 2009 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:
sgjesse@chromium.org755c5b12009-05-29 11:04:38 +00005#
ager@chromium.org3a37e9b2009-04-27 09:26:21 +00006# * 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.
sgjesse@chromium.org755c5b12009-05-29 11:04:38 +000015#
ager@chromium.org3a37e9b2009-04-27 09:26:21 +000016# 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 'chromium_code': 1,
31 'msvs_use_common_release': 0,
kasperl@chromium.org71affb52009-05-26 05:44:31 +000032 'gcc_version%': 'unknown',
kasperl@chromium.orgd628ef52009-07-09 11:16:01 +000033 'target_arch%': 'ia32',
34 'v8_use_snapshot%': 'true',
ager@chromium.org3a37e9b2009-04-27 09:26:21 +000035 },
36 'includes': [
37 '../../../build/common.gypi',
38 ],
39 'target_defaults': {
40 'defines': [
41 'ENABLE_LOGGING_AND_PROFILING',
42 ],
kasperl@chromium.orgd628ef52009-07-09 11:16:01 +000043 'conditions': [
44 ['target_arch=="arm"', {
45 'defines': [
46 'V8_TARGET_ARCH_ARM',
47 ],
48 }],
49 ['target_arch=="ia32"', {
50 'defines': [
51 'V8_TARGET_ARCH_IA32',
52 'V8_NATIVE_REGEXP',
53 ],
54 }],
55 ],
ager@chromium.org3a37e9b2009-04-27 09:26:21 +000056 'configurations': {
57 'Debug': {
58 'defines': [
59 'DEBUG',
60 '_DEBUG',
61 'ENABLE_DISASSEMBLER',
62 ],
63 'msvs_settings': {
64 'VCCLCompilerTool': {
65 'Optimizations': '0',
66 'RuntimeLibrary': '1',
67 },
68 'VCLinkerTool': {
69 'LinkIncremental': '2',
70 },
71 },
72 },
73 'Release': {
74 'conditions': [
75 ['OS=="linux"', {
76 'cflags!': [
77 '-O2',
78 ],
79 'cflags': [
80 '-fomit-frame-pointer',
81 '-O3',
82 ],
kasperl@chromium.org71affb52009-05-26 05:44:31 +000083 'conditions': [
84 [ 'gcc_version=="44"', {
85 'cflags': [
kasperl@chromium.orgd628ef52009-07-09 11:16:01 +000086 # Avoid gcc 4.4 strict aliasing issues in dtoa.c
87 '-fno-strict-aliasing',
88 # Avoid crashes with gcc 4.4 in the v8 test suite.
89 '-fno-tree-vrp',
kasperl@chromium.org71affb52009-05-26 05:44:31 +000090 ],
91 }],
92 ],
ager@chromium.org3a37e9b2009-04-27 09:26:21 +000093 'cflags_cc': [
94 '-fno-rtti',
95 ],
96 }],
97 ['OS=="win"', {
98 'msvs_configuration_attributes': {
99 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
100 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
101 'CharacterSet': '1',
102 },
103 'msvs_settings': {
104 'VCCLCompilerTool': {
105 'RuntimeLibrary': '0',
106 'Optimizations': '2',
107 'InlineFunctionExpansion': '2',
108 'EnableIntrinsicFunctions': 'true',
109 'FavorSizeOrSpeed': '0',
110 'OmitFramePointers': 'true',
111 'StringPooling': 'true',
112 },
113 'VCLinkerTool': {
114 'LinkIncremental': '1',
115 'OptimizeReferences': '2',
116 'OptimizeForWindows98': '1',
117 'EnableCOMDATFolding': '2',
118 },
119 },
120 }],
121 ],
122 },
123 },
124 'xcode_settings': {
125 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
126 'GCC_ENABLE_CPP_RTTI': 'NO',
127 },
128 },
129 'targets': [
kasperl@chromium.orgd628ef52009-07-09 11:16:01 +0000130 {
131 'target_name': 'v8',
132 'type': 'none',
133 'conditions': [
134 ['v8_use_snapshot=="true"', {
135 'dependencies': ['v8_snapshot'],
136 },
137 {
138 'dependencies': ['v8_nosnapshot'],
139 }],
140 ],
141 'direct_dependent_settings': {
142 'include_dirs': [
143 '../../include',
144 ],
145 },
146 },
147 {
148 'target_name': 'v8_snapshot',
149 'type': '<(library)',
150 'dependencies': [
151 'mksnapshot',
152 'js2c',
153 'v8_base',
154 ],
155 'include_dirs+': [
156 '../../src',
157 ],
158 'sources': [
159 '<(SHARED_INTERMEDIATE_DIR)/libraries-empty.cc',
160 '<(INTERMEDIATE_DIR)/snapshot.cc',
161 ],
162 'actions': [
163 {
164 'action_name': 'run_mksnapshot',
165 'inputs': [
166 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)',
167 ],
168 'outputs': [
169 '<(INTERMEDIATE_DIR)/snapshot.cc',
170 ],
171 'action': ['<@(_inputs)', '<@(_outputs)'],
172 },
173 ],
174 },
175 {
176 'target_name': 'v8_nosnapshot',
177 'type': '<(library)',
178 'dependencies': [
179 'js2c',
180 'v8_base',
181 ],
182 'include_dirs+': [
183 '../../src',
184 ],
185 'sources': [
186 '<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
187 '../../src/snapshot-empty.cc',
188 ],
189 },
190 {
191 'target_name': 'v8_base',
192 'type': '<(library)',
193 'include_dirs+': [
194 '../../src',
195 ],
196 'sources': [
197 '../../src/accessors.cc',
198 '../../src/accessors.h',
199 '../../src/allocation.cc',
200 '../../src/allocation.h',
201 '../../src/api.cc',
202 '../../src/api.h',
203 '../../src/apiutils.h',
204 '../../src/arguments.h',
205 '../../src/assembler.cc',
206 '../../src/assembler.h',
207 '../../src/ast.cc',
208 '../../src/ast.h',
209 '../../src/bootstrapper.cc',
210 '../../src/bootstrapper.h',
211 '../../src/builtins.cc',
212 '../../src/builtins.h',
213 '../../src/bytecodes-irregexp.h',
214 '../../src/char-predicates-inl.h',
215 '../../src/char-predicates.h',
216 '../../src/checks.cc',
217 '../../src/checks.h',
218 '../../src/code-stubs.cc',
219 '../../src/code-stubs.h',
220 '../../src/code.h',
221 '../../src/codegen-inl.h',
222 '../../src/codegen.cc',
223 '../../src/codegen.h',
224 '../../src/compilation-cache.cc',
225 '../../src/compilation-cache.h',
226 '../../src/compiler.cc',
227 '../../src/compiler.h',
228 '../../src/contexts.cc',
229 '../../src/contexts.h',
230 '../../src/conversions-inl.h',
231 '../../src/conversions.cc',
232 '../../src/conversions.h',
233 '../../src/counters.cc',
234 '../../src/counters.h',
235 '../../src/cpu.h',
236 '../../src/dateparser.cc',
237 '../../src/dateparser.h',
238 '../../src/dateparser-inl.h',
239 '../../src/debug.cc',
240 '../../src/debug.h',
241 '../../src/debug-agent.cc',
242 '../../src/debug-agent.h',
243 '../../src/disasm.h',
244 '../../src/disassembler.cc',
245 '../../src/disassembler.h',
246 '../../src/dtoa-config.c',
247 '../../src/execution.cc',
248 '../../src/execution.h',
249 '../../src/factory.cc',
250 '../../src/factory.h',
251 '../../src/flag-definitions.h',
252 '../../src/flags.cc',
253 '../../src/flags.h',
254 '../../src/frames-inl.h',
255 '../../src/frames.cc',
256 '../../src/frames.h',
257 '../../src/frame-element.h',
258 '../../src/func-name-inferrer.cc',
259 '../../src/func-name-inferrer.h',
260 '../../src/global-handles.cc',
261 '../../src/global-handles.h',
262 '../../src/globals.h',
263 '../../src/handles-inl.h',
264 '../../src/handles.cc',
265 '../../src/handles.h',
266 '../../src/hashmap.cc',
267 '../../src/hashmap.h',
268 '../../src/heap-inl.h',
269 '../../src/heap.cc',
270 '../../src/heap.h',
271 '../../src/ic-inl.h',
272 '../../src/ic.cc',
273 '../../src/ic.h',
274 '../../src/interpreter-irregexp.cc',
275 '../../src/interpreter-irregexp.h',
276 '../../src/jump-target.cc',
277 '../../src/jump-target.h',
278 '../../src/jump-target-inl.h',
279 '../../src/jsregexp-inl.h',
280 '../../src/jsregexp.cc',
281 '../../src/jsregexp.h',
282 '../../src/list-inl.h',
283 '../../src/list.h',
284 '../../src/log.cc',
285 '../../src/log-inl.h',
286 '../../src/log.h',
287 '../../src/log-utils.cc',
288 '../../src/log-utils.h',
289 '../../src/macro-assembler.h',
290 '../../src/mark-compact.cc',
291 '../../src/mark-compact.h',
292 '../../src/memory.h',
293 '../../src/messages.cc',
294 '../../src/messages.h',
295 '../../src/natives.h',
296 '../../src/objects-debug.cc',
297 '../../src/objects-inl.h',
298 '../../src/objects.cc',
299 '../../src/objects.h',
300 '../../src/oprofile-agent.h',
301 '../../src/oprofile-agent.cc',
302 '../../src/parser.cc',
303 '../../src/parser.h',
304 '../../src/platform.h',
305 '../../src/prettyprinter.cc',
306 '../../src/prettyprinter.h',
307 '../../src/property.cc',
308 '../../src/property.h',
309 '../../src/regexp-macro-assembler-irregexp-inl.h',
310 '../../src/regexp-macro-assembler-irregexp.cc',
311 '../../src/regexp-macro-assembler-irregexp.h',
312 '../../src/regexp-macro-assembler-tracer.cc',
313 '../../src/regexp-macro-assembler-tracer.h',
314 '../../src/regexp-macro-assembler.cc',
315 '../../src/regexp-macro-assembler.h',
316 '../../src/regexp-stack.cc',
317 '../../src/regexp-stack.h',
318 '../../src/register-allocator.h',
319 '../../src/register-allocator-inl.h',
320 '../../src/register-allocator.cc',
321 '../../src/rewriter.cc',
322 '../../src/rewriter.h',
323 '../../src/runtime.cc',
324 '../../src/runtime.h',
325 '../../src/scanner.cc',
326 '../../src/scanner.h',
327 '../../src/scopeinfo.cc',
328 '../../src/scopeinfo.h',
329 '../../src/scopes.cc',
330 '../../src/scopes.h',
331 '../../src/serialize.cc',
332 '../../src/serialize.h',
333 '../../src/shell.h',
334 '../../src/smart-pointer.h',
335 '../../src/snapshot-common.cc',
336 '../../src/snapshot.h',
337 '../../src/spaces-inl.h',
338 '../../src/spaces.cc',
339 '../../src/spaces.h',
340 '../../src/string-stream.cc',
341 '../../src/string-stream.h',
342 '../../src/stub-cache.cc',
343 '../../src/stub-cache.h',
344 '../../src/token.cc',
345 '../../src/token.h',
346 '../../src/top.cc',
347 '../../src/top.h',
348 '../../src/unicode-inl.h',
349 '../../src/unicode.cc',
350 '../../src/unicode.h',
351 '../../src/usage-analyzer.cc',
352 '../../src/usage-analyzer.h',
353 '../../src/utils.cc',
354 '../../src/utils.h',
355 '../../src/v8-counters.cc',
356 '../../src/v8-counters.h',
357 '../../src/v8.cc',
358 '../../src/v8.h',
359 '../../src/v8threads.cc',
360 '../../src/v8threads.h',
361 '../../src/variables.cc',
362 '../../src/variables.h',
363 '../../src/version.cc',
364 '../../src/version.h',
365 '../../src/virtual-frame.h',
366 '../../src/virtual-frame.cc',
367 '../../src/zone-inl.h',
368 '../../src/zone.cc',
369 '../../src/zone.h',
370 ],
371 'conditions': [
372 ['target_arch=="arm"', {
373 'include_dirs+': [
374 '../../src/arm',
375 ],
376 'sources': [
377 '../../src/arm/assembler-arm-inl.h',
378 '../../src/arm/assembler-arm.cc',
379 '../../src/arm/assembler-arm.h',
380 '../../src/arm/builtins-arm.cc',
381 '../../src/arm/codegen-arm.cc',
382 '../../src/arm/codegen-arm.h',
383 '../../src/arm/constants-arm.h',
384 '../../src/arm/cpu-arm.cc',
385 '../../src/arm/debug-arm.cc',
386 '../../src/arm/disasm-arm.cc',
387 '../../src/arm/frames-arm.cc',
388 '../../src/arm/frames-arm.h',
389 '../../src/arm/ic-arm.cc',
390 '../../src/arm/jump-target-arm.cc',
391 '../../src/arm/macro-assembler-arm.cc',
392 '../../src/arm/macro-assembler-arm.h',
393 '../../src/arm/regexp-macro-assembler-arm.cc',
394 '../../src/arm/regexp-macro-assembler-arm.h',
395 '../../src/arm/register-allocator-arm.cc',
396 '../../src/arm/simulator-arm.cc',
397 '../../src/arm/stub-cache-arm.cc',
398 '../../src/arm/virtual-frame-arm.cc',
399 '../../src/arm/virtual-frame-arm.h',
400 ],
401 }],
402 ['target_arch=="ia32"', {
403 'include_dirs+': [
404 '../../src/ia32',
405 ],
406 'sources': [
407 '../../src/ia32/assembler-ia32-inl.h',
408 '../../src/ia32/assembler-ia32.cc',
409 '../../src/ia32/assembler-ia32.h',
410 '../../src/ia32/builtins-ia32.cc',
411 '../../src/ia32/codegen-ia32.cc',
412 '../../src/ia32/codegen-ia32.h',
413 '../../src/ia32/cpu-ia32.cc',
414 '../../src/ia32/debug-ia32.cc',
415 '../../src/ia32/disasm-ia32.cc',
416 '../../src/ia32/frames-ia32.cc',
417 '../../src/ia32/frames-ia32.h',
418 '../../src/ia32/ic-ia32.cc',
419 '../../src/ia32/jump-target-ia32.cc',
420 '../../src/ia32/macro-assembler-ia32.cc',
421 '../../src/ia32/macro-assembler-ia32.h',
422 '../../src/ia32/regexp-macro-assembler-ia32.cc',
423 '../../src/ia32/regexp-macro-assembler-ia32.h',
424 '../../src/ia32/register-allocator-ia32.cc',
425 '../../src/ia32/stub-cache-ia32.cc',
426 '../../src/ia32/virtual-frame-ia32.cc',
427 '../../src/ia32/virtual-frame-ia32.h',
428 ],
429 }],
430 ['OS=="linux"', {
431 'link_settings': {
432 'libraries': [
433 # Needed for clock_gettime() used by src/platform-linux.cc.
434 '-lrt',
435 ]},
436 'sources': [
437 '../../src/platform-linux.cc',
438 '../../src/platform-posix.cc'
439 ],
440 }
441 ],
442 ['OS=="mac"', {
443 'sources': [
444 '../../src/platform-macos.cc',
445 '../../src/platform-posix.cc'
446 ]},
447 ],
448 ['OS=="win"', {
449 'sources': [
450 '../../src/platform-win32.cc',
451 ],
452 # 4355, 4800 came from common.vsprops
453 # 4018, 4244 were a per file config on dtoa-config.c
454 # TODO: It's probably possible and desirable to stop disabling the
455 # dtoa-specific warnings by modifying dtoa as was done in Chromium
456 # r9255. Refer to that revision for details.
457 'msvs_disabled_warnings': [4355, 4800, 4018, 4244],
458 'link_settings': {
459 'libraries': [ '-lwinmm.lib' ],
460 },
461 }],
462 ],
463 },
ager@chromium.org3a37e9b2009-04-27 09:26:21 +0000464 {
465 'target_name': 'js2c',
466 'type': 'none',
467 'variables': {
468 'library_files': [
469 '../../src/runtime.js',
470 '../../src/v8natives.js',
471 '../../src/array.js',
472 '../../src/string.js',
473 '../../src/uri.js',
474 '../../src/math.js',
475 '../../src/messages.js',
476 '../../src/apinatives.js',
477 '../../src/debug-delay.js',
478 '../../src/mirror-delay.js',
479 '../../src/date-delay.js',
480 '../../src/json-delay.js',
481 '../../src/regexp-delay.js',
482 '../../src/macros.py',
483 ],
484 },
485 'actions': [
486 {
487 'action_name': 'js2c',
488 'inputs': [
489 '../../tools/js2c.py',
490 '<@(library_files)',
491 ],
492 'outputs': [
493 '<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
494 '<(SHARED_INTERMEDIATE_DIR)/libraries-empty.cc',
495 ],
kasperl@chromium.orgd628ef52009-07-09 11:16:01 +0000496 'action': [
497 'python',
kasperl@chromium.org3a2bafb2009-07-09 07:03:57 +0000498 '../../tools/js2c.py',
kasperl@chromium.orgd628ef52009-07-09 11:16:01 +0000499 '<@(_outputs)',
500 'CORE',
501 '<@(library_files)'
kasperl@chromium.org3a2bafb2009-07-09 07:03:57 +0000502 ],
kasperl@chromium.org3a2bafb2009-07-09 07:03:57 +0000503 },
504 ],
505 },
kasperl@chromium.org3a2bafb2009-07-09 07:03:57 +0000506 {
ager@chromium.org3a37e9b2009-04-27 09:26:21 +0000507 'target_name': 'mksnapshot',
508 'type': 'executable',
509 'dependencies': [
510 'v8_nosnapshot',
511 ],
kasperl@chromium.orgd628ef52009-07-09 11:16:01 +0000512 'include_dirs+': [
513 '../../src',
514 ],
ager@chromium.org3a37e9b2009-04-27 09:26:21 +0000515 'sources': [
516 '../../src/mksnapshot.cc',
517 ],
518 },
519 {
ager@chromium.org3a37e9b2009-04-27 09:26:21 +0000520 'target_name': 'v8_shell',
521 'type': 'executable',
522 'dependencies': [
kasperl@chromium.orgd628ef52009-07-09 11:16:01 +0000523 'v8'
ager@chromium.org3a37e9b2009-04-27 09:26:21 +0000524 ],
525 'sources': [
526 '../../samples/shell.cc',
527 ],
528 'conditions': [
529 [ 'OS=="win"', {
530 # This could be gotten by not setting chromium_code, if that's OK.
531 'defines': ['_CRT_SECURE_NO_WARNINGS'],
532 }],
533 ],
534 },
535 ],
ager@chromium.org3a37e9b2009-04-27 09:26:21 +0000536}