blob: dff7ef0590040344135854b6e37118f681092bed [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)',
mtklein@google.comdad70702013-11-20 18:06:10 +00006 'SK_SUPPORT_GPU=<(skia_gpu)',
7 'SK_SUPPORT_OPENCL=<(skia_opencl)',
commit-bot@chromium.orgae796122014-03-12 17:05:46 +00008 'SK_FORCE_DISTANCEFIELD_FONTS=<(skia_force_distancefield_fonts)',
chudy@google.combbad34d2012-08-13 14:26:36 +00009 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000010 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +000011 [ 'skia_os == "win"',
seanpaul@google.com1134f982011-09-15 14:24:33 +000012 {
13 'defines': [
14 'SK_BUILD_FOR_WIN32',
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000015 '_CRT_SECURE_NO_WARNINGS',
senorblanco@chromium.org5f47a392012-07-12 00:34:39 +000016 'GR_GL_FUNCTION_TYPE=__stdcall',
seanpaul@google.com1134f982011-09-15 14:24:33 +000017 ],
18 'msvs_cygwin_shell': 0,
19 'msvs_settings': {
20 'VCCLCompilerTool': {
bsalomon@google.comb58a6392013-03-21 20:29:05 +000021 'WarningLevel': '3',
22 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000023 'DebugInformationFormat': '3',
bsalomon@google.comb58a6392013-03-21 20:29:05 +000024 'ExceptionHandling': '0',
25 'AdditionalOptions': [ '/MP', ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000026 },
27 'VCLinkerTool': {
28 'AdditionalDependencies': [
29 'OpenGL32.lib',
30 'usp10.lib',
bungeman@google.comf51e1252013-06-05 18:35:22 +000031
32 # Prior to gyp r1584, the following were included automatically.
33 'kernel32.lib',
34 'gdi32.lib',
35 'winspool.lib',
36 'comdlg32.lib',
37 'advapi32.lib',
38 'shell32.lib',
39 'ole32.lib',
40 'oleaut32.lib',
41 'user32.lib',
42 'uuid.lib',
43 'odbc32.lib',
44 'odbccp32.lib',
bsalomon@google.combbba7842013-06-06 18:34:13 +000045 'DelayImp.lib',
seanpaul@google.com1134f982011-09-15 14:24:33 +000046 ],
47 },
48 },
49 'configurations': {
50 'Debug': {
51 'msvs_settings': {
52 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000053 'DebugInformationFormat': '4', # editAndContiue (/ZI)
seanpaul@google.com1134f982011-09-15 14:24:33 +000054 'Optimization': '0', # optimizeDisabled (/Od)
55 'PreprocessorDefinitions': ['_DEBUG'],
56 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000057 'RuntimeTypeInfo': 'false', # /GR-
seanpaul@google.com1134f982011-09-15 14:24:33 +000058 },
59 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000060 'GenerateDebugInformation': 'true', # /DEBUG
61 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000062 },
63 },
64 },
65 'Release': {
66 'msvs_settings': {
67 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000068 'DebugInformationFormat': '3', # programDatabase (/Zi)
commit-bot@chromium.org06b38642013-06-20 20:28:54 +000069 'Optimization': '<(skia_release_optimization_level)',
bsalomon@google.comd9718692013-04-22 14:56:50 +000070 'WholeProgramOptimization': 'true', #/GL
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000071 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000072 #'FloatingPointModel': '2', # fast (/fp:fast)
73 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000074 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000075 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000076 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
77 'RuntimeTypeInfo': 'false', # /GR-
seanpaul@google.com1134f982011-09-15 14:24:33 +000078 },
79 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000080 'GenerateDebugInformation': 'true', # /DEBUG
bsalomon@google.comd9718692013-04-22 14:56:50 +000081 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000082 },
bungeman@google.com983297e2011-10-03 19:36:51 +000083 'VCLibrarianTool': {
bsalomon@google.comd9718692013-04-22 14:56:50 +000084 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
bungeman@google.com983297e2011-10-03 19:36:51 +000085 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000086 },
87 },
88 },
borenet@google.comb7961192012-08-20 18:58:26 +000089 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +000090 [ 'skia_arch_width == 64', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +000091 'msvs_configuration_platform': 'x64',
borenet@google.coma72aef82013-03-22 13:16:06 +000092 }],
93 [ 'skia_arch_width == 32', {
94 'msvs_configuration_platform': 'Win32',
95 }],
96 [ 'skia_warnings_as_errors', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +000097 'msvs_settings': {
98 'VCCLCompilerTool': {
borenet@google.coma72aef82013-03-22 13:16:06 +000099 'WarnAsError': 'true',
100 'AdditionalOptions': [
101 '/we4189', # initialized but unused var warning
102 ],
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000103 },
104 },
borenet@google.comb7961192012-08-20 18:58:26 +0000105 }],
commit-bot@chromium.org5a6c2d82013-06-14 17:10:09 +0000106 [ 'skia_win_exceptions', {
107 'msvs_settings': {
108 'VCCLCompilerTool': {
109 'AdditionalOptions': [
110 '/EHsc',
111 ],
112 },
113 },
114 }],
borenet@google.comb7961192012-08-20 18:58:26 +0000115 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000116 },
117 ],
118
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000119 # The following section is common to linux + derivatives and android
120 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]',
121 {
mtklein@google.comf1077f92013-11-20 15:13:49 +0000122 'cflags': [
mtklein@google.comdad70702013-11-20 18:06:10 +0000123 '-g',
mtklein@google.comf1077f92013-11-20 15:13:49 +0000124 '-fno-exceptions',
125 '-fstrict-aliasing',
mtklein@google.comdad70702013-11-20 18:06:10 +0000126
mtklein@google.comf1077f92013-11-20 15:13:49 +0000127 '-Wall',
128 '-Wextra',
129 '-Winit-self',
130 '-Wpointer-arith',
131
132 '-Wno-unused-parameter',
mtklein@google.comf1077f92013-11-20 15:13:49 +0000133 ],
134 'cflags_cc': [
135 '-fno-rtti',
136 '-Wnon-virtual-dtor',
137 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000138 'conditions': [
commit-bot@chromium.org93f5e512014-02-17 15:22:26 +0000139 [ 'skia_android_framework==0', {
140 'cflags': [
141 # This flag is not supported by Android build system.
142 '-Wno-c++11-extensions',
143 ],
144 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000145 [ 'skia_warnings_as_errors', {
146 'cflags': [
147 '-Werror',
148 ],
149 }],
commit-bot@chromium.org35d48722014-02-13 18:36:36 +0000150 # For profiling; reveals some costs, exaggerates others (e.g. trivial setters & getters).
151 [ 'skia_disable_inlining', {
152 'cflags': [
153 '-fno-inline',
154 '-fno-default-inline',
155 '-finline-limit=0',
156 '-fno-omit-frame-pointer',
157 ],
158 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000159 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
160 'cflags': [
161 '-mthumb',
162 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000163 # The --fix-cortex-a8 switch enables a link-time workaround for
164 # an erratum in certain Cortex-A8 processors. The workaround is
165 # enabled by default if you target the ARM v7-A arch profile.
166 # It can be enabled otherwise by specifying --fix-cortex-a8, or
167 # disabled unconditionally by specifying --no-fix-cortex-a8.
168 #
169 # The erratum only affects Thumb-2 code.
170 'conditions': [
171 [ 'arm_version < 7', {
172 'ldflags': [
173 '-Wl,--fix-cortex-a8',
174 ],
175 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000176 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000177 }],
178 [ 'skia_arch_type == "arm" and arm_version >= 7', {
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000179 'cflags': [
180 '-march=armv7-a',
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000181 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000182 'ldflags': [
183 '-march=armv7-a',
184 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000185 'conditions': [
186 [ 'arm_neon == 1', {
187 'defines': [
188 '__ARM_HAVE_NEON',
189 ],
190 'cflags': [
191 '-mfpu=neon',
192 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000193 }],
194 [ 'arm_neon_optional == 1', {
195 'defines': [
196 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
197 ],
198 }],
borenet@google.come2b90372013-07-11 18:46:30 +0000199 [ 'skia_os != "chromeos"', {
200 'cflags': [
201 '-mfloat-abi=softfp',
202 ],
203 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000204 ],
205 }],
206 ],
207 },
208 ],
209
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000210 ['skia_android_framework', {
211 'cflags': [
212 # Skia does not enforce this usage pattern so we disable it here to avoid
213 # unecessary log spew when building
214 '-Wno-unused-parameter',
215
216 # Android's -D_FORTIFY_SOURCE=2 extensions are incompatibile with SkString.
217 # Revert to -D_FORTIFY_SOURCE=1
218 '-U_FORTIFY_SOURCE',
219 '-D_FORTIFY_SOURCE=1',
220 ],
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000221 'cflags!': [
222 '-g',
223 '-march=armv7-a',
224 '-mthumb',
225 '-mfpu=neon',
226 '-mfloat-abi=softfp',
227 ],
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000228 'defines': [
229 'DCT_IFAST_SUPPORTED',
230 # using freetype's embolden allows us to adjust fake bold settings at
231 # draw-time, at which point we know which SkTypeface is being drawn
232 'SK_USE_FREETYPE_EMBOLDEN',
233 # Android provides at least FreeType 2.4.0 at runtime.
234 'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
235 # Skia should not use dlopen on Android.
236 'SK_CAN_USE_DLOPEN=0',
237 ],
238 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000239
borenet@google.com05d550e2013-06-11 15:52:19 +0000240 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000241 {
242 'defines': [
243 'SK_SAMPLES_FOR_X',
244 'SK_BUILD_FOR_UNIX',
245 ],
246 'configurations': {
mtklein@google.com1fb04e22013-09-13 19:32:43 +0000247 'Coverage': {
mtklein@google.comdad70702013-11-20 18:06:10 +0000248 'cflags': ['--coverage'],
mtklein@google.com1fb04e22013-09-13 19:32:43 +0000249 'ldflags': ['--coverage'],
250 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000251 'Debug': {
seanpaul@google.com1134f982011-09-15 14:24:33 +0000252 },
253 'Release': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000254 'cflags': [
255 '-O<(skia_release_optimization_level)',
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000256 ],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000257 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000258 },
259 },
borenet@google.coma37a5172012-08-09 20:44:32 +0000260 'conditions' : [
zachr@google.com28c27c82013-06-20 17:15:05 +0000261 [ 'skia_shared_lib', {
262 'cflags': [
263 '-fPIC',
264 ],
265 'defines': [
zachr@google.com28c27c82013-06-20 17:15:05 +0000266 'SKIA_DLL',
267 'SKIA_IMPLEMENTATION=1',
268 ],
269 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000270 [ 'skia_os == "nacl"', {
271 'defines': [
272 'SK_BUILD_FOR_NACL',
273 ],
commit-bot@chromium.orgfe424102014-02-21 00:40:16 +0000274 'variables': {
275 'nacl_sdk_root': '<!(["echo", "${NACL_SDK_ROOT}"])',
276 },
borenet@google.com7158e6a2012-11-01 17:43:44 +0000277 'link_settings': {
278 'libraries': [
279 '-lppapi',
280 '-lppapi_cpp',
281 '-lnosys',
282 '-pthread',
283 ],
commit-bot@chromium.orgfe424102014-02-21 00:40:16 +0000284 'ldflags': [
285 '-L<(nacl_sdk_root)/lib/newlib_x86_<(skia_arch_width)/Release',
286 '-L<(nacl_sdk_root)/ports/lib/newlib_x86_<(skia_arch_width)/Release',
287 ],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000288 },
borenet@google.comcb9445d2013-08-19 18:26:04 +0000289 }, { # skia_os != "nacl"
290 'link_settings': {
291 'ldflags': [
292 '-lstdc++',
293 '-lm',
294 ],
295 },
borenet@google.com7158e6a2012-11-01 17:43:44 +0000296 }],
borenet@google.comcb9445d2013-08-19 18:26:04 +0000297 [ 'skia_os != "chromeos"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000298 'conditions': [
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000299 [ 'skia_arch_width == 64 and skia_arch_type == "x86"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000300 'cflags': [
301 '-m64',
302 ],
303 'ldflags': [
304 '-m64',
305 ],
306 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000307 [ 'skia_arch_width == 32 and skia_arch_type == "x86"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000308 'cflags': [
309 '-m32',
310 ],
311 'ldflags': [
312 '-m32',
313 ],
314 }],
315 ],
316 }],
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000317 # Enable asan, tsan, etc.
318 [ 'skia_sanitizer', {
borenet@google.com0d193092013-07-03 15:55:05 +0000319 'cflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000320 '-fsanitize=<(skia_sanitizer)',
borenet@google.com0d193092013-07-03 15:55:05 +0000321 ],
322 'ldflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000323 '-fsanitize=<(skia_sanitizer)',
bungeman@google.com1435f9f2013-09-25 22:39:22 +0000324 ],
mtklein@google.com3a19fb52013-10-09 16:12:23 +0000325 'conditions' : [
326 [ 'skia_sanitizer == "thread"', {
327 'defines': [ 'DYNAMIC_ANNOTATIONS_ENABLED=1' ],
bungeman@google.com0fbe01f2013-10-10 17:24:17 +0000328 'cflags': [ '-fPIC' ],
bungeman@google.com27d4ffe2013-10-10 17:09:49 +0000329 'target_conditions': [
330 [ '_type == "executable"', {
331 'cflags': [ '-fPIE' ],
332 'ldflags': [ '-pie' ],
333 }],
334 ],
mtklein@google.com3a19fb52013-10-09 16:12:23 +0000335 }],
336 ],
bungeman@google.com1435f9f2013-09-25 22:39:22 +0000337 }],
borenet@google.com47ae4b02013-08-21 18:02:50 +0000338 [ 'skia_clang_build', {
339 'cflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000340 # Extra warnings we like but that only Clang knows about.
borenet@google.com47ae4b02013-08-21 18:02:50 +0000341 '-Wstring-conversion',
342 ],
343 }],
commit-bot@chromium.org5003bde2013-10-25 18:14:54 +0000344 [ 'skia_keep_frame_pointer', {
345 'cflags': [ '-fno-omit-frame-pointer' ],
346 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000347 ],
348 },
349 ],
350
borenet@google.coma72aef82013-03-22 13:16:06 +0000351 [ 'skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000352 {
353 'defines': [
354 'SK_BUILD_FOR_MAC',
355 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000356 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000357 [ 'skia_arch_width == 64', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000358 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000359 'ARCHS': ['x86_64'],
djsollen@google.come341cb32012-06-28 16:08:05 +0000360 },
361 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000362 [ 'skia_arch_width == 32', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000363 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000364 'ARCHS': ['i386'],
borenet@google.coma72aef82013-03-22 13:16:06 +0000365 },
366 }],
367 [ 'skia_warnings_as_errors', {
368 'xcode_settings': {
humper@google.comfe0d6802013-01-07 20:28:16 +0000369 'OTHER_CPLUSPLUSFLAGS': [
370 '-Werror',
commit-bot@chromium.orgfaa5ae42013-07-23 11:13:56 +0000371 '-Wall',
372 '-Wextra',
373 '-Wno-unused-parameter',
commit-bot@chromium.org6a180792014-01-15 21:39:18 +0000374 '-Wno-uninitialized', # Disabled because we think GCC 4.2 is bad at this.
mtklein@google.com8d725b22013-07-24 16:20:05 +0000375 ],
376 },
377 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000378 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000379 'configurations': {
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +0000380 'Coverage': {
381 'xcode_settings': {
382 'GCC_OPTIMIZATION_LEVEL': '0',
383 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
384 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS' : 'YES',
385 },
386 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000387 'Debug': {
388 'xcode_settings': {
389 'GCC_OPTIMIZATION_LEVEL': '0',
390 },
391 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000392 'Release': {
393 'xcode_settings': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000394 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
reed@google.come05cc8e2011-10-10 14:19:40 +0000395 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000396 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000397 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000398 },
399 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000400 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
senorblanco@chromium.org29f351a2014-01-20 16:14:02 +0000401 'conditions': [
402 [ 'skia_osx_deployment_target==""', {
403 'MACOSX_DEPLOYMENT_TARGET': '10.6', # -mmacos-version-min, passed in environment to ld.
404 }, {
405 'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)',
406 }],
407 ],
reed@google.com0069aa52011-11-17 15:35:47 +0000408# trying to get this to work, but it needs clang I think...
409# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000410 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000411 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
412 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
413 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
414 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
415 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
416 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
417 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
418 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
419 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
420 'GCC_WARN_MISSING_PARENTHESES': 'YES',
421 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
422 'GCC_WARN_SIGN_COMPARE': 'YES',
423 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
424 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
425 'GCC_WARN_UNUSED_FUNCTION': 'YES',
426 'GCC_WARN_UNUSED_LABEL': 'YES',
427 'GCC_WARN_UNUSED_VALUE': 'YES',
428 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000429 'OTHER_CPLUSPLUSFLAGS': [
430 '-mssse3',
431 '-fvisibility=hidden',
432 '-fvisibility-inlines-hidden',
433 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000434 },
435 },
436 ],
437
borenet@google.coma72aef82013-03-22 13:16:06 +0000438 [ 'skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000439 {
440 'defines': [
441 'SK_BUILD_FOR_IOS',
442 ],
borenet@google.coma72aef82013-03-22 13:16:06 +0000443 'conditions' : [
444 [ 'skia_warnings_as_errors', {
445 'xcode_settings': {
446 'OTHER_CPLUSPLUSFLAGS': [
447 '-Werror',
448 ],
449 },
450 }],
451 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000452 'configurations': {
453 'Debug': {
454 'xcode_settings': {
455 'GCC_OPTIMIZATION_LEVEL': '0',
456 },
457 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000458 'Release': {
459 'xcode_settings': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000460 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000461 },
462 'defines': [ 'NDEBUG' ],
463 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000464 },
465 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000466 'ARCHS': ['armv6', 'armv7'],
caryclark@google.com867cbd82012-09-20 15:45:41 +0000467 'CODE_SIGNING_REQUIRED': 'NO',
468 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000469 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000470 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000471 'TARGETED_DEVICE_FAMILY': '1,2',
borenet@google.coma72aef82013-03-22 13:16:06 +0000472 'OTHER_CPLUSPLUSFLAGS': [
473 '-fvisibility=hidden',
474 '-fvisibility-inlines-hidden',
475 ],
bsalomon@google.com89dec582012-09-28 18:33:11 +0000476 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000477 },
478 },
479 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000480
borenet@google.coma72aef82013-03-22 13:16:06 +0000481 [ 'skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000482 {
483 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000484 'SK_BUILD_FOR_ANDROID',
bungeman@google.com451b5962013-11-11 18:36:46 +0000485 'SK_FONTHOST_DOES_NOT_USE_FONTMGR',
djsollen@google.com58629292011-11-03 13:08:29 +0000486 ],
scroggo@google.comeb629502014-02-04 16:08:48 +0000487 'configurations': {
488 'Debug': {
489 'cflags': ['-g']
490 },
491 'Release': {
492 'cflags': ['-O2'],
493 'defines': [ 'NDEBUG' ],
494 },
495 },
djsollen@google.com58629292011-11-03 13:08:29 +0000496 'libraries': [
scroggo@google.comeb629502014-02-04 16:08:48 +0000497 '-lstdc++',
498 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000499 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000500 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000501 'cflags': [
borenet@google.comde9ac142012-07-25 15:17:03 +0000502 '-fuse-ld=gold',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000503 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000504 'conditions': [
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000505 [ 'skia_android_framework', {
506 'libraries!': [
507 '-lstdc++',
508 '-lm',
509 ],
510 }],
djsollen@google.com52f02972013-06-03 12:10:19 +0000511 [ 'skia_shared_lib', {
512 'cflags': [
513 '-fPIC',
514 ],
515 'defines': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000516 'SKIA_DLL',
517 'SKIA_IMPLEMENTATION=1',
518 ],
519 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000520 [ 'skia_profile_enabled == 1', {
521 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
djsollen@google.com3839ca12011-11-03 17:31:41 +0000522 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000523 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000524 },
525 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000526
digit@google.com1771cbf2012-01-26 21:26:40 +0000527 # We can POD-style initialization of static mutexes to avoid generating
528 # static initializers if we're using a pthread-compatible thread interface.
529 [ 'skia_os != "win"', {
530 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000531 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000532 ],
533 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000534 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000535 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
536 'xcode_settings': {
537 'SYMROOT': '<(DEPTH)/xcodebuild',
538 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000539}