blob: e28985fdf09ce5d1bae008d7bd3d1a8fe57b6da7 [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',
bsalomon@google.com50c79d82013-01-08 20:31:53 +000033 'WarnAsError': 'true',
seanpaul@google.com1134f982011-09-15 14:24:33 +000034 'DebugInformationFormat': '3',
seanpaul@google.com8f78fec2011-09-16 15:47:33 +000035 '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)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000049 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000050 'Optimization': '0', # optimizeDisabled (/Od)
51 'PreprocessorDefinitions': ['_DEBUG'],
52 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000053 'ExceptionHandling': '0',
54 'RuntimeTypeInfo': 'false', # /GR-
55 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000056 },
57 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000058 'GenerateDebugInformation': 'true', # /DEBUG
59 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000060 },
61 },
62 },
63 'Release': {
64 'msvs_settings': {
65 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000066 'DebugInformationFormat': '3', # programDatabase (/Zi)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000067 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000068 'Optimization': '3', # full (/Ox)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000069 'WholeProgramOptimization': 'true', #/GL
70 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000071 #'FloatingPointModel': '2', # fast (/fp:fast)
72 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000073 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000074 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000075 'ExceptionHandling': '0',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000076 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
77 'RuntimeTypeInfo': 'false', # /GR-
78 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000079 },
80 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000081 'GenerateDebugInformation': 'true', # /DEBUG
82 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000083 },
bungeman@google.com983297e2011-10-03 19:36:51 +000084 'VCLibrarianTool': {
85 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
86 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000087 },
88 },
89 },
borenet@google.comb7961192012-08-20 18:58:26 +000090 'conditions' : [
91 ['skia_arch_width == 64', {
92 'msvs_configuration_platform': 'x64'
93 }],
94 ['skia_arch_width == 32', {
95 'msvs_configuration_platform': 'Win32',
96 }],
97 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000098 },
99 ],
100
borenet@google.com7158e6a2012-11-01 17:43:44 +0000101 ['skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000102 {
103 'defines': [
104 'SK_SAMPLES_FOR_X',
105 'SK_BUILD_FOR_UNIX',
106 ],
107 'configurations': {
108 'Debug': {
109 'cflags': ['-g']
110 },
111 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000112 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000113 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000114 },
115 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000116 'cflags': [
117 # TODO(tony): Enable -Werror once all the strict-aliasing problems
118 # are fixed.
119 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000120 '-Wall',
121 '-Wextra',
122 '-Wno-unused',
123 # 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' : [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000128 ['skia_warnings_as_errors == 1', {
129 'cflags': [
130 '-Werror',
131 ],
132 }],
borenet@google.coma37a5172012-08-09 20:44:32 +0000133 ['skia_arch_width == 64', {
134 'cflags': [
135 '-m64',
136 ],
137 'ldflags': [
138 '-m64',
139 ],
140 }],
141 ['skia_arch_width == 32', {
142 '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
chudy@google.combbad34d2012-08-13 14:26:36 +0000170 ['skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000171 {
172 'defines': [
173 'SK_BUILD_FOR_MAC',
174 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000175 'conditions' : [
176 ['skia_arch_width == 64', {
177 'xcode_settings': {
178 'ARCHS': 'x86_64',
179 },
180 }],
181 ['skia_arch_width == 32', {
182 'xcode_settings': {
183 'ARCHS': 'i386',
humper@google.comfe0d6802013-01-07 20:28:16 +0000184 'OTHER_CPLUSPLUSFLAGS': [
185 '-Werror',
186 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000187 },
188 }],
189 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000190 'configurations': {
191 'Debug': {
192 'xcode_settings': {
193 'GCC_OPTIMIZATION_LEVEL': '0',
194 },
195 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000196 'Release': {
197 'xcode_settings': {
198 'GCC_OPTIMIZATION_LEVEL': '3',
199 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000200 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000201 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000202 },
203 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000204 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
senorblanco@chromium.orgbc5cbfe2012-09-20 16:10:02 +0000205 'SDKROOT': '<(skia_osx_sdkroot)',
reed@google.com0069aa52011-11-17 15:35:47 +0000206# trying to get this to work, but it needs clang I think...
207# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000208 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000209 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
210 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
211 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
212 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
213 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
214 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
215 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
216 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
217 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
218 'GCC_WARN_MISSING_PARENTHESES': 'YES',
219 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
220 'GCC_WARN_SIGN_COMPARE': 'YES',
221 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
222 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
223 'GCC_WARN_UNUSED_FUNCTION': 'YES',
224 'GCC_WARN_UNUSED_LABEL': 'YES',
225 'GCC_WARN_UNUSED_VALUE': 'YES',
226 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000227 'OTHER_CPLUSPLUSFLAGS': [
228 '-mssse3',
229 '-fvisibility=hidden',
230 '-fvisibility-inlines-hidden',
231 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000232 },
233 },
234 ],
235
chudy@google.combbad34d2012-08-13 14:26:36 +0000236 ['skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000237 {
238 'defines': [
239 'SK_BUILD_FOR_IOS',
240 ],
241 'configurations': {
242 'Debug': {
243 'xcode_settings': {
244 'GCC_OPTIMIZATION_LEVEL': '0',
245 },
246 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000247 'Release': {
248 'xcode_settings': {
249 'GCC_OPTIMIZATION_LEVEL': '3',
250 },
251 'defines': [ 'NDEBUG' ],
252 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000253 },
254 'xcode_settings': {
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000255 'ARCHS': 'armv6 armv7',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000256 'CODE_SIGNING_REQUIRED': 'NO',
257 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000258 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000259 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000260 'TARGETED_DEVICE_FAMILY': '1,2',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000261 'OTHER_CPLUSPLUSFLAGS': '-fvisibility=hidden -fvisibility-inlines-hidden',
bsalomon@google.com89dec582012-09-28 18:33:11 +0000262 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000263 },
264 },
265 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000266
267 ['skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000268 {
269 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000270 'SK_BUILD_FOR_ANDROID',
271 'SK_BUILD_FOR_ANDROID_NDK',
272 ],
273 'configurations': {
274 'Debug': {
275 'cflags': ['-g']
276 },
277 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000278 'cflags': ['-O2'],
279 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000280 },
281 },
282 'libraries': [
283 '-lstdc++',
284 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000285 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000286 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000287 'cflags': [
288 '-fno-exceptions',
289 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000290 '-fuse-ld=gold',
291 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
292 ],
293 'include_dirs' : [
294 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
295 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
296 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
297 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
298 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000299 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000300 'conditions': [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000301 [ 'skia_warnings_as_errors == 1', {
302 'cflags': [
303 '-Werror',
304 ],
305 }],
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000306 [ 'skia_profile_enabled == 1', {
307 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
308 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000309 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000310 'ldflags': [
311 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000312 ],
313 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000314 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000315 'cflags': [
316 '-mthumb',
317 ],
318 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000319 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000320 'variables': {
321 'arm_neon_optional%': 0,
322 },
djsollen@google.com58629292011-11-03 13:08:29 +0000323 'defines': [
324 '__ARM_ARCH__=7',
325 ],
326 'cflags': [
327 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000328 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000329 ],
330 'conditions': [
331 [ 'arm_neon == 1', {
332 'defines': [
333 '__ARM_HAVE_NEON',
334 ],
335 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000336 '-mfpu=neon',
337 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000338 }],
339 [ 'arm_neon_optional == 1', {
340 'defines': [
341 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
342 ],
343 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000344 ],
345 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000346 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000347 },
348 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000349
digit@google.com1771cbf2012-01-26 21:26:40 +0000350 # We can POD-style initialization of static mutexes to avoid generating
351 # static initializers if we're using a pthread-compatible thread interface.
352 [ 'skia_os != "win"', {
353 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000354 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000355 ],
356 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000357 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000358 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
359 'xcode_settings': {
360 'SYMROOT': '<(DEPTH)/xcodebuild',
361 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000362}
363
364# Local Variables:
365# tab-width:2
366# indent-tabs-mode:nil
367# End:
368# vim: set expandtab tabstop=2 shiftwidth=2: