blob: 64e7c13594d1e40586b90bc6bec365239bf2bbc3 [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',
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.comd9718692013-04-22 14:56:50 +000065 'WholeProgramOptimization': 'true', #/GL
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000066 # 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
bsalomon@google.comd9718692013-04-22 14:56:50 +000076 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000077 },
bungeman@google.com983297e2011-10-03 19:36:51 +000078 'VCLibrarianTool': {
bsalomon@google.comd9718692013-04-22 14:56:50 +000079 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
bungeman@google.com983297e2011-10-03 19:36:51 +000080 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000081 },
82 },
83 },
borenet@google.comb7961192012-08-20 18:58:26 +000084 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +000085 [ 'skia_arch_width == 64', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +000086 'msvs_configuration_platform': 'x64',
borenet@google.coma72aef82013-03-22 13:16:06 +000087 }],
88 [ 'skia_arch_width == 32', {
89 'msvs_configuration_platform': 'Win32',
90 }],
91 [ 'skia_warnings_as_errors', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +000092 'msvs_settings': {
93 'VCCLCompilerTool': {
borenet@google.coma72aef82013-03-22 13:16:06 +000094 'WarnAsError': 'true',
95 'AdditionalOptions': [
96 '/we4189', # initialized but unused var warning
97 ],
bsalomon@google.com1d03ba92013-01-08 20:40:22 +000098 },
99 },
borenet@google.comb7961192012-08-20 18:58:26 +0000100 }],
borenet@google.comb7961192012-08-20 18:58:26 +0000101 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000102 },
103 ],
104
borenet@google.coma72aef82013-03-22 13:16:06 +0000105 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000106 {
107 'defines': [
108 'SK_SAMPLES_FOR_X',
109 'SK_BUILD_FOR_UNIX',
110 ],
111 'configurations': {
112 'Debug': {
113 'cflags': ['-g']
114 },
115 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000116 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000117 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000118 },
119 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000120 'cflags': [
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000121 '-Wall',
122 '-Wextra',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000123 # suppressions below here were added for clang
124 '-Wno-unused-parameter',
125 '-Wno-c++11-extensions'
126 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000127 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000128 [ 'skia_warnings_as_errors', {
rmistry@google.com7cdea642012-12-05 14:56:08 +0000129 'cflags': [
130 '-Werror',
131 ],
132 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000133 [ 'skia_arch_width == 64', {
borenet@google.coma37a5172012-08-09 20:44:32 +0000134 'cflags': [
135 '-m64',
136 ],
137 'ldflags': [
138 '-m64',
139 ],
140 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000141 [ 'skia_arch_width == 32', {
borenet@google.coma37a5172012-08-09 20:44:32 +0000142 'cflags': [
143 '-m32',
144 ],
145 'ldflags': [
146 '-m32',
147 ],
148 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000149 [ 'skia_os == "nacl"', {
150 'defines': [
151 'SK_BUILD_FOR_NACL',
152 ],
153 'link_settings': {
154 'libraries': [
155 '-lppapi',
156 '-lppapi_cpp',
157 '-lnosys',
158 '-pthread',
159 ],
160 },
161 }, { # skia_os != "nacl"
162 'include_dirs' : [
163 '/usr/include/freetype2',
164 ],
165 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000166 ],
167 },
168 ],
169
borenet@google.coma72aef82013-03-22 13:16:06 +0000170 [ 'skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000171 {
humper@google.com522dbd22013-02-08 21:45:33 +0000172 'variables': {
173 'mac_sdk%': '<!(python <(DEPTH)/tools/find_mac_sdk.py 10.6)',
174 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000175 'defines': [
176 'SK_BUILD_FOR_MAC',
177 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000178 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000179 [ 'skia_arch_width == 64', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000180 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000181 'ARCHS': ['x86_64'],
djsollen@google.come341cb32012-06-28 16:08:05 +0000182 },
183 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000184 [ 'skia_arch_width == 32', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000185 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000186 'ARCHS': ['i386'],
borenet@google.coma72aef82013-03-22 13:16:06 +0000187 },
188 }],
189 [ 'skia_warnings_as_errors', {
190 'xcode_settings': {
humper@google.comfe0d6802013-01-07 20:28:16 +0000191 'OTHER_CPLUSPLUSFLAGS': [
192 '-Werror',
193 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000194 },
195 }],
196 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000197 'configurations': {
198 'Debug': {
199 'xcode_settings': {
200 'GCC_OPTIMIZATION_LEVEL': '0',
201 },
202 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000203 'Release': {
204 'xcode_settings': {
205 'GCC_OPTIMIZATION_LEVEL': '3',
206 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000207 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000208 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000209 },
210 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000211 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
humper@google.com522dbd22013-02-08 21:45:33 +0000212 'conditions': [
borenet@google.coma72aef82013-03-22 13:16:06 +0000213 [ 'skia_osx_sdkroot==""', {
humper@google.com522dbd22013-02-08 21:45:33 +0000214 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
215 }, {
216 'SDKROOT': '<(skia_osx_sdkroot)', # -isysroot
217 }],
218 ],
reed@google.com0069aa52011-11-17 15:35:47 +0000219# trying to get this to work, but it needs clang I think...
220# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000221 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000222 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
223 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
224 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
225 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
226 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
227 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
228 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
229 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
230 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
231 'GCC_WARN_MISSING_PARENTHESES': 'YES',
232 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
233 'GCC_WARN_SIGN_COMPARE': 'YES',
234 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
235 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
236 'GCC_WARN_UNUSED_FUNCTION': 'YES',
237 'GCC_WARN_UNUSED_LABEL': 'YES',
238 'GCC_WARN_UNUSED_VALUE': 'YES',
239 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000240 'OTHER_CPLUSPLUSFLAGS': [
241 '-mssse3',
242 '-fvisibility=hidden',
243 '-fvisibility-inlines-hidden',
244 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000245 },
246 },
247 ],
248
borenet@google.coma72aef82013-03-22 13:16:06 +0000249 [ 'skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000250 {
251 'defines': [
252 'SK_BUILD_FOR_IOS',
253 ],
borenet@google.coma72aef82013-03-22 13:16:06 +0000254 'conditions' : [
255 [ 'skia_warnings_as_errors', {
256 'xcode_settings': {
257 'OTHER_CPLUSPLUSFLAGS': [
258 '-Werror',
259 ],
260 },
261 }],
262 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000263 'configurations': {
264 'Debug': {
265 'xcode_settings': {
266 'GCC_OPTIMIZATION_LEVEL': '0',
267 },
268 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000269 'Release': {
270 'xcode_settings': {
271 'GCC_OPTIMIZATION_LEVEL': '3',
272 },
273 'defines': [ 'NDEBUG' ],
274 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000275 },
276 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000277 'ARCHS': ['armv6', 'armv7'],
caryclark@google.com867cbd82012-09-20 15:45:41 +0000278 'CODE_SIGNING_REQUIRED': 'NO',
279 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000280 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000281 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000282 'TARGETED_DEVICE_FAMILY': '1,2',
borenet@google.coma72aef82013-03-22 13:16:06 +0000283 'OTHER_CPLUSPLUSFLAGS': [
284 '-fvisibility=hidden',
285 '-fvisibility-inlines-hidden',
286 ],
bsalomon@google.com89dec582012-09-28 18:33:11 +0000287 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000288 },
289 },
290 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000291
borenet@google.coma72aef82013-03-22 13:16:06 +0000292 [ 'skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000293 {
294 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000295 'SK_BUILD_FOR_ANDROID',
djsollen@google.com58629292011-11-03 13:08:29 +0000296 ],
297 'configurations': {
298 'Debug': {
299 'cflags': ['-g']
300 },
301 'Release': {
djsollen@google.combde506c2013-04-04 19:42:51 +0000302 'cflags': ['-O2'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000303 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000304 },
305 },
306 'libraries': [
307 '-lstdc++',
308 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000309 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000310 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000311 'cflags': [
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000312 '-Wall',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000313 '-fno-exceptions',
djsollen@google.comefbe8e92013-02-07 18:58:35 +0000314 '-fstrict-aliasing',
borenet@google.comde9ac142012-07-25 15:17:03 +0000315 '-fuse-ld=gold',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000316 ],
reed@google.come52d2912013-05-15 20:01:07 +0000317 'cflags_cc': [
318 '-fno-rtti',
319 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000320 'conditions': [
borenet@google.coma72aef82013-03-22 13:16:06 +0000321 [ 'skia_warnings_as_errors', {
rmistry@google.com7cdea642012-12-05 14:56:08 +0000322 'cflags': [
323 '-Werror',
324 ],
325 }],
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000326 [ 'skia_profile_enabled == 1', {
327 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
328 }],
djsollen@google.com52f02972013-06-03 12:10:19 +0000329 [ 'skia_shared_lib', {
330 'cflags': [
331 '-fPIC',
332 ],
333 'defines': [
334 'GR_DLL=1',
335 'GR_IMPLEMENTATION=1',
336 'SKIA_DLL',
337 'SKIA_IMPLEMENTATION=1',
338 ],
339 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000340 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000341 'cflags': [
342 '-mthumb',
343 ],
344 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000345 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000346 'variables': {
347 'arm_neon_optional%': 0,
348 },
djsollen@google.com58629292011-11-03 13:08:29 +0000349 'defines': [
350 '__ARM_ARCH__=7',
351 ],
352 'cflags': [
353 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000354 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000355 ],
356 'conditions': [
357 [ 'arm_neon == 1', {
358 'defines': [
359 '__ARM_HAVE_NEON',
360 ],
361 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000362 '-mfpu=neon',
363 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000364 'ldflags': [
365 '-march=armv7-a',
366 '-Wl,--fix-cortex-a8',
367 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000368 }],
369 [ 'arm_neon_optional == 1', {
370 'defines': [
371 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
372 ],
373 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000374 ],
375 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000376 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000377 },
378 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000379
digit@google.com1771cbf2012-01-26 21:26:40 +0000380 # We can POD-style initialization of static mutexes to avoid generating
381 # static initializers if we're using a pthread-compatible thread interface.
382 [ 'skia_os != "win"', {
383 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000384 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000385 ],
386 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000387 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000388 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
389 'xcode_settings': {
390 'SYMROOT': '<(DEPTH)/xcodebuild',
391 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000392}
393
394# Local Variables:
395# tab-width:2
396# indent-tabs-mode:nil
397# End:
398# vim: set expandtab tabstop=2 shiftwidth=2: