blob: 70effa17239f56e89f0bccc973b8f6e8991e1b5f [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 },
epoger@google.com58d69d82014-04-01 07:02:41 +000088 # Gyp's ninja generator depends on these specially named
89 # configurations to build 64-bit on Windows.
90 # See http://skbug.com/2348
91 #
92 # We handle the 64- vs 32-bit variations elsewhere, so I think it's
93 # OK for us to just make these inherit non-archwidth-specific
94 # configurations without modification.
95 'Debug_x64': {
96 'inherit_from': ['Debug'],
97 },
98 'Release_x64': {
99 'inherit_from': ['Release'],
100 },
101 'Release_Developer_x64': {
102 'inherit_from': ['Release_Developer'],
103 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000104 },
borenet@google.comb7961192012-08-20 18:58:26 +0000105 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000106 [ 'skia_arch_width == 64', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000107 'msvs_configuration_platform': 'x64',
borenet@google.coma72aef82013-03-22 13:16:06 +0000108 }],
109 [ 'skia_arch_width == 32', {
110 'msvs_configuration_platform': 'Win32',
111 }],
112 [ 'skia_warnings_as_errors', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000113 'msvs_settings': {
114 'VCCLCompilerTool': {
borenet@google.coma72aef82013-03-22 13:16:06 +0000115 'WarnAsError': 'true',
116 'AdditionalOptions': [
117 '/we4189', # initialized but unused var warning
118 ],
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000119 },
120 },
borenet@google.comb7961192012-08-20 18:58:26 +0000121 }],
commit-bot@chromium.org5a6c2d82013-06-14 17:10:09 +0000122 [ 'skia_win_exceptions', {
123 'msvs_settings': {
124 'VCCLCompilerTool': {
125 'AdditionalOptions': [
126 '/EHsc',
127 ],
128 },
129 },
130 }],
borenet@google.comb7961192012-08-20 18:58:26 +0000131 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000132 },
133 ],
134
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000135 # The following section is common to linux + derivatives and android
136 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]',
137 {
mtklein@google.comf1077f92013-11-20 15:13:49 +0000138 'cflags': [
mtklein@google.comdad70702013-11-20 18:06:10 +0000139 '-g',
mtklein@google.comf1077f92013-11-20 15:13:49 +0000140 '-fno-exceptions',
141 '-fstrict-aliasing',
mtklein@google.comdad70702013-11-20 18:06:10 +0000142
mtklein@google.comf1077f92013-11-20 15:13:49 +0000143 '-Wall',
144 '-Wextra',
145 '-Winit-self',
146 '-Wpointer-arith',
147
148 '-Wno-unused-parameter',
mtklein@google.comf1077f92013-11-20 15:13:49 +0000149 ],
150 'cflags_cc': [
151 '-fno-rtti',
152 '-Wnon-virtual-dtor',
153 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000154 'conditions': [
commit-bot@chromium.org93f5e512014-02-17 15:22:26 +0000155 [ 'skia_android_framework==0', {
156 'cflags': [
157 # This flag is not supported by Android build system.
158 '-Wno-c++11-extensions',
159 ],
160 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000161 [ 'skia_warnings_as_errors', {
162 'cflags': [
163 '-Werror',
164 ],
165 }],
commit-bot@chromium.org35d48722014-02-13 18:36:36 +0000166 # For profiling; reveals some costs, exaggerates others (e.g. trivial setters & getters).
167 [ 'skia_disable_inlining', {
168 'cflags': [
169 '-fno-inline',
170 '-fno-default-inline',
171 '-finline-limit=0',
172 '-fno-omit-frame-pointer',
173 ],
174 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000175 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
176 'cflags': [
177 '-mthumb',
178 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000179 # The --fix-cortex-a8 switch enables a link-time workaround for
180 # an erratum in certain Cortex-A8 processors. The workaround is
181 # enabled by default if you target the ARM v7-A arch profile.
182 # It can be enabled otherwise by specifying --fix-cortex-a8, or
183 # disabled unconditionally by specifying --no-fix-cortex-a8.
184 #
185 # The erratum only affects Thumb-2 code.
186 'conditions': [
187 [ 'arm_version < 7', {
188 'ldflags': [
189 '-Wl,--fix-cortex-a8',
190 ],
191 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000192 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000193 }],
194 [ 'skia_arch_type == "arm" and arm_version >= 7', {
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000195 'cflags': [
196 '-march=armv7-a',
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000197 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000198 'ldflags': [
199 '-march=armv7-a',
200 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000201 'conditions': [
202 [ 'arm_neon == 1', {
203 'defines': [
204 '__ARM_HAVE_NEON',
205 ],
206 'cflags': [
207 '-mfpu=neon',
208 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000209 }],
210 [ 'arm_neon_optional == 1', {
211 'defines': [
212 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
213 ],
214 }],
borenet@google.come2b90372013-07-11 18:46:30 +0000215 [ 'skia_os != "chromeos"', {
216 'cflags': [
217 '-mfloat-abi=softfp',
218 ],
219 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000220 ],
221 }],
222 ],
223 },
224 ],
225
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000226 ['skia_android_framework', {
227 'cflags': [
228 # Skia does not enforce this usage pattern so we disable it here to avoid
229 # unecessary log spew when building
230 '-Wno-unused-parameter',
231
232 # Android's -D_FORTIFY_SOURCE=2 extensions are incompatibile with SkString.
233 # Revert to -D_FORTIFY_SOURCE=1
234 '-U_FORTIFY_SOURCE',
235 '-D_FORTIFY_SOURCE=1',
236 ],
commit-bot@chromium.org2fe641b2014-03-25 15:14:18 +0000237 # Remove flags which are either unnecessary or problematic for the
238 # Android framework build. Many of these flags are removed simply because
239 # they were not previously in the Android framework makefile, and we did
240 # did not intend to add them when generating the makefile.
241 # TODO (scroggo): Investigate whether any of these flags are actually
242 # needed/would be beneficial.
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000243 'cflags!': [
commit-bot@chromium.org2fe641b2014-03-25 15:14:18 +0000244 # Android has one makefile, used for both debugging (after manual
245 # modification) and release. Turn off debug info by default.
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000246 '-g',
247 '-march=armv7-a',
248 '-mthumb',
249 '-mfpu=neon',
250 '-mfloat-abi=softfp',
commit-bot@chromium.org2fe641b2014-03-25 15:14:18 +0000251 # This flag is not supported by Android build system.
252 '-Wno-c++11-extensions',
253 '-fno-exceptions',
254 '-fstrict-aliasing',
255 # Remove flags to turn on warnings, since most people building Android
256 # are not focused on Skia and do not need the extra warning info.
257 '-Wall',
258 '-Wextra',
259 '-Winit-self',
260 '-Wpointer-arith',
261 ],
262 'cflags_cc!': [
263 '-fno-rtti',
264 '-Wnon-virtual-dtor',
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000265 ],
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000266 'defines': [
267 'DCT_IFAST_SUPPORTED',
268 # using freetype's embolden allows us to adjust fake bold settings at
269 # draw-time, at which point we know which SkTypeface is being drawn
270 'SK_USE_FREETYPE_EMBOLDEN',
271 # Android provides at least FreeType 2.4.0 at runtime.
commit-bot@chromium.orgba0c5ea2014-03-28 15:59:04 +0000272 'SK_FONTHOST_FREETYPE_RUNTIME_VERSION 0x020400',
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000273 # Skia should not use dlopen on Android.
commit-bot@chromium.orgba0c5ea2014-03-28 15:59:04 +0000274 'SK_CAN_USE_DLOPEN 0',
275 'SK_SFNTLY_SUBSETTER "sample/chromium/font_subsetter.h"',
276 # When built as part of the system image we can enable certian non-NDK
277 # compliant optimizations.
278 'SK_BUILD_FOR_ANDROID_FRAMEWORK',
279 # Android Text Tuning
280 'SK_GAMMA_APPLY_TO_A8',
281 'SK_GAMMA_EXPONENT 1.4',
282 'SK_GAMMA_CONTRAST 0.0',
283 # Optimizations for chromium (m30)
284 'GR_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"',
285 'IGNORE_ROT_AA_RECT_OPT',
286 # Disable this check because it is too strict for some chromium-specific
287 # subclasses of SkPixelRef. See bug: crbug.com/171776.
288 'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
289 'SkLONGLONG int64_t',
290 'SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)',
291 'SK_ATOMICS_PLATFORM_H "../../src/ports/SkAtomics_android.h"',
292 'SK_MUTEX_PLATFORM_H "../../src/ports/SkMutex_pthread.h"',
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000293 ],
294 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000295
borenet@google.com05d550e2013-06-11 15:52:19 +0000296 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000297 {
298 'defines': [
299 'SK_SAMPLES_FOR_X',
300 'SK_BUILD_FOR_UNIX',
301 ],
302 'configurations': {
mtklein@google.com1fb04e22013-09-13 19:32:43 +0000303 'Coverage': {
mtklein@google.comdad70702013-11-20 18:06:10 +0000304 'cflags': ['--coverage'],
mtklein@google.com1fb04e22013-09-13 19:32:43 +0000305 'ldflags': ['--coverage'],
306 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000307 'Debug': {
seanpaul@google.com1134f982011-09-15 14:24:33 +0000308 },
309 'Release': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000310 'cflags': [
311 '-O<(skia_release_optimization_level)',
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000312 ],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000313 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000314 },
315 },
borenet@google.coma37a5172012-08-09 20:44:32 +0000316 'conditions' : [
zachr@google.com28c27c82013-06-20 17:15:05 +0000317 [ 'skia_shared_lib', {
318 'cflags': [
319 '-fPIC',
320 ],
321 'defines': [
zachr@google.com28c27c82013-06-20 17:15:05 +0000322 'SKIA_DLL',
323 'SKIA_IMPLEMENTATION=1',
324 ],
325 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000326 [ 'skia_os == "nacl"', {
327 'defines': [
328 'SK_BUILD_FOR_NACL',
329 ],
commit-bot@chromium.orgfe424102014-02-21 00:40:16 +0000330 'variables': {
331 'nacl_sdk_root': '<!(["echo", "${NACL_SDK_ROOT}"])',
332 },
borenet@google.com7158e6a2012-11-01 17:43:44 +0000333 'link_settings': {
334 'libraries': [
335 '-lppapi',
336 '-lppapi_cpp',
337 '-lnosys',
338 '-pthread',
339 ],
commit-bot@chromium.orgfe424102014-02-21 00:40:16 +0000340 'ldflags': [
341 '-L<(nacl_sdk_root)/lib/newlib_x86_<(skia_arch_width)/Release',
342 '-L<(nacl_sdk_root)/ports/lib/newlib_x86_<(skia_arch_width)/Release',
343 ],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000344 },
borenet@google.comcb9445d2013-08-19 18:26:04 +0000345 }, { # skia_os != "nacl"
346 'link_settings': {
347 'ldflags': [
348 '-lstdc++',
349 '-lm',
350 ],
351 },
borenet@google.com7158e6a2012-11-01 17:43:44 +0000352 }],
borenet@google.comcb9445d2013-08-19 18:26:04 +0000353 [ 'skia_os != "chromeos"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000354 'conditions': [
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000355 [ 'skia_arch_width == 64 and skia_arch_type == "x86"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000356 'cflags': [
357 '-m64',
358 ],
359 'ldflags': [
360 '-m64',
361 ],
362 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000363 [ 'skia_arch_width == 32 and skia_arch_type == "x86"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000364 'cflags': [
365 '-m32',
366 ],
367 'ldflags': [
368 '-m32',
369 ],
370 }],
371 ],
372 }],
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000373 # Enable asan, tsan, etc.
374 [ 'skia_sanitizer', {
borenet@google.com0d193092013-07-03 15:55:05 +0000375 'cflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000376 '-fsanitize=<(skia_sanitizer)',
borenet@google.com0d193092013-07-03 15:55:05 +0000377 ],
378 'ldflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000379 '-fsanitize=<(skia_sanitizer)',
bungeman@google.com1435f9f2013-09-25 22:39:22 +0000380 ],
mtklein@google.com3a19fb52013-10-09 16:12:23 +0000381 'conditions' : [
382 [ 'skia_sanitizer == "thread"', {
383 'defines': [ 'DYNAMIC_ANNOTATIONS_ENABLED=1' ],
bungeman@google.com0fbe01f2013-10-10 17:24:17 +0000384 'cflags': [ '-fPIC' ],
bungeman@google.com27d4ffe2013-10-10 17:09:49 +0000385 'target_conditions': [
386 [ '_type == "executable"', {
387 'cflags': [ '-fPIE' ],
388 'ldflags': [ '-pie' ],
389 }],
390 ],
mtklein@google.com3a19fb52013-10-09 16:12:23 +0000391 }],
392 ],
bungeman@google.com1435f9f2013-09-25 22:39:22 +0000393 }],
borenet@google.com47ae4b02013-08-21 18:02:50 +0000394 [ 'skia_clang_build', {
395 'cflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000396 # Extra warnings we like but that only Clang knows about.
borenet@google.com47ae4b02013-08-21 18:02:50 +0000397 '-Wstring-conversion',
398 ],
399 }],
commit-bot@chromium.org5003bde2013-10-25 18:14:54 +0000400 [ 'skia_keep_frame_pointer', {
401 'cflags': [ '-fno-omit-frame-pointer' ],
402 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000403 ],
404 },
405 ],
406
borenet@google.coma72aef82013-03-22 13:16:06 +0000407 [ 'skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000408 {
409 'defines': [
410 'SK_BUILD_FOR_MAC',
411 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000412 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000413 [ 'skia_arch_width == 64', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000414 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000415 'ARCHS': ['x86_64'],
djsollen@google.come341cb32012-06-28 16:08:05 +0000416 },
417 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000418 [ 'skia_arch_width == 32', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000419 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000420 'ARCHS': ['i386'],
borenet@google.coma72aef82013-03-22 13:16:06 +0000421 },
422 }],
423 [ 'skia_warnings_as_errors', {
424 'xcode_settings': {
humper@google.comfe0d6802013-01-07 20:28:16 +0000425 'OTHER_CPLUSPLUSFLAGS': [
426 '-Werror',
commit-bot@chromium.orgfaa5ae42013-07-23 11:13:56 +0000427 '-Wall',
428 '-Wextra',
429 '-Wno-unused-parameter',
commit-bot@chromium.org6a180792014-01-15 21:39:18 +0000430 '-Wno-uninitialized', # Disabled because we think GCC 4.2 is bad at this.
mtklein@google.com8d725b22013-07-24 16:20:05 +0000431 ],
432 },
433 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000434 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000435 'configurations': {
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +0000436 'Coverage': {
437 'xcode_settings': {
438 'GCC_OPTIMIZATION_LEVEL': '0',
439 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
440 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS' : 'YES',
441 },
442 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000443 'Debug': {
444 'xcode_settings': {
445 'GCC_OPTIMIZATION_LEVEL': '0',
446 },
447 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000448 'Release': {
449 'xcode_settings': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000450 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
reed@google.come05cc8e2011-10-10 14:19:40 +0000451 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000452 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000453 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000454 },
455 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000456 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
senorblanco@chromium.org29f351a2014-01-20 16:14:02 +0000457 'conditions': [
458 [ 'skia_osx_deployment_target==""', {
459 'MACOSX_DEPLOYMENT_TARGET': '10.6', # -mmacos-version-min, passed in environment to ld.
460 }, {
461 'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)',
462 }],
463 ],
reed@google.com0069aa52011-11-17 15:35:47 +0000464# trying to get this to work, but it needs clang I think...
465# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000466 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000467 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
468 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
469 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
470 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
471 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
472 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
473 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
474 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
475 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
476 'GCC_WARN_MISSING_PARENTHESES': 'YES',
477 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
478 'GCC_WARN_SIGN_COMPARE': 'YES',
479 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
480 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
481 'GCC_WARN_UNUSED_FUNCTION': 'YES',
482 'GCC_WARN_UNUSED_LABEL': 'YES',
483 'GCC_WARN_UNUSED_VALUE': 'YES',
484 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000485 'OTHER_CPLUSPLUSFLAGS': [
486 '-mssse3',
487 '-fvisibility=hidden',
488 '-fvisibility-inlines-hidden',
489 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000490 },
491 },
492 ],
493
borenet@google.coma72aef82013-03-22 13:16:06 +0000494 [ 'skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000495 {
496 'defines': [
497 'SK_BUILD_FOR_IOS',
498 ],
borenet@google.coma72aef82013-03-22 13:16:06 +0000499 'conditions' : [
500 [ 'skia_warnings_as_errors', {
501 'xcode_settings': {
502 'OTHER_CPLUSPLUSFLAGS': [
503 '-Werror',
504 ],
505 },
506 }],
507 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000508 'configurations': {
509 'Debug': {
510 'xcode_settings': {
511 'GCC_OPTIMIZATION_LEVEL': '0',
512 },
513 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000514 'Release': {
515 'xcode_settings': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000516 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000517 },
518 'defines': [ 'NDEBUG' ],
519 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000520 },
521 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000522 'ARCHS': ['armv6', 'armv7'],
caryclark@google.com867cbd82012-09-20 15:45:41 +0000523 'CODE_SIGNING_REQUIRED': 'NO',
524 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000525 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000526 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000527 'TARGETED_DEVICE_FAMILY': '1,2',
borenet@google.coma72aef82013-03-22 13:16:06 +0000528 'OTHER_CPLUSPLUSFLAGS': [
529 '-fvisibility=hidden',
530 '-fvisibility-inlines-hidden',
531 ],
bsalomon@google.com89dec582012-09-28 18:33:11 +0000532 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000533 },
534 },
535 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000536
borenet@google.coma72aef82013-03-22 13:16:06 +0000537 [ 'skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000538 {
539 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000540 'SK_BUILD_FOR_ANDROID',
bungeman@google.com451b5962013-11-11 18:36:46 +0000541 'SK_FONTHOST_DOES_NOT_USE_FONTMGR',
djsollen@google.com58629292011-11-03 13:08:29 +0000542 ],
scroggo@google.comeb629502014-02-04 16:08:48 +0000543 'configurations': {
544 'Debug': {
545 'cflags': ['-g']
546 },
547 'Release': {
548 'cflags': ['-O2'],
549 'defines': [ 'NDEBUG' ],
550 },
551 },
djsollen@google.com58629292011-11-03 13:08:29 +0000552 'libraries': [
scroggo@google.comeb629502014-02-04 16:08:48 +0000553 '-lstdc++',
554 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000555 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000556 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000557 'cflags': [
borenet@google.comde9ac142012-07-25 15:17:03 +0000558 '-fuse-ld=gold',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000559 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000560 'conditions': [
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000561 [ 'skia_android_framework', {
562 'libraries!': [
563 '-lstdc++',
564 '-lm',
565 ],
commit-bot@chromium.org2fe641b2014-03-25 15:14:18 +0000566 'cflags!': [
567 '-fuse-ld=gold',
568 ],
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000569 }],
djsollen@google.com52f02972013-06-03 12:10:19 +0000570 [ 'skia_shared_lib', {
571 'cflags': [
572 '-fPIC',
573 ],
574 'defines': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000575 'SKIA_DLL',
576 'SKIA_IMPLEMENTATION=1',
577 ],
578 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000579 [ 'skia_profile_enabled == 1', {
580 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
djsollen@google.com3839ca12011-11-03 17:31:41 +0000581 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000582 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000583 },
584 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000585
digit@google.com1771cbf2012-01-26 21:26:40 +0000586 # We can POD-style initialization of static mutexes to avoid generating
587 # static initializers if we're using a pthread-compatible thread interface.
588 [ 'skia_os != "win"', {
589 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000590 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000591 ],
592 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000593 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000594 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
595 'xcode_settings': {
596 'SYMROOT': '<(DEPTH)/xcodebuild',
597 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000598}