blob: 51865bf2d145d76df0e183e3f1791c6253b87086 [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', {
99 'msvs_configuration_platform': 'Win32',
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000100 'msvs_settings': {
101 'VCCLCompilerTool': {
102 'WarnAsError': 'true',
103 },
104 },
borenet@google.comb7961192012-08-20 18:58:26 +0000105 }],
106 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000107 },
108 ],
109
borenet@google.com7158e6a2012-11-01 17:43:44 +0000110 ['skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000111 {
112 'defines': [
113 'SK_SAMPLES_FOR_X',
114 'SK_BUILD_FOR_UNIX',
115 ],
116 'configurations': {
117 'Debug': {
118 'cflags': ['-g']
119 },
120 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000121 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000122 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000123 },
124 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000125 'cflags': [
126 # TODO(tony): Enable -Werror once all the strict-aliasing problems
127 # are fixed.
128 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000129 '-Wall',
130 '-Wextra',
131 '-Wno-unused',
132 # suppressions below here were added for clang
133 '-Wno-unused-parameter',
134 '-Wno-c++11-extensions'
135 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000136 'conditions' : [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000137 ['skia_warnings_as_errors == 1', {
138 'cflags': [
139 '-Werror',
140 ],
141 }],
borenet@google.coma37a5172012-08-09 20:44:32 +0000142 ['skia_arch_width == 64', {
143 'cflags': [
144 '-m64',
145 ],
146 'ldflags': [
147 '-m64',
148 ],
149 }],
150 ['skia_arch_width == 32', {
151 'cflags': [
152 '-m32',
153 ],
154 'ldflags': [
155 '-m32',
156 ],
157 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000158 [ 'skia_os == "nacl"', {
159 'defines': [
160 'SK_BUILD_FOR_NACL',
161 ],
162 'link_settings': {
163 'libraries': [
164 '-lppapi',
165 '-lppapi_cpp',
166 '-lnosys',
167 '-pthread',
168 ],
169 },
170 }, { # skia_os != "nacl"
171 'include_dirs' : [
172 '/usr/include/freetype2',
173 ],
174 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000175 ],
176 },
177 ],
178
chudy@google.combbad34d2012-08-13 14:26:36 +0000179 ['skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000180 {
181 'defines': [
182 'SK_BUILD_FOR_MAC',
183 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000184 'conditions' : [
185 ['skia_arch_width == 64', {
186 'xcode_settings': {
187 'ARCHS': 'x86_64',
188 },
189 }],
190 ['skia_arch_width == 32', {
191 'xcode_settings': {
192 'ARCHS': 'i386',
humper@google.comfe0d6802013-01-07 20:28:16 +0000193 'OTHER_CPLUSPLUSFLAGS': [
194 '-Werror',
195 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000196 },
197 }],
198 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000199 'configurations': {
200 'Debug': {
201 'xcode_settings': {
202 'GCC_OPTIMIZATION_LEVEL': '0',
203 },
204 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000205 'Release': {
206 'xcode_settings': {
207 'GCC_OPTIMIZATION_LEVEL': '3',
208 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000209 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000210 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000211 },
212 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000213 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
senorblanco@chromium.orgbc5cbfe2012-09-20 16:10:02 +0000214 'SDKROOT': '<(skia_osx_sdkroot)',
reed@google.com0069aa52011-11-17 15:35:47 +0000215# trying to get this to work, but it needs clang I think...
216# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000217 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000218 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
219 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
220 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
221 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
222 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
223 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
224 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
225 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
226 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
227 'GCC_WARN_MISSING_PARENTHESES': 'YES',
228 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
229 'GCC_WARN_SIGN_COMPARE': 'YES',
230 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
231 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
232 'GCC_WARN_UNUSED_FUNCTION': 'YES',
233 'GCC_WARN_UNUSED_LABEL': 'YES',
234 'GCC_WARN_UNUSED_VALUE': 'YES',
235 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000236 'OTHER_CPLUSPLUSFLAGS': [
237 '-mssse3',
238 '-fvisibility=hidden',
239 '-fvisibility-inlines-hidden',
240 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000241 },
242 },
243 ],
244
chudy@google.combbad34d2012-08-13 14:26:36 +0000245 ['skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000246 {
247 'defines': [
248 'SK_BUILD_FOR_IOS',
249 ],
250 'configurations': {
251 'Debug': {
252 'xcode_settings': {
253 'GCC_OPTIMIZATION_LEVEL': '0',
254 },
255 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000256 'Release': {
257 'xcode_settings': {
258 'GCC_OPTIMIZATION_LEVEL': '3',
259 },
260 'defines': [ 'NDEBUG' ],
261 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000262 },
263 'xcode_settings': {
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000264 'ARCHS': 'armv6 armv7',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000265 'CODE_SIGNING_REQUIRED': 'NO',
266 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000267 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000268 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000269 'TARGETED_DEVICE_FAMILY': '1,2',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000270 'OTHER_CPLUSPLUSFLAGS': '-fvisibility=hidden -fvisibility-inlines-hidden',
bsalomon@google.com89dec582012-09-28 18:33:11 +0000271 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000272 },
273 },
274 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000275
276 ['skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000277 {
278 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000279 'SK_BUILD_FOR_ANDROID',
280 'SK_BUILD_FOR_ANDROID_NDK',
281 ],
282 'configurations': {
283 'Debug': {
284 'cflags': ['-g']
285 },
286 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000287 'cflags': ['-O2'],
288 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000289 },
290 },
291 'libraries': [
292 '-lstdc++',
293 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000294 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000295 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000296 'cflags': [
297 '-fno-exceptions',
298 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000299 '-fuse-ld=gold',
300 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
301 ],
302 'include_dirs' : [
303 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
304 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
305 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
306 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
307 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000308 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000309 'conditions': [
rmistry@google.com7cdea642012-12-05 14:56:08 +0000310 [ 'skia_warnings_as_errors == 1', {
311 'cflags': [
312 '-Werror',
313 ],
314 }],
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000315 [ 'skia_profile_enabled == 1', {
316 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
317 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000318 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000319 'ldflags': [
320 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000321 ],
322 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000323 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000324 'cflags': [
325 '-mthumb',
326 ],
327 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000328 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000329 'variables': {
330 'arm_neon_optional%': 0,
331 },
djsollen@google.com58629292011-11-03 13:08:29 +0000332 'defines': [
333 '__ARM_ARCH__=7',
334 ],
335 'cflags': [
336 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000337 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000338 ],
339 'conditions': [
340 [ 'arm_neon == 1', {
341 'defines': [
342 '__ARM_HAVE_NEON',
343 ],
344 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000345 '-mfpu=neon',
346 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000347 }],
348 [ 'arm_neon_optional == 1', {
349 'defines': [
350 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
351 ],
352 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000353 ],
354 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000355 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000356 },
357 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000358
digit@google.com1771cbf2012-01-26 21:26:40 +0000359 # We can POD-style initialization of static mutexes to avoid generating
360 # static initializers if we're using a pthread-compatible thread interface.
361 [ 'skia_os != "win"', {
362 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000363 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000364 ],
365 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000366 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000367 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
368 'xcode_settings': {
369 'SYMROOT': '<(DEPTH)/xcodebuild',
370 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000371}
372
373# Local Variables:
374# tab-width:2
375# indent-tabs-mode:nil
376# End:
377# vim: set expandtab tabstop=2 shiftwidth=2: