blob: de41fe0d00189e2a20576c63004e21a6ad14a9d8 [file] [log] [blame]
danno@chromium.orgbee51992013-07-10 14:57:15 +00001# Copyright 2013 the V8 project authors. All rights reserved.
ager@chromium.org5f0c45f2010-12-17 08:51:21 +00002# 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
ricow@chromium.org4668a2c2011-08-29 10:41:00 +000028# Shared definitions for all V8-related targets.
29
ager@chromium.org5f0c45f2010-12-17 08:51:21 +000030{
31 'variables': {
ricow@chromium.org4668a2c2011-08-29 10:41:00 +000032 'msvs_use_common_release': 0,
33 'gcc_version%': 'unknown',
ulan@chromium.org2e04b582013-02-21 14:06:02 +000034 'CXX%': '${CXX:-$(which g++)}', # Used to assemble a shell command.
ricow@chromium.org4668a2c2011-08-29 10:41:00 +000035 'v8_target_arch%': '<(target_arch)',
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +000036 # Native Client builds currently use the V8 ARM JIT and
37 # arm/simulator-arm.cc to defer the significant effort required
38 # for NaCl JIT support. The nacl_target_arch variable provides
39 # the 'true' target arch for places in this file that need it.
40 # TODO(bradchen): get rid of nacl_target_arch when someday
41 # NaCl V8 builds stop using the ARM simulator
42 'nacl_target_arch%': 'none', # must be set externally
ricow@chromium.org4668a2c2011-08-29 10:41:00 +000043
yangguo@chromium.org003650e2013-01-24 16:31:08 +000044 # Setting 'v8_can_use_vfp32dregs' to 'true' will cause V8 to use the VFP
45 # registers d16-d31 in the generated code, both in the snapshot and for the
46 # ARM target. Leaving the default value of 'false' will avoid the use of
47 # these registers in the snapshot and use CPU feature probing when running
48 # on the target.
49 'v8_can_use_vfp32dregs%': 'false',
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +000050 'arm_test%': 'off',
yangguo@chromium.org003650e2013-01-24 16:31:08 +000051
danno@chromium.orgc612e022011-11-10 11:38:15 +000052 # Similar to vfp but on MIPS.
53 'v8_can_use_fpu_instructions%': 'true',
54
danno@chromium.orgc612e022011-11-10 11:38:15 +000055 # Similar to the ARM hard float ABI but on MIPS.
56 'v8_use_mips_abi_hardfloat%': 'true',
57
mstarzinger@chromium.org3233d2f2012-03-14 11:16:03 +000058 # Default arch variant for MIPS.
59 'mips_arch_variant%': 'mips32r2',
60
yangguo@chromium.orga6bbcc82012-12-21 12:35:02 +000061 'v8_enable_backtrace%': 0,
danno@chromium.org169691d2013-07-15 08:01:13 +000062
ricow@chromium.org4668a2c2011-08-29 10:41:00 +000063 # Enable profiling support. Only required on Windows.
64 'v8_enable_prof%': 0,
65
ulan@chromium.org2efb9002012-01-19 15:36:35 +000066 # Some versions of GCC 4.5 seem to need -fno-strict-aliasing.
67 'v8_no_strict_aliasing%': 0,
68
ricow@chromium.org4668a2c2011-08-29 10:41:00 +000069 # Chrome needs this definition unconditionally. For standalone V8 builds,
70 # it's handled in build/standalone.gypi.
71 'want_separate_host_toolset%': 1,
72
ricow@chromium.org4668a2c2011-08-29 10:41:00 +000073 'host_os%': '<(OS)',
svenpanne@chromium.orga8bb4d92011-10-10 13:20:40 +000074 'werror%': '-Werror',
ricow@chromium.org55ee8072011-09-08 16:33:10 +000075 # For a shared library build, results in "libv8-<(soname_version).so".
76 'soname_version%': '',
danno@chromium.org169691d2013-07-15 08:01:13 +000077
78 # Allow to suppress the array bounds warning (default is no suppression).
79 'wno_array_bounds%': '',
ager@chromium.org5f0c45f2010-12-17 08:51:21 +000080 },
81 'target_defaults': {
kmillikin@chromium.org7c2628c2011-08-10 11:27:35 +000082 'conditions': [
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +000083 ['v8_target_arch=="arm"', {
84 'defines': [
85 'V8_TARGET_ARCH_ARM',
86 ],
danno@chromium.org1fd77d52013-06-07 16:01:45 +000087 'target_conditions': [
88 ['_toolset=="host"', {
89 'variables': {
90 'armcompiler': '<!($(echo ${CXX_host:-$(which g++)}) -v 2>&1 | grep -q "^Target: arm" && echo "yes" || echo "no")',
91 },
92 'conditions': [
93 ['armcompiler=="yes"', {
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +000094 'conditions': [
95 [ 'armv7==1', {
96 'cflags': ['-march=armv7-a',],
97 }],
98 [ 'armv7==1 or armv7=="default"', {
99 'conditions': [
100 [ 'arm_neon==1', {
101 'cflags': ['-mfpu=neon',],
102 },
103 {
104 'conditions': [
105 [ 'arm_fpu!="default"', {
106 'cflags': ['-mfpu=<(arm_fpu)',],
107 }],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000108 ],
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000109 }],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000110 ],
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000111 }],
112 [ 'arm_float_abi!="default"', {
113 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
114 }],
115 [ 'arm_thumb==1', {
116 'cflags': ['-mthumb',],
117 }],
118 [ 'arm_thumb==0', {
119 'cflags': ['-marm',],
120 }],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000121 [ 'arm_test=="on"', {
122 'defines': [
123 'ARM_TEST',
124 ],
125 }],
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000126 ],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000127 }, {
128 # armcompiler=="no"
129 'conditions': [
130 [ 'armv7==1 or armv7=="default"', {
131 'defines': [
132 'CAN_USE_ARMV7_INSTRUCTIONS=1',
133 ],
134 'conditions': [
135 [ 'arm_fpu=="default"', {
136 'defines': [
137 'CAN_USE_VFP3_INSTRUCTIONS',
138 ],
139 }],
140 [ 'arm_fpu=="vfpv3-d16"', {
141 'defines': [
142 'CAN_USE_VFP3_INSTRUCTIONS',
143 ],
144 }],
145 [ 'arm_fpu=="vfpv3"', {
146 'defines': [
147 'CAN_USE_VFP3_INSTRUCTIONS',
148 'CAN_USE_VFP32DREGS',
149 ],
150 }],
151 [ 'arm_fpu=="neon" or arm_neon==1', {
152 'defines': [
153 'CAN_USE_VFP3_INSTRUCTIONS',
154 'CAN_USE_VFP32DREGS',
155 ],
156 }],
157 ],
158 }],
159 [ 'arm_float_abi=="hard"', {
160 'defines': [
161 'USE_EABI_HARDFLOAT=1',
162 ],
163 }],
164 [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
165 'defines': [
166 'USE_EABI_HARDFLOAT=0',
167 ],
168 }],
169 ],
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000170 'defines': [
171 'ARM_TEST',
172 ],
173 }],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000174 ],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000175 }], # _toolset=="host"
176 ['_toolset=="target"', {
177 'variables': {
178 'armcompiler': '<!($(echo ${CXX_target:-<(CXX)}) -v 2>&1 | grep -q "^Target: arm" && echo "yes" || echo "no")',
179 },
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000180 'conditions': [
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000181 ['armcompiler=="yes"', {
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000182 'conditions': [
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000183 [ 'armv7==1', {
184 'cflags': ['-march=armv7-a',],
185 }],
186 [ 'armv7==1 or armv7=="default"', {
187 'conditions': [
188 [ 'arm_neon==1', {
189 'cflags': ['-mfpu=neon',],
190 },
191 {
192 'conditions': [
193 [ 'arm_fpu!="default"', {
194 'cflags': ['-mfpu=<(arm_fpu)',],
195 }],
196 ],
197 }],
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000198 ],
199 }],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000200 [ 'arm_float_abi!="default"', {
201 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000202 }],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000203 [ 'arm_thumb==1', {
204 'cflags': ['-mthumb',],
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000205 }],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000206 [ 'arm_thumb==0', {
207 'cflags': ['-marm',],
208 }],
209 [ 'arm_test=="on"', {
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000210 'defines': [
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000211 'ARM_TEST',
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000212 ],
213 }],
214 ],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000215 }, {
216 # armcompiler=="no"
217 'conditions': [
218 [ 'armv7==1 or armv7=="default"', {
219 'defines': [
220 'CAN_USE_ARMV7_INSTRUCTIONS=1',
221 ],
222 'conditions': [
223 [ 'arm_fpu=="default"', {
224 'defines': [
225 'CAN_USE_VFP3_INSTRUCTIONS',
226 ],
227 }],
228 [ 'arm_fpu=="vfpv3-d16"', {
229 'defines': [
230 'CAN_USE_VFP3_INSTRUCTIONS',
231 ],
232 }],
233 [ 'arm_fpu=="vfpv3"', {
234 'defines': [
235 'CAN_USE_VFP3_INSTRUCTIONS',
236 'CAN_USE_VFP32DREGS',
237 ],
238 }],
239 [ 'arm_fpu=="neon" or arm_neon==1', {
240 'defines': [
241 'CAN_USE_VFP3_INSTRUCTIONS',
242 'CAN_USE_VFP32DREGS',
243 ],
244 }],
245 ],
246 }],
247 [ 'arm_float_abi=="hard"', {
248 'defines': [
249 'USE_EABI_HARDFLOAT=1',
250 ],
251 }],
252 [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
253 'defines': [
254 'USE_EABI_HARDFLOAT=0',
255 ],
256 }],
257 ],
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000258 'defines': [
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000259 'ARM_TEST',
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000260 ],
261 }],
danno@chromium.org1fd77d52013-06-07 16:01:45 +0000262 ],
263 }], # _toolset=="target"
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000264 ],
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000265 }], # v8_target_arch=="arm"
266 ['v8_target_arch=="ia32"', {
267 'defines': [
268 'V8_TARGET_ARCH_IA32',
269 ],
270 }], # v8_target_arch=="ia32"
rossberg@chromium.org657d53b2012-07-12 11:06:03 +0000271 ['v8_target_arch=="mipsel"', {
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000272 'defines': [
273 'V8_TARGET_ARCH_MIPS',
274 ],
275 'variables': {
ulan@chromium.org2e04b582013-02-21 14:06:02 +0000276 'mipscompiler': '<!($(echo <(CXX)) -v 2>&1 | grep -q "^Target: mips" && echo "yes" || echo "no")',
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000277 },
fschneider@chromium.org7d10be52012-04-10 12:30:14 +0000278 'conditions': [
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000279 ['mipscompiler=="yes"', {
280 'target_conditions': [
281 ['_toolset=="target"', {
282 'cflags': ['-EL'],
283 'ldflags': ['-EL'],
284 'conditions': [
285 [ 'v8_use_mips_abi_hardfloat=="true"', {
286 'cflags': ['-mhard-float'],
287 'ldflags': ['-mhard-float'],
288 }, {
289 'cflags': ['-msoft-float'],
290 'ldflags': ['-msoft-float'],
291 }],
292 ['mips_arch_variant=="mips32r2"', {
293 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
294 }],
danno@chromium.org72204d52012-10-31 10:02:10 +0000295 ['mips_arch_variant=="mips32r1"', {
296 'cflags': ['-mips32', '-Wa,-mips32'],
297 }],
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000298 ['mips_arch_variant=="loongson"', {
299 'cflags': ['-mips3', '-Wa,-mips3'],
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000300 }],
301 ],
302 }],
303 ],
fschneider@chromium.org7d10be52012-04-10 12:30:14 +0000304 }],
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000305 [ 'v8_can_use_fpu_instructions=="true"', {
306 'defines': [
307 'CAN_USE_FPU_INSTRUCTIONS',
308 ],
309 }],
310 [ 'v8_use_mips_abi_hardfloat=="true"', {
311 'defines': [
312 '__mips_hard_float=1',
313 'CAN_USE_FPU_INSTRUCTIONS',
314 ],
315 }, {
316 'defines': [
317 '__mips_soft_float=1'
318 ],
319 }],
320 ['mips_arch_variant=="mips32r2"', {
321 'defines': ['_MIPS_ARCH_MIPS32R2',],
322 }],
323 ['mips_arch_variant=="loongson"', {
324 'defines': ['_MIPS_ARCH_LOONGSON',],
fschneider@chromium.org7d10be52012-04-10 12:30:14 +0000325 }],
326 ],
rossberg@chromium.org657d53b2012-07-12 11:06:03 +0000327 }], # v8_target_arch=="mipsel"
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000328 ['v8_target_arch=="x64"', {
329 'defines': [
330 'V8_TARGET_ARCH_X64',
331 ],
332 'xcode_settings': {
333 'ARCHS': [ 'x86_64' ],
334 },
335 'msvs_settings': {
336 'VCLinkerTool': {
337 'StackReserveSize': '2097152',
338 },
339 },
yangguo@chromium.org5a11aaf2012-06-20 11:29:00 +0000340 'msvs_configuration_platform': 'x64',
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000341 }], # v8_target_arch=="x64"
ulan@chromium.org2efb9002012-01-19 15:36:35 +0000342 ['OS=="win"', {
343 'defines': [
344 'WIN32',
345 ],
svenpanne@chromium.org830d30c2012-05-29 13:20:14 +0000346 'msvs_configuration_attributes': {
347 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
348 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
349 'CharacterSet': '1',
350 },
ulan@chromium.org2efb9002012-01-19 15:36:35 +0000351 }],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000352 ['OS=="win" and v8_enable_prof==1', {
353 'msvs_settings': {
354 'VCLinkerTool': {
355 'GenerateMapFile': 'true',
356 },
kmillikin@chromium.org7c2628c2011-08-10 11:27:35 +0000357 },
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000358 }],
rossberg@chromium.orgfab14982012-01-05 15:02:15 +0000359 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
360 or OS=="netbsd"', {
fschneider@chromium.org1805e212011-09-05 10:49:12 +0000361 'conditions': [
ulan@chromium.org2efb9002012-01-19 15:36:35 +0000362 [ 'v8_no_strict_aliasing==1', {
363 'cflags': [ '-fno-strict-aliasing' ],
364 }],
365 ], # conditions
fschneider@chromium.org1805e212011-09-05 10:49:12 +0000366 }],
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000367 ['OS=="solaris"', {
368 'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
369 }],
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000370 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
371 or OS=="netbsd" or OS=="mac" or OS=="android") and \
372 (v8_target_arch=="arm" or v8_target_arch=="ia32" or \
rossberg@chromium.org657d53b2012-07-12 11:06:03 +0000373 v8_target_arch=="mipsel")', {
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000374 # Check whether the host compiler and target compiler support the
375 # '-m32' option and set it if so.
376 'target_conditions': [
377 ['_toolset=="host"', {
378 'variables': {
yangguo@chromium.org304cc332012-07-24 07:59:48 +0000379 'm32flag': '<!((echo | $(echo ${CXX_host:-$(which g++)}) -m32 -E - > /dev/null 2>&1) && echo "-m32" || true)',
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000380 },
381 'cflags': [ '<(m32flag)' ],
382 'ldflags': [ '<(m32flag)' ],
383 'xcode_settings': {
384 'ARCHS': [ 'i386' ],
385 },
386 }],
387 ['_toolset=="target"', {
388 'variables': {
ulan@chromium.org2e04b582013-02-21 14:06:02 +0000389 'm32flag': '<!((echo | $(echo ${CXX_target:-<(CXX)}) -m32 -E - > /dev/null 2>&1) && echo "-m32" || true)',
verwaest@chromium.org33e09c82012-10-10 17:07:22 +0000390 'clang%': 0,
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000391 },
verwaest@chromium.org33e09c82012-10-10 17:07:22 +0000392 'conditions': [
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +0000393 ['(OS!="android" or clang==1) and \
394 nacl_target_arch!="nacl_x64"', {
verwaest@chromium.org33e09c82012-10-10 17:07:22 +0000395 'cflags': [ '<(m32flag)' ],
396 'ldflags': [ '<(m32flag)' ],
397 }],
398 ],
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000399 'xcode_settings': {
400 'ARCHS': [ 'i386' ],
401 },
402 }],
403 ],
404 }],
machenbach@chromium.orgc1789ee2013-07-05 07:09:57 +0000405 ['(OS=="linux") and (v8_target_arch=="x64")', {
406 # Check whether the host compiler and target compiler support the
407 # '-m64' option and set it if so.
408 'target_conditions': [
409 ['_toolset=="host"', {
410 'variables': {
411 'm64flag': '<!((echo | $(echo ${CXX_host:-$(which g++)}) -m64 -E - > /dev/null 2>&1) && echo "-m64" || true)',
412 },
413 'cflags': [ '<(m64flag)' ],
414 'ldflags': [ '<(m64flag)' ],
415 }],
416 ['_toolset=="target"', {
417 'variables': {
418 'm64flag': '<!((echo | $(echo ${CXX_target:-<(CXX)}) -m64 -E - > /dev/null 2>&1) && echo "-m64" || true)',
419 },
420 'cflags': [ '<(m64flag)' ],
421 'ldflags': [ '<(m64flag)' ],
422 }]
423 ],
424 }],
ulan@chromium.org0e3f88b2012-05-22 09:16:05 +0000425 ['OS=="freebsd" or OS=="openbsd"', {
426 'cflags': [ '-I/usr/local/include' ],
427 }],
428 ['OS=="netbsd"', {
429 'cflags': [ '-I/usr/pkg/include' ],
430 }],
ulan@chromium.org2efb9002012-01-19 15:36:35 +0000431 ], # conditions
ager@chromium.org5f0c45f2010-12-17 08:51:21 +0000432 'configurations': {
433 'Debug': {
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000434 'defines': [
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000435 'ENABLE_DISASSEMBLER',
436 'V8_ENABLE_CHECKS',
437 'OBJECT_PRINT',
svenpanne@chromium.orgc859c4f2012-10-15 11:51:39 +0000438 'VERIFY_HEAP',
jkummerow@chromium.orgef33a542013-10-28 18:03:37 +0000439 'DEBUG'
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000440 ],
441 'msvs_settings': {
442 'VCCLCompilerTool': {
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000443 'conditions': [
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000444 ['v8_optimized_debug==0', {
445 'Optimization': '0',
ulan@chromium.org8bfa5f42013-08-05 13:14:29 +0000446 'conditions': [
447 ['component=="shared_library"', {
448 'RuntimeLibrary': '3', # /MDd
449 }, {
450 'RuntimeLibrary': '1', # /MTd
451 }],
452 ],
453 }],
454 ['v8_optimized_debug==1', {
455 'Optimization': '1',
456 'InlineFunctionExpansion': '2',
457 'EnableIntrinsicFunctions': 'true',
458 'FavorSizeOrSpeed': '0',
459 'StringPooling': 'true',
460 'BasicRuntimeChecks': '0',
461 'conditions': [
462 ['component=="shared_library"', {
463 'RuntimeLibrary': '3', # /MDd
464 }, {
465 'RuntimeLibrary': '1', # /MTd
466 }],
467 ],
468 }],
469 ['v8_optimized_debug==2', {
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000470 'Optimization': '2',
danno@chromium.org169691d2013-07-15 08:01:13 +0000471 'InlineFunctionExpansion': '2',
472 'EnableIntrinsicFunctions': 'true',
473 'FavorSizeOrSpeed': '0',
474 'StringPooling': 'true',
475 'BasicRuntimeChecks': '0',
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000476 'conditions': [
477 ['component=="shared_library"', {
ulan@chromium.org8bfa5f42013-08-05 13:14:29 +0000478 'RuntimeLibrary': '3', #/MDd
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000479 }, {
ulan@chromium.org8bfa5f42013-08-05 13:14:29 +0000480 'RuntimeLibrary': '1', #/MTd
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000481 }],
482 ['v8_target_arch=="x64"', {
483 # TODO(2207): remove this option once the bug is fixed.
484 'WholeProgramOptimization': 'true',
485 }],
486 ],
danno@chromium.org169691d2013-07-15 08:01:13 +0000487 }],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000488 ],
489 },
490 'VCLinkerTool': {
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000491 'conditions': [
492 ['v8_optimized_debug==0', {
493 'LinkIncremental': '2',
ulan@chromium.org8bfa5f42013-08-05 13:14:29 +0000494 }],
495 ['v8_optimized_debug==1', {
496 'LinkIncremental': '2',
497 }],
498 ['v8_optimized_debug==2', {
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000499 'LinkIncremental': '1',
500 'OptimizeReferences': '2',
501 'EnableCOMDATFolding': '2',
502 }],
503 ],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000504 },
505 },
506 'conditions': [
rossberg@chromium.orgfab14982012-01-05 15:02:15 +0000507 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
svenpanne@chromium.orga8bb4d92011-10-10 13:20:40 +0000508 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
danno@chromium.org169691d2013-07-15 08:01:13 +0000509 '-Wnon-virtual-dtor', '-Woverloaded-virtual',
510 '<(wno_array_bounds)' ],
511 'conditions': [
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000512 ['v8_optimized_debug==0', {
513 'cflags!': [
514 '-O0',
515 '-O3',
516 '-O2',
517 '-O1',
518 '-Os',
519 ],
520 'cflags': [
521 '-fdata-sections',
522 '-ffunction-sections',
523 ],
524 }],
danno@chromium.org169691d2013-07-15 08:01:13 +0000525 ['v8_optimized_debug==1', {
526 'cflags!': [
527 '-O0',
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000528 '-O3', # TODO(2807) should be -O1.
danno@chromium.org169691d2013-07-15 08:01:13 +0000529 '-O2',
530 '-Os',
531 ],
532 'cflags': [
533 '-fdata-sections',
534 '-ffunction-sections',
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000535 '-O1', # TODO(2807) should be -O3.
danno@chromium.org935781b2013-07-30 11:09:46 +0000536 ],
537 }],
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000538 ['v8_optimized_debug==2', {
539 'cflags!': [
540 '-O0',
541 '-O1',
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000542 '-Os',
543 ],
544 'cflags': [
545 '-fdata-sections',
546 '-ffunction-sections',
verwaest@chromium.org32cb9b22013-08-21 11:18:12 +0000547 ],
jkummerow@chromium.orgef33a542013-10-28 18:03:37 +0000548 'defines': [
549 'OPTIMIZED_DEBUG'
550 ],
verwaest@chromium.org32cb9b22013-08-21 11:18:12 +0000551 'conditions': [
552 # TODO(crbug.com/272548): Avoid -O3 in NaCl
553 ['nacl_target_arch=="none"', {
554 'cflags': ['-O3'],
555 'cflags!': ['-O2'],
556 }, {
557 'cflags': ['-O2'],
558 'cflags!': ['-O3'],
559 }],
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000560 ],
561 }],
562 ['v8_optimized_debug!=0 and gcc_version==44 and clang==0', {
danno@chromium.org169691d2013-07-15 08:01:13 +0000563 'cflags': [
564 # Avoid crashes with gcc 4.4 in the v8 test suite.
565 '-fno-tree-vrp',
566 ],
567 }],
568 ],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000569 }],
yangguo@chromium.orga6bbcc82012-12-21 12:35:02 +0000570 ['OS=="linux" and v8_enable_backtrace==1', {
571 # Support for backtrace_symbols.
572 'ldflags': [ '-rdynamic' ],
573 }],
yangguo@chromium.org46839fb2012-08-28 09:06:19 +0000574 ['OS=="android"', {
575 'variables': {
576 'android_full_debug%': 1,
577 },
578 'conditions': [
579 ['android_full_debug==0', {
580 # Disable full debug if we want a faster v8 in a debug build.
581 # TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG.
582 'defines!': [
583 'DEBUG',
584 ],
585 }],
586 ],
587 }],
mmassi@chromium.org49a44672012-12-04 13:52:03 +0000588 ['OS=="mac"', {
589 'xcode_settings': {
danno@chromium.org169691d2013-07-15 08:01:13 +0000590 'conditions': [
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000591 ['v8_optimized_debug==0', {
danno@chromium.orgc22f2d82013-07-31 07:47:18 +0000592 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
danno@chromium.orgd3c42102013-08-01 16:58:23 +0000593 }, {
594 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
595 'GCC_STRICT_ALIASING': 'YES',
danno@chromium.org169691d2013-07-15 08:01:13 +0000596 }],
597 ],
mmassi@chromium.org49a44672012-12-04 13:52:03 +0000598 },
599 }],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000600 ],
ulan@chromium.org2efb9002012-01-19 15:36:35 +0000601 }, # Debug
ager@chromium.org5f0c45f2010-12-17 08:51:21 +0000602 'Release': {
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000603 'conditions': [
ulan@chromium.org4ad26d92013-06-12 08:25:42 +0000604 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000605 'cflags!': [
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000606 '-Os',
607 ],
608 'cflags': [
609 '-fdata-sections',
610 '-ffunction-sections',
danno@chromium.org169691d2013-07-15 08:01:13 +0000611 '<(wno_array_bounds)',
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000612 ],
613 'conditions': [
yangguo@chromium.org659ceec2012-01-26 07:37:54 +0000614 [ 'gcc_version==44 and clang==0', {
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000615 'cflags': [
616 # Avoid crashes with gcc 4.4 in the v8 test suite.
617 '-fno-tree-vrp',
618 ],
619 }],
verwaest@chromium.org32cb9b22013-08-21 11:18:12 +0000620 # TODO(crbug.com/272548): Avoid -O3 in NaCl
621 ['nacl_target_arch=="none"', {
622 'cflags': ['-O3'],
623 'cflags!': ['-O2'],
624 }, {
625 'cflags': ['-O2'],
626 'cflags!': ['-O3'],
627 }],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000628 ],
629 }],
ulan@chromium.org4ad26d92013-06-12 08:25:42 +0000630 ['OS=="android"', {
631 'cflags!': [
632 '-O3',
633 '-Os',
634 ],
635 'cflags': [
636 '-fdata-sections',
637 '-ffunction-sections',
638 '-O2',
639 ],
640 'conditions': [
641 [ 'gcc_version==44 and clang==0', {
642 'cflags': [
643 # Avoid crashes with gcc 4.4 in the v8 test suite.
644 '-fno-tree-vrp',
645 ],
646 }],
647 ],
648 }],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000649 ['OS=="mac"', {
650 'xcode_settings': {
651 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
652
653 # -fstrict-aliasing. Mainline gcc
654 # enables this at -O2 and above,
655 # but Apple gcc does not unless it
656 # is specified explicitly.
657 'GCC_STRICT_ALIASING': 'YES',
658 },
ulan@chromium.org2efb9002012-01-19 15:36:35 +0000659 }], # OS=="mac"
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000660 ['OS=="win"', {
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000661 'msvs_settings': {
662 'VCCLCompilerTool': {
663 'Optimization': '2',
664 'InlineFunctionExpansion': '2',
665 'EnableIntrinsicFunctions': 'true',
666 'FavorSizeOrSpeed': '0',
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000667 'StringPooling': 'true',
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000668 'conditions': [
danno@chromium.org169691d2013-07-15 08:01:13 +0000669 ['component=="shared_library"', {
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000670 'RuntimeLibrary': '2', #/MD
671 }, {
672 'RuntimeLibrary': '0', #/MT
673 }],
jkummerow@chromium.org7a6fc812012-06-27 11:12:38 +0000674 ['v8_target_arch=="x64"', {
675 # TODO(2207): remove this option once the bug is fixed.
676 'WholeProgramOptimization': 'true',
677 }],
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000678 ],
679 },
680 'VCLinkerTool': {
681 'LinkIncremental': '1',
682 'OptimizeReferences': '2',
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000683 'EnableCOMDATFolding': '2',
ricow@chromium.org4668a2c2011-08-29 10:41:00 +0000684 },
685 },
ulan@chromium.org2efb9002012-01-19 15:36:35 +0000686 }], # OS=="win"
687 ], # conditions
688 }, # Release
689 }, # configurations
690 }, # target_defaults
ager@chromium.org5f0c45f2010-12-17 08:51:21 +0000691}