blob: 2c7b16bc0d03051e545fba3eb430f3ade35d4c14 [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' : [
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +00009 ['skia_gpu == 1',
10 {
11 'defines': [
12 'SK_SUPPORT_GPU=1',
13 ],
14 }, {
15 'defines': [
16 'SK_SUPPORT_GPU=0',
17 ],
18 },
19 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000020 ['skia_os == "win"',
21 {
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',
41 ],
42 },
43 },
44 'configurations': {
45 'Debug': {
46 'msvs_settings': {
47 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000048 'DebugInformationFormat': '4', # editAndContiue (/ZI)
seanpaul@google.com1134f982011-09-15 14:24:33 +000049 'Optimization': '0', # optimizeDisabled (/Od)
50 'PreprocessorDefinitions': ['_DEBUG'],
51 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000052 'RuntimeTypeInfo': 'false', # /GR-
seanpaul@google.com1134f982011-09-15 14:24:33 +000053 },
54 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000055 'GenerateDebugInformation': 'true', # /DEBUG
56 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000057 },
58 },
59 },
60 'Release': {
61 'msvs_settings': {
62 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000063 'DebugInformationFormat': '3', # programDatabase (/Zi)
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000064 'Optimization': '3', # full (/Ox)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000065 'WholeProgramOptimization': 'true', #/GL
66 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000067 #'FloatingPointModel': '2', # fast (/fp:fast)
68 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000069 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000070 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000071 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
72 'RuntimeTypeInfo': 'false', # /GR-
seanpaul@google.com1134f982011-09-15 14:24:33 +000073 },
74 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000075 'GenerateDebugInformation': 'true', # /DEBUG
76 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000077 },
bungeman@google.com983297e2011-10-03 19:36:51 +000078 'VCLibrarianTool': {
79 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
80 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000081 },
82 },
83 },
borenet@google.comb7961192012-08-20 18:58:26 +000084 'conditions' : [
85 ['skia_arch_width == 64', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +000086 'msvs_configuration_platform': 'x64',
87 'msvs_settings': {
88 'VCCLCompilerTool': {
89 'WarnAsError': 'false',
90 },
91 },
borenet@google.comb7961192012-08-20 18:58:26 +000092 }],
93 ['skia_arch_width == 32', {
bsalomon@google.com57585fa2013-01-08 21:46:05 +000094 # This gypi file will be included directly into the gyp(i) files in the angle repo by
95 # our gyp_skia script. We don't want force WarnAsError on angle. So angle.gyp defines
96 # skia_building_angle=1 and here we select whether to enable WarnAsError based on that
97 # var's value. Here it defaults to 0.
98 'variables' : {
99 'skia_building_angle%': 0,
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000100 },
bsalomon@google.com57585fa2013-01-08 21:46:05 +0000101 'conditions' : [
102 ['skia_building_angle', {
103 'msvs_configuration_platform': 'Win32',
104 'msvs_settings': {
105 'VCCLCompilerTool': {
106 'WarnAsError': 'false',
107 },
108 },
109 },{ # not angle
110 'msvs_configuration_platform': 'Win32',
111 'msvs_settings': {
112 'VCCLCompilerTool': {
113 'WarnAsError': 'true',
bsalomon@google.comb58a6392013-03-21 20:29:05 +0000114 'AdditionalOptions': [
115 '/we4189', # initialized but unused var warning
116 ],
bsalomon@google.com57585fa2013-01-08 21:46:05 +0000117 },
118 },
119 }],
120 ],
borenet@google.comb7961192012-08-20 18:58:26 +0000121 }],
122 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000123 },
124 ],
125
borenet@google.com7158e6a2012-11-01 17:43:44 +0000126 ['skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000127 {
128 'defines': [
129 'SK_SAMPLES_FOR_X',
130 'SK_BUILD_FOR_UNIX',
131 ],
132 'configurations': {
133 'Debug': {
134 'cflags': ['-g']
135 },
136 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000137 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000138 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000139 },
140 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000141 'cflags': [
sugoi@google.comdfc867b2013-03-11 18:45:12 +0000142 '-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000143 '-Wall',
144 '-Wextra',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000145 # suppressions below here were added for clang
146 '-Wno-unused-parameter',
147 '-Wno-c++11-extensions'
148 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000149 'conditions' : [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000150 ['skia_warnings_as_errors == 1', {
151 'cflags': [
152 '-Werror',
153 ],
154 }],
borenet@google.coma37a5172012-08-09 20:44:32 +0000155 ['skia_arch_width == 64', {
156 'cflags': [
157 '-m64',
158 ],
159 'ldflags': [
160 '-m64',
161 ],
162 }],
163 ['skia_arch_width == 32', {
164 'cflags': [
165 '-m32',
166 ],
167 'ldflags': [
168 '-m32',
169 ],
170 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000171 [ 'skia_os == "nacl"', {
172 'defines': [
173 'SK_BUILD_FOR_NACL',
174 ],
175 'link_settings': {
176 'libraries': [
177 '-lppapi',
178 '-lppapi_cpp',
179 '-lnosys',
180 '-pthread',
181 ],
182 },
183 }, { # skia_os != "nacl"
184 'include_dirs' : [
185 '/usr/include/freetype2',
186 ],
187 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000188 ],
189 },
190 ],
191
chudy@google.combbad34d2012-08-13 14:26:36 +0000192 ['skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000193 {
humper@google.com522dbd22013-02-08 21:45:33 +0000194 'variables': {
195 'mac_sdk%': '<!(python <(DEPTH)/tools/find_mac_sdk.py 10.6)',
196 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000197 'defines': [
198 'SK_BUILD_FOR_MAC',
199 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000200 'conditions' : [
201 ['skia_arch_width == 64', {
202 'xcode_settings': {
203 'ARCHS': 'x86_64',
204 },
205 }],
206 ['skia_arch_width == 32', {
207 'xcode_settings': {
208 'ARCHS': 'i386',
humper@google.comfe0d6802013-01-07 20:28:16 +0000209 'OTHER_CPLUSPLUSFLAGS': [
210 '-Werror',
211 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000212 },
213 }],
214 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000215 'configurations': {
216 'Debug': {
217 'xcode_settings': {
218 'GCC_OPTIMIZATION_LEVEL': '0',
219 },
220 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000221 'Release': {
222 'xcode_settings': {
223 'GCC_OPTIMIZATION_LEVEL': '3',
224 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000225 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000226 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000227 },
228 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000229 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
humper@google.com522dbd22013-02-08 21:45:33 +0000230 'conditions': [
231 ['skia_osx_sdkroot==""', {
232 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
233 }, {
234 'SDKROOT': '<(skia_osx_sdkroot)', # -isysroot
235 }],
236 ],
reed@google.com0069aa52011-11-17 15:35:47 +0000237# trying to get this to work, but it needs clang I think...
238# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000239 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000240 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
241 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
242 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
243 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
244 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
245 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
246 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
247 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
248 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
249 'GCC_WARN_MISSING_PARENTHESES': 'YES',
250 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
251 'GCC_WARN_SIGN_COMPARE': 'YES',
252 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
253 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
254 'GCC_WARN_UNUSED_FUNCTION': 'YES',
255 'GCC_WARN_UNUSED_LABEL': 'YES',
256 'GCC_WARN_UNUSED_VALUE': 'YES',
257 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000258 'OTHER_CPLUSPLUSFLAGS': [
259 '-mssse3',
260 '-fvisibility=hidden',
261 '-fvisibility-inlines-hidden',
262 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000263 },
264 },
265 ],
266
chudy@google.combbad34d2012-08-13 14:26:36 +0000267 ['skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000268 {
269 'defines': [
270 'SK_BUILD_FOR_IOS',
271 ],
272 'configurations': {
273 'Debug': {
274 'xcode_settings': {
275 'GCC_OPTIMIZATION_LEVEL': '0',
276 },
277 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000278 'Release': {
279 'xcode_settings': {
280 'GCC_OPTIMIZATION_LEVEL': '3',
281 },
282 'defines': [ 'NDEBUG' ],
283 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000284 },
285 'xcode_settings': {
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000286 'ARCHS': 'armv6 armv7',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000287 'CODE_SIGNING_REQUIRED': 'NO',
288 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000289 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000290 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000291 'TARGETED_DEVICE_FAMILY': '1,2',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000292 'OTHER_CPLUSPLUSFLAGS': '-fvisibility=hidden -fvisibility-inlines-hidden',
bsalomon@google.com89dec582012-09-28 18:33:11 +0000293 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000294 },
295 },
296 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000297
298 ['skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000299 {
300 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000301 'SK_BUILD_FOR_ANDROID',
djsollen@google.com58629292011-11-03 13:08:29 +0000302 ],
303 'configurations': {
304 'Debug': {
305 'cflags': ['-g']
306 },
307 'Release': {
commit-bot@chromium.orgc8e011c2013-03-14 13:58:40 +0000308 'cflags': ['-O3'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000309 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000310 },
311 },
312 'libraries': [
313 '-lstdc++',
314 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000315 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000316 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000317 'cflags': [
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000318 '-Wall',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000319 '-fno-exceptions',
320 '-fno-rtti',
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000321 '-fstrict-aliasing',
borenet@google.comde9ac142012-07-25 15:17:03 +0000322 '-fuse-ld=gold',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000323 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000324 'conditions': [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000325 [ 'skia_warnings_as_errors == 1', {
326 'cflags': [
327 '-Werror',
328 ],
329 }],
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000330 [ 'skia_profile_enabled == 1', {
331 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
332 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000333 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000334 'cflags': [
335 '-mthumb',
336 ],
337 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000338 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000339 'variables': {
340 'arm_neon_optional%': 0,
341 },
djsollen@google.com58629292011-11-03 13:08:29 +0000342 'defines': [
343 '__ARM_ARCH__=7',
344 ],
345 'cflags': [
346 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000347 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000348 ],
349 'conditions': [
350 [ 'arm_neon == 1', {
351 'defines': [
352 '__ARM_HAVE_NEON',
353 ],
354 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000355 '-mfpu=neon',
356 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000357 'ldflags': [
358 '-march=armv7-a',
359 '-Wl,--fix-cortex-a8',
360 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000361 }],
362 [ 'arm_neon_optional == 1', {
363 'defines': [
364 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
365 ],
366 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000367 ],
368 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000369 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000370 },
371 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000372
digit@google.com1771cbf2012-01-26 21:26:40 +0000373 # We can POD-style initialization of static mutexes to avoid generating
374 # static initializers if we're using a pthread-compatible thread interface.
375 [ 'skia_os != "win"', {
376 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000377 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000378 ],
379 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000380 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000381 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
382 'xcode_settings': {
383 'SYMROOT': '<(DEPTH)/xcodebuild',
384 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000385}
386
387# Local Variables:
388# tab-width:2
389# indent-tabs-mode:nil
390# End:
391# vim: set expandtab tabstop=2 shiftwidth=2: