blob: 3a49f1449e44483004c57bc4b5e5dd7ca0b429bd [file] [log] [blame]
seanpaul@google.com1134f982011-09-15 14:24:33 +00001# conditions used in both common.gypi and skia.gyp in chromium
2#
3{
chudy@google.combbad34d2012-08-13 14:26:36 +00004 'defines': [
5 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
reed@google.com1f1543f2012-09-12 21:08:33 +00006# 'SK_SUPPORT_HINTING_SCALE_FACTOR',
chudy@google.combbad34d2012-08-13 14:26:36 +00007 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +00008 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +00009 [ 'skia_gpu == 1',
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000010 {
11 'defines': [
12 'SK_SUPPORT_GPU=1',
13 ],
14 }, {
15 'defines': [
16 'SK_SUPPORT_GPU=0',
17 ],
18 },
19 ],
borenet@google.coma72aef82013-03-22 13:16:06 +000020 [ 'skia_os == "win"',
seanpaul@google.com1134f982011-09-15 14:24:33 +000021 {
22 'defines': [
23 'SK_BUILD_FOR_WIN32',
24 'SK_IGNORE_STDINT_DOT_H',
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000025 '_CRT_SECURE_NO_WARNINGS',
senorblanco@chromium.org5f47a392012-07-12 00:34:39 +000026 'GR_GL_FUNCTION_TYPE=__stdcall',
seanpaul@google.com1134f982011-09-15 14:24:33 +000027 ],
28 'msvs_cygwin_shell': 0,
29 'msvs_settings': {
30 'VCCLCompilerTool': {
bsalomon@google.comb58a6392013-03-21 20:29:05 +000031 'WarningLevel': '3',
32 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000033 'DebugInformationFormat': '3',
bsalomon@google.comb58a6392013-03-21 20:29:05 +000034 'ExceptionHandling': '0',
35 'AdditionalOptions': [ '/MP', ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000036 },
37 'VCLinkerTool': {
38 'AdditionalDependencies': [
39 'OpenGL32.lib',
40 'usp10.lib',
bungeman@google.comf51e1252013-06-05 18:35:22 +000041
42 # Prior to gyp r1584, the following were included automatically.
43 'kernel32.lib',
44 'gdi32.lib',
45 'winspool.lib',
46 'comdlg32.lib',
47 'advapi32.lib',
48 'shell32.lib',
49 'ole32.lib',
50 'oleaut32.lib',
51 'user32.lib',
52 'uuid.lib',
53 'odbc32.lib',
54 'odbccp32.lib',
bsalomon@google.combbba7842013-06-06 18:34:13 +000055 'DelayImp.lib',
seanpaul@google.com1134f982011-09-15 14:24:33 +000056 ],
57 },
58 },
59 'configurations': {
60 'Debug': {
61 'msvs_settings': {
62 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000063 'DebugInformationFormat': '4', # editAndContiue (/ZI)
seanpaul@google.com1134f982011-09-15 14:24:33 +000064 'Optimization': '0', # optimizeDisabled (/Od)
65 'PreprocessorDefinitions': ['_DEBUG'],
66 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000067 'RuntimeTypeInfo': 'false', # /GR-
seanpaul@google.com1134f982011-09-15 14:24:33 +000068 },
69 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000070 'GenerateDebugInformation': 'true', # /DEBUG
71 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000072 },
73 },
74 },
75 'Release': {
76 'msvs_settings': {
77 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000078 'DebugInformationFormat': '3', # programDatabase (/Zi)
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000079 'Optimization': '3', # full (/Ox)
bsalomon@google.comd9718692013-04-22 14:56:50 +000080 'WholeProgramOptimization': 'true', #/GL
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000081 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000082 #'FloatingPointModel': '2', # fast (/fp:fast)
83 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000084 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000085 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000086 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
87 'RuntimeTypeInfo': 'false', # /GR-
seanpaul@google.com1134f982011-09-15 14:24:33 +000088 },
89 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000090 'GenerateDebugInformation': 'true', # /DEBUG
bsalomon@google.comd9718692013-04-22 14:56:50 +000091 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000092 },
bungeman@google.com983297e2011-10-03 19:36:51 +000093 'VCLibrarianTool': {
bsalomon@google.comd9718692013-04-22 14:56:50 +000094 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
bungeman@google.com983297e2011-10-03 19:36:51 +000095 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000096 },
97 },
98 },
borenet@google.comb7961192012-08-20 18:58:26 +000099 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000100 [ 'skia_arch_width == 64', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000101 'msvs_configuration_platform': 'x64',
borenet@google.coma72aef82013-03-22 13:16:06 +0000102 }],
103 [ 'skia_arch_width == 32', {
104 'msvs_configuration_platform': 'Win32',
105 }],
106 [ 'skia_warnings_as_errors', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000107 'msvs_settings': {
108 'VCCLCompilerTool': {
borenet@google.coma72aef82013-03-22 13:16:06 +0000109 'WarnAsError': 'true',
110 'AdditionalOptions': [
111 '/we4189', # initialized but unused var warning
112 ],
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000113 },
114 },
borenet@google.comb7961192012-08-20 18:58:26 +0000115 }],
commit-bot@chromium.org5a6c2d82013-06-14 17:10:09 +0000116 [ 'skia_win_exceptions', {
117 'msvs_settings': {
118 'VCCLCompilerTool': {
119 'AdditionalOptions': [
120 '/EHsc',
121 ],
122 },
123 },
124 }],
borenet@google.comb7961192012-08-20 18:58:26 +0000125 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000126 },
127 ],
128
borenet@google.com05d550e2013-06-11 15:52:19 +0000129 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000130 {
131 'defines': [
132 'SK_SAMPLES_FOR_X',
133 'SK_BUILD_FOR_UNIX',
134 ],
135 'configurations': {
136 'Debug': {
137 'cflags': ['-g']
138 },
139 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000140 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000141 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000142 },
143 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000144 'cflags': [
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000145 '-Wall',
146 '-Wextra',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000147 # suppressions below here were added for clang
148 '-Wno-unused-parameter',
149 '-Wno-c++11-extensions'
150 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000151 'conditions' : [
zachr@google.com28c27c82013-06-20 17:15:05 +0000152 [ 'skia_shared_lib', {
153 'cflags': [
154 '-fPIC',
155 ],
156 'defines': [
157 'GR_DLL=1',
158 'GR_IMPLEMENTATION=1',
159 'SKIA_DLL',
160 'SKIA_IMPLEMENTATION=1',
161 ],
162 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000163 [ 'skia_warnings_as_errors', {
rmistry@google.com7cdea642012-12-05 14:56:08 +0000164 'cflags': [
165 '-Werror',
166 ],
167 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000168 [ 'skia_os == "nacl"', {
169 'defines': [
170 'SK_BUILD_FOR_NACL',
171 ],
172 'link_settings': {
173 'libraries': [
174 '-lppapi',
175 '-lppapi_cpp',
176 '-lnosys',
177 '-pthread',
178 ],
179 },
180 }, { # skia_os != "nacl"
181 'include_dirs' : [
182 '/usr/include/freetype2',
183 ],
184 }],
borenet@google.com05d550e2013-06-11 15:52:19 +0000185 [ 'skia_os == "chromeos"', {
186 'ldflags': [
borenet@google.com05d550e2013-06-11 15:52:19 +0000187 '-lstdc++',
188 '-lm',
189 ],
190 }, {
191 'conditions': [
192 [ 'skia_arch_width == 64', {
193 'cflags': [
194 '-m64',
195 ],
196 'ldflags': [
197 '-m64',
198 ],
199 }],
200 [ 'skia_arch_width == 32', {
201 'cflags': [
202 '-m32',
203 ],
204 'ldflags': [
205 '-m32',
206 ],
207 }],
208 ],
209 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000210 ],
211 },
212 ],
213
borenet@google.coma72aef82013-03-22 13:16:06 +0000214 [ 'skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000215 {
humper@google.com522dbd22013-02-08 21:45:33 +0000216 'variables': {
217 'mac_sdk%': '<!(python <(DEPTH)/tools/find_mac_sdk.py 10.6)',
218 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000219 'defines': [
220 'SK_BUILD_FOR_MAC',
221 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000222 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000223 [ 'skia_arch_width == 64', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000224 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000225 'ARCHS': ['x86_64'],
djsollen@google.come341cb32012-06-28 16:08:05 +0000226 },
227 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000228 [ 'skia_arch_width == 32', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000229 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000230 'ARCHS': ['i386'],
borenet@google.coma72aef82013-03-22 13:16:06 +0000231 },
232 }],
233 [ 'skia_warnings_as_errors', {
234 'xcode_settings': {
humper@google.comfe0d6802013-01-07 20:28:16 +0000235 'OTHER_CPLUSPLUSFLAGS': [
236 '-Werror',
237 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000238 },
239 }],
240 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000241 'configurations': {
242 'Debug': {
243 'xcode_settings': {
244 'GCC_OPTIMIZATION_LEVEL': '0',
245 },
246 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000247 'Release': {
248 'xcode_settings': {
249 'GCC_OPTIMIZATION_LEVEL': '3',
250 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000251 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000252 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000253 },
254 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000255 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
humper@google.com522dbd22013-02-08 21:45:33 +0000256 'conditions': [
borenet@google.coma72aef82013-03-22 13:16:06 +0000257 [ 'skia_osx_sdkroot==""', {
humper@google.com522dbd22013-02-08 21:45:33 +0000258 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
259 }, {
260 'SDKROOT': '<(skia_osx_sdkroot)', # -isysroot
261 }],
262 ],
reed@google.com0069aa52011-11-17 15:35:47 +0000263# trying to get this to work, but it needs clang I think...
264# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000265 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000266 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
267 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
268 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
269 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
270 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
271 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
272 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
273 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
274 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
275 'GCC_WARN_MISSING_PARENTHESES': 'YES',
276 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
277 'GCC_WARN_SIGN_COMPARE': 'YES',
278 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
279 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
280 'GCC_WARN_UNUSED_FUNCTION': 'YES',
281 'GCC_WARN_UNUSED_LABEL': 'YES',
282 'GCC_WARN_UNUSED_VALUE': 'YES',
283 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000284 'OTHER_CPLUSPLUSFLAGS': [
285 '-mssse3',
286 '-fvisibility=hidden',
287 '-fvisibility-inlines-hidden',
288 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000289 },
290 },
291 ],
292
borenet@google.coma72aef82013-03-22 13:16:06 +0000293 [ 'skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000294 {
295 'defines': [
296 'SK_BUILD_FOR_IOS',
297 ],
borenet@google.coma72aef82013-03-22 13:16:06 +0000298 'conditions' : [
299 [ 'skia_warnings_as_errors', {
300 'xcode_settings': {
301 'OTHER_CPLUSPLUSFLAGS': [
302 '-Werror',
303 ],
304 },
305 }],
306 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000307 'configurations': {
308 'Debug': {
309 'xcode_settings': {
310 'GCC_OPTIMIZATION_LEVEL': '0',
311 },
312 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000313 'Release': {
314 'xcode_settings': {
315 'GCC_OPTIMIZATION_LEVEL': '3',
316 },
317 'defines': [ 'NDEBUG' ],
318 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000319 },
320 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000321 'ARCHS': ['armv6', 'armv7'],
caryclark@google.com867cbd82012-09-20 15:45:41 +0000322 'CODE_SIGNING_REQUIRED': 'NO',
323 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000324 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000325 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000326 'TARGETED_DEVICE_FAMILY': '1,2',
borenet@google.coma72aef82013-03-22 13:16:06 +0000327 'OTHER_CPLUSPLUSFLAGS': [
328 '-fvisibility=hidden',
329 '-fvisibility-inlines-hidden',
330 ],
bsalomon@google.com89dec582012-09-28 18:33:11 +0000331 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000332 },
333 },
334 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000335
borenet@google.coma72aef82013-03-22 13:16:06 +0000336 [ 'skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000337 {
338 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000339 'SK_BUILD_FOR_ANDROID',
djsollen@google.com58629292011-11-03 13:08:29 +0000340 ],
341 'configurations': {
342 'Debug': {
343 'cflags': ['-g']
344 },
345 'Release': {
djsollen@google.combde506c2013-04-04 19:42:51 +0000346 'cflags': ['-O2'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000347 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000348 },
349 },
350 'libraries': [
351 '-lstdc++',
352 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000353 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000354 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000355 'cflags': [
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000356 '-Wall',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000357 '-fno-exceptions',
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000358 '-fstrict-aliasing',
borenet@google.comde9ac142012-07-25 15:17:03 +0000359 '-fuse-ld=gold',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000360 ],
reed@google.come52d2912013-05-15 20:01:07 +0000361 'cflags_cc': [
362 '-fno-rtti',
363 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000364 'conditions': [
borenet@google.coma72aef82013-03-22 13:16:06 +0000365 [ 'skia_warnings_as_errors', {
rmistry@google.com7cdea642012-12-05 14:56:08 +0000366 'cflags': [
367 '-Werror',
368 ],
369 }],
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000370 [ 'skia_profile_enabled == 1', {
371 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
372 }],
djsollen@google.com52f02972013-06-03 12:10:19 +0000373 [ 'skia_shared_lib', {
374 'cflags': [
375 '-fPIC',
376 ],
377 'defines': [
378 'GR_DLL=1',
379 'GR_IMPLEMENTATION=1',
380 'SKIA_DLL',
381 'SKIA_IMPLEMENTATION=1',
382 ],
383 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000384 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000385 'cflags': [
386 '-mthumb',
387 ],
388 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000389 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000390 'variables': {
391 'arm_neon_optional%': 0,
392 },
djsollen@google.com58629292011-11-03 13:08:29 +0000393 'defines': [
394 '__ARM_ARCH__=7',
395 ],
396 'cflags': [
397 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000398 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000399 ],
400 'conditions': [
401 [ 'arm_neon == 1', {
402 'defines': [
403 '__ARM_HAVE_NEON',
404 ],
405 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000406 '-mfpu=neon',
407 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000408 'ldflags': [
409 '-march=armv7-a',
410 '-Wl,--fix-cortex-a8',
411 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000412 }],
413 [ 'arm_neon_optional == 1', {
414 'defines': [
415 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
416 ],
417 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000418 ],
419 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000420 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000421 },
422 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000423
digit@google.com1771cbf2012-01-26 21:26:40 +0000424 # We can POD-style initialization of static mutexes to avoid generating
425 # static initializers if we're using a pthread-compatible thread interface.
426 [ 'skia_os != "win"', {
427 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000428 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000429 ],
430 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000431 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000432 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
433 'xcode_settings': {
434 'SYMROOT': '<(DEPTH)/xcodebuild',
435 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000436}
437
438# Local Variables:
439# tab-width:2
440# indent-tabs-mode:nil
441# End:
442# vim: set expandtab tabstop=2 shiftwidth=2: