blob: cceb5562f9fe63b9e42b6bcaf4fa3290e42d47cc [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 }],
borenet@google.comb7961192012-08-20 18:58:26 +0000116 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000117 },
118 ],
119
borenet@google.com05d550e2013-06-11 15:52:19 +0000120 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000121 {
122 'defines': [
123 'SK_SAMPLES_FOR_X',
124 'SK_BUILD_FOR_UNIX',
125 ],
126 'configurations': {
127 'Debug': {
128 'cflags': ['-g']
129 },
130 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000131 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000132 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000133 },
134 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000135 'cflags': [
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000136 '-Wall',
137 '-Wextra',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000138 # suppressions below here were added for clang
139 '-Wno-unused-parameter',
140 '-Wno-c++11-extensions'
141 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000142 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000143 [ 'skia_warnings_as_errors', {
rmistry@google.com7cdea642012-12-05 14:56:08 +0000144 'cflags': [
145 '-Werror',
146 ],
147 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000148 [ 'skia_os == "nacl"', {
149 'defines': [
150 'SK_BUILD_FOR_NACL',
151 ],
152 'link_settings': {
153 'libraries': [
154 '-lppapi',
155 '-lppapi_cpp',
156 '-lnosys',
157 '-pthread',
158 ],
159 },
160 }, { # skia_os != "nacl"
161 'include_dirs' : [
162 '/usr/include/freetype2',
163 ],
164 }],
borenet@google.com05d550e2013-06-11 15:52:19 +0000165 [ 'skia_os == "chromeos"', {
166 'ldflags': [
167 '--sysroot=/build/<(skia_cros_target)',
168 '-lstdc++',
169 '-lm',
170 ],
171 }, {
172 'conditions': [
173 [ 'skia_arch_width == 64', {
174 'cflags': [
175 '-m64',
176 ],
177 'ldflags': [
178 '-m64',
179 ],
180 }],
181 [ 'skia_arch_width == 32', {
182 'cflags': [
183 '-m32',
184 ],
185 'ldflags': [
186 '-m32',
187 ],
188 }],
189 ],
190 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000191 ],
192 },
193 ],
194
borenet@google.coma72aef82013-03-22 13:16:06 +0000195 [ 'skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000196 {
humper@google.com522dbd22013-02-08 21:45:33 +0000197 'variables': {
198 'mac_sdk%': '<!(python <(DEPTH)/tools/find_mac_sdk.py 10.6)',
199 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000200 'defines': [
201 'SK_BUILD_FOR_MAC',
202 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000203 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000204 [ 'skia_arch_width == 64', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000205 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000206 'ARCHS': ['x86_64'],
djsollen@google.come341cb32012-06-28 16:08:05 +0000207 },
208 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000209 [ 'skia_arch_width == 32', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000210 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000211 'ARCHS': ['i386'],
borenet@google.coma72aef82013-03-22 13:16:06 +0000212 },
213 }],
214 [ 'skia_warnings_as_errors', {
215 'xcode_settings': {
humper@google.comfe0d6802013-01-07 20:28:16 +0000216 'OTHER_CPLUSPLUSFLAGS': [
217 '-Werror',
218 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000219 },
220 }],
221 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000222 'configurations': {
223 'Debug': {
224 'xcode_settings': {
225 'GCC_OPTIMIZATION_LEVEL': '0',
226 },
227 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000228 'Release': {
229 'xcode_settings': {
230 'GCC_OPTIMIZATION_LEVEL': '3',
231 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000232 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000233 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000234 },
235 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000236 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
humper@google.com522dbd22013-02-08 21:45:33 +0000237 'conditions': [
borenet@google.coma72aef82013-03-22 13:16:06 +0000238 [ 'skia_osx_sdkroot==""', {
humper@google.com522dbd22013-02-08 21:45:33 +0000239 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
240 }, {
241 'SDKROOT': '<(skia_osx_sdkroot)', # -isysroot
242 }],
243 ],
reed@google.com0069aa52011-11-17 15:35:47 +0000244# trying to get this to work, but it needs clang I think...
245# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000246 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000247 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
248 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
249 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
250 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
251 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
252 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
253 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
254 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
255 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
256 'GCC_WARN_MISSING_PARENTHESES': 'YES',
257 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
258 'GCC_WARN_SIGN_COMPARE': 'YES',
259 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
260 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
261 'GCC_WARN_UNUSED_FUNCTION': 'YES',
262 'GCC_WARN_UNUSED_LABEL': 'YES',
263 'GCC_WARN_UNUSED_VALUE': 'YES',
264 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000265 'OTHER_CPLUSPLUSFLAGS': [
266 '-mssse3',
267 '-fvisibility=hidden',
268 '-fvisibility-inlines-hidden',
269 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000270 },
271 },
272 ],
273
borenet@google.coma72aef82013-03-22 13:16:06 +0000274 [ 'skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000275 {
276 'defines': [
277 'SK_BUILD_FOR_IOS',
278 ],
borenet@google.coma72aef82013-03-22 13:16:06 +0000279 'conditions' : [
280 [ 'skia_warnings_as_errors', {
281 'xcode_settings': {
282 'OTHER_CPLUSPLUSFLAGS': [
283 '-Werror',
284 ],
285 },
286 }],
287 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000288 'configurations': {
289 'Debug': {
290 'xcode_settings': {
291 'GCC_OPTIMIZATION_LEVEL': '0',
292 },
293 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000294 'Release': {
295 'xcode_settings': {
296 'GCC_OPTIMIZATION_LEVEL': '3',
297 },
298 'defines': [ 'NDEBUG' ],
299 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000300 },
301 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000302 'ARCHS': ['armv6', 'armv7'],
caryclark@google.com867cbd82012-09-20 15:45:41 +0000303 'CODE_SIGNING_REQUIRED': 'NO',
304 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000305 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000306 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000307 'TARGETED_DEVICE_FAMILY': '1,2',
borenet@google.coma72aef82013-03-22 13:16:06 +0000308 'OTHER_CPLUSPLUSFLAGS': [
309 '-fvisibility=hidden',
310 '-fvisibility-inlines-hidden',
311 ],
bsalomon@google.com89dec582012-09-28 18:33:11 +0000312 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000313 },
314 },
315 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000316
borenet@google.coma72aef82013-03-22 13:16:06 +0000317 [ 'skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000318 {
319 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000320 'SK_BUILD_FOR_ANDROID',
djsollen@google.com58629292011-11-03 13:08:29 +0000321 ],
322 'configurations': {
323 'Debug': {
324 'cflags': ['-g']
325 },
326 'Release': {
djsollen@google.combde506c2013-04-04 19:42:51 +0000327 'cflags': ['-O2'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000328 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000329 },
330 },
331 'libraries': [
332 '-lstdc++',
333 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000334 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000335 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000336 'cflags': [
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000337 '-Wall',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000338 '-fno-exceptions',
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000339 '-fstrict-aliasing',
borenet@google.comde9ac142012-07-25 15:17:03 +0000340 '-fuse-ld=gold',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000341 ],
reed@google.come52d2912013-05-15 20:01:07 +0000342 'cflags_cc': [
343 '-fno-rtti',
344 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000345 'conditions': [
borenet@google.coma72aef82013-03-22 13:16:06 +0000346 [ 'skia_warnings_as_errors', {
rmistry@google.com7cdea642012-12-05 14:56:08 +0000347 'cflags': [
348 '-Werror',
349 ],
350 }],
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000351 [ 'skia_profile_enabled == 1', {
352 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
353 }],
djsollen@google.com52f02972013-06-03 12:10:19 +0000354 [ 'skia_shared_lib', {
355 'cflags': [
356 '-fPIC',
357 ],
358 'defines': [
359 'GR_DLL=1',
360 'GR_IMPLEMENTATION=1',
361 'SKIA_DLL',
362 'SKIA_IMPLEMENTATION=1',
363 ],
364 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000365 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000366 'cflags': [
367 '-mthumb',
368 ],
369 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000370 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000371 'variables': {
372 'arm_neon_optional%': 0,
373 },
djsollen@google.com58629292011-11-03 13:08:29 +0000374 'defines': [
375 '__ARM_ARCH__=7',
376 ],
377 'cflags': [
378 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000379 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000380 ],
381 'conditions': [
382 [ 'arm_neon == 1', {
383 'defines': [
384 '__ARM_HAVE_NEON',
385 ],
386 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000387 '-mfpu=neon',
388 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000389 'ldflags': [
390 '-march=armv7-a',
391 '-Wl,--fix-cortex-a8',
392 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000393 }],
394 [ 'arm_neon_optional == 1', {
395 'defines': [
396 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
397 ],
398 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000399 ],
400 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000401 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000402 },
403 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000404
digit@google.com1771cbf2012-01-26 21:26:40 +0000405 # We can POD-style initialization of static mutexes to avoid generating
406 # static initializers if we're using a pthread-compatible thread interface.
407 [ 'skia_os != "win"', {
408 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000409 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000410 ],
411 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000412 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000413 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
414 'xcode_settings': {
415 'SYMROOT': '<(DEPTH)/xcodebuild',
416 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000417}
418
419# Local Variables:
420# tab-width:2
421# indent-tabs-mode:nil
422# End:
423# vim: set expandtab tabstop=2 shiftwidth=2: