blob: e379f27b9ee8af5834eeaaa1edc4b2f5af413811 [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': {
31 'WarningLevel': '1',
seanpaul@google.com1134f982011-09-15 14:24:33 +000032 'DebugInformationFormat': '3',
seanpaul@google.com8f78fec2011-09-16 15:47:33 +000033 'AdditionalOptions': [ '/MP' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000034 },
35 'VCLinkerTool': {
36 'AdditionalDependencies': [
37 'OpenGL32.lib',
38 'usp10.lib',
39 ],
40 },
41 },
42 'configurations': {
43 'Debug': {
44 'msvs_settings': {
45 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000046 'DebugInformationFormat': '4', # editAndContiue (/ZI)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000047 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000048 'Optimization': '0', # optimizeDisabled (/Od)
49 'PreprocessorDefinitions': ['_DEBUG'],
50 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000051 'ExceptionHandling': '0',
52 'RuntimeTypeInfo': 'false', # /GR-
53 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000054 },
55 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000056 'GenerateDebugInformation': 'true', # /DEBUG
57 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000058 },
59 },
60 },
61 'Release': {
62 'msvs_settings': {
63 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000064 'DebugInformationFormat': '3', # programDatabase (/Zi)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000065 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000066 'Optimization': '3', # full (/Ox)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000067 'WholeProgramOptimization': 'true', #/GL
68 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000069 #'FloatingPointModel': '2', # fast (/fp:fast)
70 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000071 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000072 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000073 'ExceptionHandling': '0',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000074 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
75 'RuntimeTypeInfo': 'false', # /GR-
76 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000077 },
78 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000079 'GenerateDebugInformation': 'true', # /DEBUG
80 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000081 },
bungeman@google.com983297e2011-10-03 19:36:51 +000082 'VCLibrarianTool': {
83 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
84 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000085 },
86 },
87 },
borenet@google.comb7961192012-08-20 18:58:26 +000088 'conditions' : [
89 ['skia_arch_width == 64', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +000090 'msvs_configuration_platform': 'x64',
91 'msvs_settings': {
92 'VCCLCompilerTool': {
93 'WarnAsError': 'false',
94 },
95 },
borenet@google.comb7961192012-08-20 18:58:26 +000096 }],
97 ['skia_arch_width == 32', {
bsalomon@google.com57585fa2013-01-08 21:46:05 +000098 # This gypi file will be included directly into the gyp(i) files in the angle repo by
99 # our gyp_skia script. We don't want force WarnAsError on angle. So angle.gyp defines
100 # skia_building_angle=1 and here we select whether to enable WarnAsError based on that
101 # var's value. Here it defaults to 0.
102 'variables' : {
103 'skia_building_angle%': 0,
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000104 },
bsalomon@google.com57585fa2013-01-08 21:46:05 +0000105 'conditions' : [
106 ['skia_building_angle', {
107 'msvs_configuration_platform': 'Win32',
108 'msvs_settings': {
109 'VCCLCompilerTool': {
110 'WarnAsError': 'false',
111 },
112 },
113 },{ # not angle
114 'msvs_configuration_platform': 'Win32',
115 'msvs_settings': {
116 'VCCLCompilerTool': {
117 'WarnAsError': 'true',
118 },
119 },
120 }],
121 ],
borenet@google.comb7961192012-08-20 18:58:26 +0000122 }],
123 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000124 },
125 ],
126
borenet@google.com7158e6a2012-11-01 17:43:44 +0000127 ['skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000128 {
129 'defines': [
130 'SK_SAMPLES_FOR_X',
131 'SK_BUILD_FOR_UNIX',
132 ],
133 'configurations': {
134 'Debug': {
135 'cflags': ['-g']
136 },
137 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000138 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000139 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000140 },
141 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000142 'cflags': [
143 # TODO(tony): Enable -Werror once all the strict-aliasing problems
144 # are fixed.
145 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000146 '-Wall',
147 '-Wextra',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000148 # suppressions below here were added for clang
149 '-Wno-unused-parameter',
150 '-Wno-c++11-extensions'
151 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000152 'conditions' : [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000153 ['skia_warnings_as_errors == 1', {
154 'cflags': [
155 '-Werror',
156 ],
157 }],
borenet@google.coma37a5172012-08-09 20:44:32 +0000158 ['skia_arch_width == 64', {
159 'cflags': [
160 '-m64',
161 ],
162 'ldflags': [
163 '-m64',
164 ],
165 }],
166 ['skia_arch_width == 32', {
167 'cflags': [
168 '-m32',
169 ],
170 'ldflags': [
171 '-m32',
172 ],
173 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000174 [ 'skia_os == "nacl"', {
175 'defines': [
176 'SK_BUILD_FOR_NACL',
177 ],
178 'link_settings': {
179 'libraries': [
180 '-lppapi',
181 '-lppapi_cpp',
182 '-lnosys',
183 '-pthread',
184 ],
185 },
186 }, { # skia_os != "nacl"
187 'include_dirs' : [
188 '/usr/include/freetype2',
189 ],
190 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000191 ],
192 },
193 ],
194
chudy@google.combbad34d2012-08-13 14:26:36 +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' : [
204 ['skia_arch_width == 64', {
205 'xcode_settings': {
206 'ARCHS': 'x86_64',
207 },
208 }],
209 ['skia_arch_width == 32', {
210 'xcode_settings': {
211 'ARCHS': 'i386',
humper@google.comfe0d6802013-01-07 20:28:16 +0000212 'OTHER_CPLUSPLUSFLAGS': [
213 '-Werror',
214 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000215 },
216 }],
217 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000218 'configurations': {
219 'Debug': {
220 'xcode_settings': {
221 'GCC_OPTIMIZATION_LEVEL': '0',
222 },
223 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000224 'Release': {
225 'xcode_settings': {
226 'GCC_OPTIMIZATION_LEVEL': '3',
227 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000228 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000229 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000230 },
231 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000232 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
humper@google.com522dbd22013-02-08 21:45:33 +0000233 'conditions': [
234 ['skia_osx_sdkroot==""', {
235 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
236 }, {
237 'SDKROOT': '<(skia_osx_sdkroot)', # -isysroot
238 }],
239 ],
reed@google.com0069aa52011-11-17 15:35:47 +0000240# trying to get this to work, but it needs clang I think...
241# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000242 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000243 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
244 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
245 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
246 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
247 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
248 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
249 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
250 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
251 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
252 'GCC_WARN_MISSING_PARENTHESES': 'YES',
253 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
254 'GCC_WARN_SIGN_COMPARE': 'YES',
255 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
256 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
257 'GCC_WARN_UNUSED_FUNCTION': 'YES',
258 'GCC_WARN_UNUSED_LABEL': 'YES',
259 'GCC_WARN_UNUSED_VALUE': 'YES',
260 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000261 'OTHER_CPLUSPLUSFLAGS': [
262 '-mssse3',
263 '-fvisibility=hidden',
264 '-fvisibility-inlines-hidden',
265 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000266 },
267 },
268 ],
269
chudy@google.combbad34d2012-08-13 14:26:36 +0000270 ['skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000271 {
272 'defines': [
273 'SK_BUILD_FOR_IOS',
274 ],
275 'configurations': {
276 'Debug': {
277 'xcode_settings': {
278 'GCC_OPTIMIZATION_LEVEL': '0',
279 },
280 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000281 'Release': {
282 'xcode_settings': {
283 'GCC_OPTIMIZATION_LEVEL': '3',
284 },
285 'defines': [ 'NDEBUG' ],
286 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000287 },
288 'xcode_settings': {
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000289 'ARCHS': 'armv6 armv7',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000290 'CODE_SIGNING_REQUIRED': 'NO',
291 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000292 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000293 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000294 'TARGETED_DEVICE_FAMILY': '1,2',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000295 'OTHER_CPLUSPLUSFLAGS': '-fvisibility=hidden -fvisibility-inlines-hidden',
bsalomon@google.com89dec582012-09-28 18:33:11 +0000296 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000297 },
298 },
299 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000300
301 ['skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000302 {
303 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000304 'SK_BUILD_FOR_ANDROID',
305 'SK_BUILD_FOR_ANDROID_NDK',
306 ],
307 'configurations': {
308 'Debug': {
309 'cflags': ['-g']
310 },
311 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000312 'cflags': ['-O2'],
313 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000314 },
315 },
316 'libraries': [
317 '-lstdc++',
318 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000319 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000320 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000321 'cflags': [
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000322 '-Wall',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000323 '-fno-exceptions',
324 '-fno-rtti',
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000325 '-fstrict-aliasing',
borenet@google.comde9ac142012-07-25 15:17:03 +0000326 '-fuse-ld=gold',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000327 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000328 'conditions': [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000329 [ 'skia_warnings_as_errors == 1', {
330 'cflags': [
331 '-Werror',
332 ],
333 }],
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000334 [ 'skia_profile_enabled == 1', {
335 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
336 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000337 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000338 'cflags': [
339 '-mthumb',
340 ],
341 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000342 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000343 'variables': {
344 'arm_neon_optional%': 0,
345 },
djsollen@google.com58629292011-11-03 13:08:29 +0000346 'defines': [
347 '__ARM_ARCH__=7',
348 ],
349 'cflags': [
350 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000351 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000352 ],
353 'conditions': [
354 [ 'arm_neon == 1', {
355 'defines': [
356 '__ARM_HAVE_NEON',
357 ],
358 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000359 '-mfpu=neon',
360 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000361 'ldflags': [
362 '-march=armv7-a',
363 '-Wl,--fix-cortex-a8',
364 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000365 }],
366 [ 'arm_neon_optional == 1', {
367 'defines': [
368 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
369 ],
370 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000371 ],
372 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000373 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000374 },
375 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000376
digit@google.com1771cbf2012-01-26 21:26:40 +0000377 # We can POD-style initialization of static mutexes to avoid generating
378 # static initializers if we're using a pthread-compatible thread interface.
379 [ 'skia_os != "win"', {
380 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000381 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000382 ],
383 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000384 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000385 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
386 'xcode_settings': {
387 'SYMROOT': '<(DEPTH)/xcodebuild',
388 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000389}
390
391# Local Variables:
392# tab-width:2
393# indent-tabs-mode:nil
394# End:
395# vim: set expandtab tabstop=2 shiftwidth=2: