blob: 0e1333368235875d0eea80aabcb2d050c2bfb850 [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',
robertphillips@google.comc7a37c72012-10-19 01:26:18 +00007 'SK_REDEFINE_ROOT2OVER2_TO_MAKE_ARCTOS_CONVEX',
chudy@google.combbad34d2012-08-13 14:26:36 +00008 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +00009 'conditions' : [
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000010 ['skia_gpu == 1',
11 {
12 'defines': [
13 'SK_SUPPORT_GPU=1',
14 ],
15 }, {
16 'defines': [
17 'SK_SUPPORT_GPU=0',
18 ],
19 },
20 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000021 ['skia_os == "win"',
22 {
23 'defines': [
24 'SK_BUILD_FOR_WIN32',
25 'SK_IGNORE_STDINT_DOT_H',
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000026 '_CRT_SECURE_NO_WARNINGS',
senorblanco@chromium.org5f47a392012-07-12 00:34:39 +000027 'GR_GL_FUNCTION_TYPE=__stdcall',
seanpaul@google.com1134f982011-09-15 14:24:33 +000028 ],
29 'msvs_cygwin_shell': 0,
30 'msvs_settings': {
31 'VCCLCompilerTool': {
32 'WarningLevel': '1',
seanpaul@google.com1134f982011-09-15 14:24:33 +000033 'DebugInformationFormat': '3',
seanpaul@google.com8f78fec2011-09-16 15:47:33 +000034 'AdditionalOptions': [ '/MP' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000035 },
36 'VCLinkerTool': {
37 'AdditionalDependencies': [
38 'OpenGL32.lib',
39 'usp10.lib',
40 ],
41 },
42 },
43 'configurations': {
44 'Debug': {
45 'msvs_settings': {
46 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000047 'DebugInformationFormat': '4', # editAndContiue (/ZI)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000048 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
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 'ExceptionHandling': '0',
53 'RuntimeTypeInfo': 'false', # /GR-
54 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000055 },
56 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000057 'GenerateDebugInformation': 'true', # /DEBUG
58 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000059 },
60 },
61 },
62 'Release': {
63 'msvs_settings': {
64 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000065 'DebugInformationFormat': '3', # programDatabase (/Zi)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000066 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000067 'Optimization': '3', # full (/Ox)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000068 'WholeProgramOptimization': 'true', #/GL
69 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000070 #'FloatingPointModel': '2', # fast (/fp:fast)
71 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000072 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000073 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000074 'ExceptionHandling': '0',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000075 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
76 'RuntimeTypeInfo': 'false', # /GR-
77 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000078 },
79 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000080 'GenerateDebugInformation': 'true', # /DEBUG
81 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000082 },
bungeman@google.com983297e2011-10-03 19:36:51 +000083 'VCLibrarianTool': {
84 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
85 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000086 },
87 },
88 },
borenet@google.comb7961192012-08-20 18:58:26 +000089 'conditions' : [
90 ['skia_arch_width == 64', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +000091 'msvs_configuration_platform': 'x64',
92 'msvs_settings': {
93 'VCCLCompilerTool': {
94 'WarnAsError': 'false',
95 },
96 },
borenet@google.comb7961192012-08-20 18:58:26 +000097 }],
98 ['skia_arch_width == 32', {
bsalomon@google.com57585fa2013-01-08 21:46:05 +000099 # This gypi file will be included directly into the gyp(i) files in the angle repo by
100 # our gyp_skia script. We don't want force WarnAsError on angle. So angle.gyp defines
101 # skia_building_angle=1 and here we select whether to enable WarnAsError based on that
102 # var's value. Here it defaults to 0.
103 'variables' : {
104 'skia_building_angle%': 0,
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000105 },
bsalomon@google.com57585fa2013-01-08 21:46:05 +0000106 'conditions' : [
107 ['skia_building_angle', {
108 'msvs_configuration_platform': 'Win32',
109 'msvs_settings': {
110 'VCCLCompilerTool': {
111 'WarnAsError': 'false',
112 },
113 },
114 },{ # not angle
115 'msvs_configuration_platform': 'Win32',
116 'msvs_settings': {
117 'VCCLCompilerTool': {
118 'WarnAsError': 'true',
119 },
120 },
121 }],
122 ],
borenet@google.comb7961192012-08-20 18:58:26 +0000123 }],
124 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000125 },
126 ],
127
borenet@google.com7158e6a2012-11-01 17:43:44 +0000128 ['skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000129 {
130 'defines': [
131 'SK_SAMPLES_FOR_X',
132 'SK_BUILD_FOR_UNIX',
133 ],
134 'configurations': {
135 'Debug': {
136 'cflags': ['-g']
137 },
138 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000139 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000140 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000141 },
142 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000143 'cflags': [
144 # TODO(tony): Enable -Werror once all the strict-aliasing problems
145 # are fixed.
146 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000147 '-Wall',
148 '-Wextra',
149 '-Wno-unused',
150 # suppressions below here were added for clang
151 '-Wno-unused-parameter',
152 '-Wno-c++11-extensions'
153 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000154 'conditions' : [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000155 ['skia_warnings_as_errors == 1', {
156 'cflags': [
157 '-Werror',
158 ],
159 }],
borenet@google.coma37a5172012-08-09 20:44:32 +0000160 ['skia_arch_width == 64', {
161 'cflags': [
162 '-m64',
163 ],
164 'ldflags': [
165 '-m64',
166 ],
167 }],
168 ['skia_arch_width == 32', {
169 'cflags': [
170 '-m32',
171 ],
172 'ldflags': [
173 '-m32',
174 ],
175 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000176 [ 'skia_os == "nacl"', {
177 'defines': [
178 'SK_BUILD_FOR_NACL',
179 ],
180 'link_settings': {
181 'libraries': [
182 '-lppapi',
183 '-lppapi_cpp',
184 '-lnosys',
185 '-pthread',
186 ],
187 },
188 }, { # skia_os != "nacl"
189 'include_dirs' : [
190 '/usr/include/freetype2',
191 ],
192 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000193 ],
194 },
195 ],
196
chudy@google.combbad34d2012-08-13 14:26:36 +0000197 ['skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000198 {
199 'defines': [
200 'SK_BUILD_FOR_MAC',
201 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000202 'conditions' : [
203 ['skia_arch_width == 64', {
204 'xcode_settings': {
205 'ARCHS': 'x86_64',
206 },
207 }],
208 ['skia_arch_width == 32', {
209 'xcode_settings': {
210 'ARCHS': 'i386',
humper@google.comfe0d6802013-01-07 20:28:16 +0000211 'OTHER_CPLUSPLUSFLAGS': [
212 '-Werror',
213 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000214 },
215 }],
216 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000217 'configurations': {
218 'Debug': {
219 'xcode_settings': {
220 'GCC_OPTIMIZATION_LEVEL': '0',
221 },
222 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000223 'Release': {
224 'xcode_settings': {
225 'GCC_OPTIMIZATION_LEVEL': '3',
226 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000227 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000228 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000229 },
230 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000231 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
senorblanco@chromium.orgbc5cbfe2012-09-20 16:10:02 +0000232 'SDKROOT': '<(skia_osx_sdkroot)',
reed@google.com0069aa52011-11-17 15:35:47 +0000233# trying to get this to work, but it needs clang I think...
234# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000235 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000236 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
237 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
238 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
239 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
240 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
241 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
242 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
243 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
244 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
245 'GCC_WARN_MISSING_PARENTHESES': 'YES',
246 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
247 'GCC_WARN_SIGN_COMPARE': 'YES',
248 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
249 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
250 'GCC_WARN_UNUSED_FUNCTION': 'YES',
251 'GCC_WARN_UNUSED_LABEL': 'YES',
252 'GCC_WARN_UNUSED_VALUE': 'YES',
253 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000254 'OTHER_CPLUSPLUSFLAGS': [
255 '-mssse3',
256 '-fvisibility=hidden',
257 '-fvisibility-inlines-hidden',
258 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000259 },
260 },
261 ],
262
chudy@google.combbad34d2012-08-13 14:26:36 +0000263 ['skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000264 {
265 'defines': [
266 'SK_BUILD_FOR_IOS',
267 ],
268 'configurations': {
269 'Debug': {
270 'xcode_settings': {
271 'GCC_OPTIMIZATION_LEVEL': '0',
272 },
273 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000274 'Release': {
275 'xcode_settings': {
276 'GCC_OPTIMIZATION_LEVEL': '3',
277 },
278 'defines': [ 'NDEBUG' ],
279 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000280 },
281 'xcode_settings': {
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000282 'ARCHS': 'armv6 armv7',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000283 'CODE_SIGNING_REQUIRED': 'NO',
284 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000285 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000286 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000287 'TARGETED_DEVICE_FAMILY': '1,2',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000288 'OTHER_CPLUSPLUSFLAGS': '-fvisibility=hidden -fvisibility-inlines-hidden',
bsalomon@google.com89dec582012-09-28 18:33:11 +0000289 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000290 },
291 },
292 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000293
294 ['skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000295 {
296 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000297 'SK_BUILD_FOR_ANDROID',
298 'SK_BUILD_FOR_ANDROID_NDK',
299 ],
300 'configurations': {
301 'Debug': {
302 'cflags': ['-g']
303 },
304 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000305 'cflags': ['-O2'],
306 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000307 },
308 },
309 'libraries': [
310 '-lstdc++',
311 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000312 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000313 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000314 'cflags': [
315 '-fno-exceptions',
316 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000317 '-fuse-ld=gold',
318 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
319 ],
320 'include_dirs' : [
321 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
322 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
323 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
324 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
325 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000326 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000327 'conditions': [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000328 [ 'skia_warnings_as_errors == 1', {
329 'cflags': [
330 '-Werror',
331 ],
332 }],
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000333 [ 'skia_profile_enabled == 1', {
334 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
335 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000336 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000337 'ldflags': [
338 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000339 ],
340 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000341 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000342 'cflags': [
343 '-mthumb',
344 ],
345 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000346 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000347 'variables': {
348 'arm_neon_optional%': 0,
349 },
djsollen@google.com58629292011-11-03 13:08:29 +0000350 'defines': [
351 '__ARM_ARCH__=7',
352 ],
353 'cflags': [
354 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000355 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000356 ],
357 'conditions': [
358 [ 'arm_neon == 1', {
359 'defines': [
360 '__ARM_HAVE_NEON',
361 ],
362 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000363 '-mfpu=neon',
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: