blob: 175b8b09edc41bbf9030e9517a17fac302c12a99 [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' : [
commit-bot@chromium.org6f2d4d42014-04-02 15:03:56 +000011 [ 'skia_arch_type == "arm64"', {
12 'cflags': [
13 '-ffp-contract=off',
14 ],
15 }],
16
borenet@google.coma72aef82013-03-22 13:16:06 +000017 [ 'skia_os == "win"',
seanpaul@google.com1134f982011-09-15 14:24:33 +000018 {
19 'defines': [
20 'SK_BUILD_FOR_WIN32',
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000021 '_CRT_SECURE_NO_WARNINGS',
senorblanco@chromium.org5f47a392012-07-12 00:34:39 +000022 'GR_GL_FUNCTION_TYPE=__stdcall',
seanpaul@google.com1134f982011-09-15 14:24:33 +000023 ],
24 'msvs_cygwin_shell': 0,
25 'msvs_settings': {
26 'VCCLCompilerTool': {
bsalomon@google.comb58a6392013-03-21 20:29:05 +000027 'WarningLevel': '3',
28 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000029 'DebugInformationFormat': '3',
bsalomon@google.comb58a6392013-03-21 20:29:05 +000030 'ExceptionHandling': '0',
31 'AdditionalOptions': [ '/MP', ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000032 },
33 'VCLinkerTool': {
34 'AdditionalDependencies': [
35 'OpenGL32.lib',
36 'usp10.lib',
bungeman@google.comf51e1252013-06-05 18:35:22 +000037
38 # Prior to gyp r1584, the following were included automatically.
39 'kernel32.lib',
40 'gdi32.lib',
41 'winspool.lib',
42 'comdlg32.lib',
43 'advapi32.lib',
44 'shell32.lib',
45 'ole32.lib',
46 'oleaut32.lib',
47 'user32.lib',
48 'uuid.lib',
49 'odbc32.lib',
50 'odbccp32.lib',
bsalomon@google.combbba7842013-06-06 18:34:13 +000051 'DelayImp.lib',
seanpaul@google.com1134f982011-09-15 14:24:33 +000052 ],
53 },
54 },
55 'configurations': {
56 'Debug': {
57 'msvs_settings': {
58 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000059 'DebugInformationFormat': '4', # editAndContiue (/ZI)
seanpaul@google.com1134f982011-09-15 14:24:33 +000060 'Optimization': '0', # optimizeDisabled (/Od)
61 'PreprocessorDefinitions': ['_DEBUG'],
62 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000063 'RuntimeTypeInfo': 'false', # /GR-
seanpaul@google.com1134f982011-09-15 14:24:33 +000064 },
65 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000066 'GenerateDebugInformation': 'true', # /DEBUG
67 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000068 },
69 },
70 },
71 'Release': {
72 'msvs_settings': {
73 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000074 'DebugInformationFormat': '3', # programDatabase (/Zi)
commit-bot@chromium.org06b38642013-06-20 20:28:54 +000075 'Optimization': '<(skia_release_optimization_level)',
bsalomon@google.comd9718692013-04-22 14:56:50 +000076 'WholeProgramOptimization': 'true', #/GL
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000077 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000078 #'FloatingPointModel': '2', # fast (/fp:fast)
79 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000080 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000081 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000082 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
83 'RuntimeTypeInfo': 'false', # /GR-
seanpaul@google.com1134f982011-09-15 14:24:33 +000084 },
85 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000086 'GenerateDebugInformation': 'true', # /DEBUG
bsalomon@google.comd9718692013-04-22 14:56:50 +000087 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000088 },
bungeman@google.com983297e2011-10-03 19:36:51 +000089 'VCLibrarianTool': {
bsalomon@google.comd9718692013-04-22 14:56:50 +000090 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
bungeman@google.com983297e2011-10-03 19:36:51 +000091 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000092 },
93 },
commit-bot@chromium.orgd10ec402014-04-22 20:05:35 +000094 },
95 'conditions' : [
epoger@google.com58d69d82014-04-01 07:02:41 +000096 # Gyp's ninja generator depends on these specially named
97 # configurations to build 64-bit on Windows.
98 # See http://skbug.com/2348
99 #
100 # We handle the 64- vs 32-bit variations elsewhere, so I think it's
101 # OK for us to just make these inherit non-archwidth-specific
102 # configurations without modification.
commit-bot@chromium.orgd10ec402014-04-22 20:05:35 +0000103 #
104 # See http://skbug.com/2442 : These targets cause problems in the
105 # MSVS build, so only include them if gyp is generating a ninja build.
106 [ '"ninja" in "<!(echo %GYP_GENERATORS%)"', {
107 'configurations': {
108 'Debug_x64': {
109 'inherit_from': ['Debug'],
110 },
111 'Release_x64': {
112 'inherit_from': ['Release'],
113 },
114 'Release_Developer_x64': {
115 'inherit_from': ['Release_Developer'],
116 },
117 },
118 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000119 [ 'skia_arch_width == 64', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000120 'msvs_configuration_platform': 'x64',
borenet@google.coma72aef82013-03-22 13:16:06 +0000121 }],
122 [ 'skia_arch_width == 32', {
123 'msvs_configuration_platform': 'Win32',
124 }],
125 [ 'skia_warnings_as_errors', {
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000126 'msvs_settings': {
127 'VCCLCompilerTool': {
borenet@google.coma72aef82013-03-22 13:16:06 +0000128 'WarnAsError': 'true',
129 'AdditionalOptions': [
130 '/we4189', # initialized but unused var warning
131 ],
bsalomon@google.com1d03ba92013-01-08 20:40:22 +0000132 },
133 },
borenet@google.comb7961192012-08-20 18:58:26 +0000134 }],
commit-bot@chromium.org5a6c2d82013-06-14 17:10:09 +0000135 [ 'skia_win_exceptions', {
136 'msvs_settings': {
137 'VCCLCompilerTool': {
138 'AdditionalOptions': [
139 '/EHsc',
140 ],
141 },
142 },
143 }],
borenet@google.comb7961192012-08-20 18:58:26 +0000144 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000145 },
146 ],
147
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000148 # The following section is common to linux + derivatives and android
149 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]',
150 {
mtklein@google.comf1077f92013-11-20 15:13:49 +0000151 'cflags': [
mtklein@google.comdad70702013-11-20 18:06:10 +0000152 '-g',
mtklein@google.comf1077f92013-11-20 15:13:49 +0000153 '-fno-exceptions',
154 '-fstrict-aliasing',
mtklein@google.comdad70702013-11-20 18:06:10 +0000155
mtklein@google.comf1077f92013-11-20 15:13:49 +0000156 '-Wall',
157 '-Wextra',
158 '-Winit-self',
159 '-Wpointer-arith',
160
161 '-Wno-unused-parameter',
mtklein@google.comf1077f92013-11-20 15:13:49 +0000162 ],
163 'cflags_cc': [
164 '-fno-rtti',
165 '-Wnon-virtual-dtor',
166 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000167 'conditions': [
commit-bot@chromium.org93f5e512014-02-17 15:22:26 +0000168 [ 'skia_android_framework==0', {
169 'cflags': [
170 # This flag is not supported by Android build system.
171 '-Wno-c++11-extensions',
172 ],
173 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000174 [ 'skia_warnings_as_errors', {
175 'cflags': [
176 '-Werror',
177 ],
178 }],
commit-bot@chromium.org35d48722014-02-13 18:36:36 +0000179 # For profiling; reveals some costs, exaggerates others (e.g. trivial setters & getters).
180 [ 'skia_disable_inlining', {
181 'cflags': [
182 '-fno-inline',
183 '-fno-default-inline',
184 '-finline-limit=0',
185 '-fno-omit-frame-pointer',
186 ],
187 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000188 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
189 'cflags': [
190 '-mthumb',
191 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000192 # The --fix-cortex-a8 switch enables a link-time workaround for
193 # an erratum in certain Cortex-A8 processors. The workaround is
194 # enabled by default if you target the ARM v7-A arch profile.
195 # It can be enabled otherwise by specifying --fix-cortex-a8, or
196 # disabled unconditionally by specifying --no-fix-cortex-a8.
197 #
198 # The erratum only affects Thumb-2 code.
199 'conditions': [
200 [ 'arm_version < 7', {
201 'ldflags': [
202 '-Wl,--fix-cortex-a8',
203 ],
204 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000205 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000206 }],
207 [ 'skia_arch_type == "arm" and arm_version >= 7', {
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000208 'cflags': [
209 '-march=armv7-a',
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000210 ],
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000211 'ldflags': [
212 '-march=armv7-a',
213 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000214 'conditions': [
215 [ 'arm_neon == 1', {
216 'defines': [
217 '__ARM_HAVE_NEON',
218 ],
219 'cflags': [
220 '-mfpu=neon',
221 ],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000222 }],
223 [ 'arm_neon_optional == 1', {
224 'defines': [
225 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
226 ],
227 }],
borenet@google.come2b90372013-07-11 18:46:30 +0000228 [ 'skia_os != "chromeos"', {
229 'cflags': [
230 '-mfloat-abi=softfp',
231 ],
232 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000233 ],
234 }],
235 ],
236 },
237 ],
238
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000239 ['skia_android_framework', {
240 'cflags': [
241 # Skia does not enforce this usage pattern so we disable it here to avoid
242 # unecessary log spew when building
243 '-Wno-unused-parameter',
244
245 # Android's -D_FORTIFY_SOURCE=2 extensions are incompatibile with SkString.
246 # Revert to -D_FORTIFY_SOURCE=1
247 '-U_FORTIFY_SOURCE',
248 '-D_FORTIFY_SOURCE=1',
249 ],
commit-bot@chromium.org2fe641b2014-03-25 15:14:18 +0000250 # Remove flags which are either unnecessary or problematic for the
251 # Android framework build. Many of these flags are removed simply because
252 # they were not previously in the Android framework makefile, and we did
253 # did not intend to add them when generating the makefile.
254 # TODO (scroggo): Investigate whether any of these flags are actually
255 # needed/would be beneficial.
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000256 'cflags!': [
commit-bot@chromium.org2fe641b2014-03-25 15:14:18 +0000257 # Android has one makefile, used for both debugging (after manual
258 # modification) and release. Turn off debug info by default.
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000259 '-g',
260 '-march=armv7-a',
261 '-mthumb',
262 '-mfpu=neon',
263 '-mfloat-abi=softfp',
commit-bot@chromium.org2fe641b2014-03-25 15:14:18 +0000264 # This flag is not supported by Android build system.
265 '-Wno-c++11-extensions',
266 '-fno-exceptions',
267 '-fstrict-aliasing',
268 # Remove flags to turn on warnings, since most people building Android
269 # are not focused on Skia and do not need the extra warning info.
270 '-Wall',
271 '-Wextra',
272 '-Winit-self',
273 '-Wpointer-arith',
274 ],
275 'cflags_cc!': [
276 '-fno-rtti',
277 '-Wnon-virtual-dtor',
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000278 ],
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000279 'defines': [
280 'DCT_IFAST_SUPPORTED',
281 # using freetype's embolden allows us to adjust fake bold settings at
282 # draw-time, at which point we know which SkTypeface is being drawn
283 'SK_USE_FREETYPE_EMBOLDEN',
commit-bot@chromium.orgba0c5ea2014-03-28 15:59:04 +0000284 'SK_SFNTLY_SUBSETTER "sample/chromium/font_subsetter.h"',
285 # When built as part of the system image we can enable certian non-NDK
286 # compliant optimizations.
287 'SK_BUILD_FOR_ANDROID_FRAMEWORK',
commit-bot@chromium.orgba0c5ea2014-03-28 15:59:04 +0000288 # Optimizations for chromium (m30)
289 'GR_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"',
290 'IGNORE_ROT_AA_RECT_OPT',
291 # Disable this check because it is too strict for some chromium-specific
292 # subclasses of SkPixelRef. See bug: crbug.com/171776.
293 'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
294 'SkLONGLONG int64_t',
295 'SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)',
296 'SK_ATOMICS_PLATFORM_H "../../src/ports/SkAtomics_android.h"',
297 'SK_MUTEX_PLATFORM_H "../../src/ports/SkMutex_pthread.h"',
commit-bot@chromium.org848fdb02014-04-04 21:19:53 +0000298 # FIXME: b/13729784: Need to rework LayerRasterizer.cpp
299 'SK_SUPPORT_LEGACY_LAYERRASTERIZER_API',
300 # Temporary until https:#googleplex-android-review.git.corp.google.com/#/c/442220/
301 # lands.
302 'SK_SUPPORT_LEGACY_GETTOTALCLIP',
commit-bot@chromium.org28fcae22014-04-11 17:15:40 +0000303 # Still need to switch Android to the new name for N32.
304 'kNative_8888_SkColorType kN32_SkColorType',
commit-bot@chromium.org04f6c4c2014-04-16 22:08:32 +0000305 'SK_SUPPORT_LEGACY_PICTURE_CAN_RECORD',
commit-bot@chromium.org03f2f812014-04-16 23:06:29 +0000306 'SK_SUPPORT_DEPRECATED_RECORD_FLAGS',
commit-bot@chromium.org5fb2ce32014-04-17 23:35:06 +0000307 'SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES',
robertphillips@google.com770963f2014-04-18 18:04:41 +0000308 'SK_SUPPORT_LEGACY_PICTURE_HEADERS',
commit-bot@chromium.org03f2f812014-04-16 23:06:29 +0000309 'SK_SUPPORT_LEGACY_BLURDRAWLOOPERCONSTRUCTORS',
commit-bot@chromium.org1d0b68c2014-04-21 14:42:38 +0000310 # Needed until we fix skbug.com/2440.
311 'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG',
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000312 ],
313 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000314
borenet@google.com05d550e2013-06-11 15:52:19 +0000315 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000316 {
317 'defines': [
318 'SK_SAMPLES_FOR_X',
319 'SK_BUILD_FOR_UNIX',
320 ],
321 'configurations': {
mtklein@google.com1fb04e22013-09-13 19:32:43 +0000322 'Coverage': {
mtklein@google.comdad70702013-11-20 18:06:10 +0000323 'cflags': ['--coverage'],
mtklein@google.com1fb04e22013-09-13 19:32:43 +0000324 'ldflags': ['--coverage'],
325 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000326 'Debug': {
seanpaul@google.com1134f982011-09-15 14:24:33 +0000327 },
328 'Release': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000329 'cflags': [
330 '-O<(skia_release_optimization_level)',
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000331 ],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000332 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000333 },
334 },
borenet@google.coma37a5172012-08-09 20:44:32 +0000335 'conditions' : [
zachr@google.com28c27c82013-06-20 17:15:05 +0000336 [ 'skia_shared_lib', {
337 'cflags': [
338 '-fPIC',
339 ],
340 'defines': [
zachr@google.com28c27c82013-06-20 17:15:05 +0000341 'SKIA_DLL',
342 'SKIA_IMPLEMENTATION=1',
343 ],
344 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000345 [ 'skia_os == "nacl"', {
346 'defines': [
347 'SK_BUILD_FOR_NACL',
348 ],
commit-bot@chromium.orgfe424102014-02-21 00:40:16 +0000349 'variables': {
commit-bot@chromium.org25595ed2014-04-04 18:16:04 +0000350 'nacl_sdk_root': '<!(echo ${NACL_SDK_ROOT})',
commit-bot@chromium.orgfe424102014-02-21 00:40:16 +0000351 },
borenet@google.com7158e6a2012-11-01 17:43:44 +0000352 'link_settings': {
353 'libraries': [
354 '-lppapi',
355 '-lppapi_cpp',
356 '-lnosys',
357 '-pthread',
358 ],
commit-bot@chromium.orgfe424102014-02-21 00:40:16 +0000359 'ldflags': [
360 '-L<(nacl_sdk_root)/lib/newlib_x86_<(skia_arch_width)/Release',
361 '-L<(nacl_sdk_root)/ports/lib/newlib_x86_<(skia_arch_width)/Release',
362 ],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000363 },
borenet@google.comcb9445d2013-08-19 18:26:04 +0000364 }, { # skia_os != "nacl"
365 'link_settings': {
366 'ldflags': [
367 '-lstdc++',
368 '-lm',
369 ],
370 },
borenet@google.com7158e6a2012-11-01 17:43:44 +0000371 }],
borenet@google.comcb9445d2013-08-19 18:26:04 +0000372 [ 'skia_os != "chromeos"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000373 'conditions': [
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000374 [ 'skia_arch_width == 64 and skia_arch_type == "x86"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000375 'cflags': [
376 '-m64',
377 ],
378 'ldflags': [
379 '-m64',
380 ],
381 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000382 [ 'skia_arch_width == 32 and skia_arch_type == "x86"', {
borenet@google.com05d550e2013-06-11 15:52:19 +0000383 'cflags': [
384 '-m32',
385 ],
386 'ldflags': [
387 '-m32',
388 ],
389 }],
390 ],
391 }],
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000392 # Enable asan, tsan, etc.
393 [ 'skia_sanitizer', {
borenet@google.com0d193092013-07-03 15:55:05 +0000394 'cflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000395 '-fsanitize=<(skia_sanitizer)',
borenet@google.com0d193092013-07-03 15:55:05 +0000396 ],
397 'ldflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000398 '-fsanitize=<(skia_sanitizer)',
bungeman@google.com1435f9f2013-09-25 22:39:22 +0000399 ],
mtklein@google.com3a19fb52013-10-09 16:12:23 +0000400 'conditions' : [
401 [ 'skia_sanitizer == "thread"', {
402 'defines': [ 'DYNAMIC_ANNOTATIONS_ENABLED=1' ],
bungeman@google.com0fbe01f2013-10-10 17:24:17 +0000403 'cflags': [ '-fPIC' ],
bungeman@google.com27d4ffe2013-10-10 17:09:49 +0000404 'target_conditions': [
405 [ '_type == "executable"', {
406 'cflags': [ '-fPIE' ],
407 'ldflags': [ '-pie' ],
408 }],
409 ],
mtklein@google.com3a19fb52013-10-09 16:12:23 +0000410 }],
411 ],
bungeman@google.com1435f9f2013-09-25 22:39:22 +0000412 }],
borenet@google.com47ae4b02013-08-21 18:02:50 +0000413 [ 'skia_clang_build', {
414 'cflags': [
mtklein@google.com9f3b0e42013-10-08 15:16:36 +0000415 # Extra warnings we like but that only Clang knows about.
borenet@google.com47ae4b02013-08-21 18:02:50 +0000416 '-Wstring-conversion',
417 ],
418 }],
commit-bot@chromium.org5003bde2013-10-25 18:14:54 +0000419 [ 'skia_keep_frame_pointer', {
420 'cflags': [ '-fno-omit-frame-pointer' ],
421 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000422 ],
423 },
424 ],
425
borenet@google.coma72aef82013-03-22 13:16:06 +0000426 [ 'skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000427 {
428 'defines': [
429 'SK_BUILD_FOR_MAC',
430 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000431 'conditions' : [
borenet@google.coma72aef82013-03-22 13:16:06 +0000432 [ 'skia_arch_width == 64', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000433 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000434 'ARCHS': ['x86_64'],
djsollen@google.come341cb32012-06-28 16:08:05 +0000435 },
436 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000437 [ 'skia_arch_width == 32', {
djsollen@google.come341cb32012-06-28 16:08:05 +0000438 'xcode_settings': {
commit-bot@chromium.org5d7ca952013-04-22 20:26:44 +0000439 'ARCHS': ['i386'],
borenet@google.coma72aef82013-03-22 13:16:06 +0000440 },
441 }],
442 [ 'skia_warnings_as_errors', {
443 'xcode_settings': {
humper@google.comfe0d6802013-01-07 20:28:16 +0000444 'OTHER_CPLUSPLUSFLAGS': [
445 '-Werror',
commit-bot@chromium.orgfaa5ae42013-07-23 11:13:56 +0000446 '-Wall',
447 '-Wextra',
448 '-Wno-unused-parameter',
commit-bot@chromium.org6a180792014-01-15 21:39:18 +0000449 '-Wno-uninitialized', # Disabled because we think GCC 4.2 is bad at this.
mtklein@google.com8d725b22013-07-24 16:20:05 +0000450 ],
451 },
452 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000453 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000454 'configurations': {
commit-bot@chromium.org866f4e32013-11-21 17:04:29 +0000455 'Coverage': {
456 'xcode_settings': {
457 'GCC_OPTIMIZATION_LEVEL': '0',
458 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
459 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS' : 'YES',
460 },
461 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000462 'Debug': {
463 'xcode_settings': {
464 'GCC_OPTIMIZATION_LEVEL': '0',
465 },
466 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000467 'Release': {
468 'xcode_settings': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000469 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
reed@google.come05cc8e2011-10-10 14:19:40 +0000470 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000471 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000472 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000473 },
474 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000475 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
senorblanco@chromium.org29f351a2014-01-20 16:14:02 +0000476 'conditions': [
477 [ 'skia_osx_deployment_target==""', {
478 'MACOSX_DEPLOYMENT_TARGET': '10.6', # -mmacos-version-min, passed in environment to ld.
479 }, {
480 'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)',
481 }],
482 ],
reed@google.com0069aa52011-11-17 15:35:47 +0000483# trying to get this to work, but it needs clang I think...
484# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000485 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000486 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
487 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
488 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
489 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
490 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
491 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
492 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
493 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
494 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
495 'GCC_WARN_MISSING_PARENTHESES': 'YES',
496 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
497 'GCC_WARN_SIGN_COMPARE': 'YES',
498 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
499 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
500 'GCC_WARN_UNUSED_FUNCTION': 'YES',
501 'GCC_WARN_UNUSED_LABEL': 'YES',
502 'GCC_WARN_UNUSED_VALUE': 'YES',
503 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000504 'OTHER_CPLUSPLUSFLAGS': [
505 '-mssse3',
506 '-fvisibility=hidden',
507 '-fvisibility-inlines-hidden',
508 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000509 },
510 },
511 ],
512
borenet@google.coma72aef82013-03-22 13:16:06 +0000513 [ 'skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000514 {
515 'defines': [
516 'SK_BUILD_FOR_IOS',
517 ],
borenet@google.coma72aef82013-03-22 13:16:06 +0000518 'conditions' : [
519 [ 'skia_warnings_as_errors', {
520 'xcode_settings': {
521 'OTHER_CPLUSPLUSFLAGS': [
522 '-Werror',
523 ],
524 },
525 }],
526 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000527 'configurations': {
528 'Debug': {
529 'xcode_settings': {
530 'GCC_OPTIMIZATION_LEVEL': '0',
531 },
532 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000533 'Release': {
534 'xcode_settings': {
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000535 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000536 },
537 'defines': [ 'NDEBUG' ],
538 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000539 },
540 'xcode_settings': {
commit-bot@chromium.orgae0054e2014-04-05 01:13:43 +0000541 'ARCHS': ['armv7'],
caryclark@google.com867cbd82012-09-20 15:45:41 +0000542 'CODE_SIGNING_REQUIRED': 'NO',
543 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000544 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000545 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000546 'TARGETED_DEVICE_FAMILY': '1,2',
borenet@google.coma72aef82013-03-22 13:16:06 +0000547 'OTHER_CPLUSPLUSFLAGS': [
548 '-fvisibility=hidden',
549 '-fvisibility-inlines-hidden',
550 ],
bsalomon@google.com89dec582012-09-28 18:33:11 +0000551 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000552 },
553 },
554 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000555
borenet@google.coma72aef82013-03-22 13:16:06 +0000556 [ 'skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000557 {
558 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000559 'SK_BUILD_FOR_ANDROID',
bungeman@google.com451b5962013-11-11 18:36:46 +0000560 'SK_FONTHOST_DOES_NOT_USE_FONTMGR',
djsollen@google.com968757e2014-04-11 13:09:21 +0000561
562 # Android Text Tuning
563 'SK_GAMMA_EXPONENT=1.4',
564 'SK_GAMMA_CONTRAST=0.0',
565 ],
566 # Android defines a fixed gamma exponent instead of using SRGB
567 'defines!': [
568 'SK_GAMMA_SRGB',
djsollen@google.com58629292011-11-03 13:08:29 +0000569 ],
scroggo@google.comeb629502014-02-04 16:08:48 +0000570 'configurations': {
571 'Debug': {
572 'cflags': ['-g']
573 },
574 'Release': {
575 'cflags': ['-O2'],
576 'defines': [ 'NDEBUG' ],
577 },
578 },
djsollen@google.com58629292011-11-03 13:08:29 +0000579 'libraries': [
scroggo@google.comeb629502014-02-04 16:08:48 +0000580 '-lstdc++',
581 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000582 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000583 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000584 'cflags': [
borenet@google.comde9ac142012-07-25 15:17:03 +0000585 '-fuse-ld=gold',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000586 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000587 'conditions': [
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000588 [ 'skia_android_framework', {
589 'libraries!': [
590 '-lstdc++',
591 '-lm',
592 ],
commit-bot@chromium.org2fe641b2014-03-25 15:14:18 +0000593 'cflags!': [
594 '-fuse-ld=gold',
595 ],
scroggo@google.comd4adfa32014-02-05 16:35:12 +0000596 }],
djsollen@google.com52f02972013-06-03 12:10:19 +0000597 [ 'skia_shared_lib', {
598 'cflags': [
599 '-fPIC',
600 ],
601 'defines': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000602 'SKIA_DLL',
603 'SKIA_IMPLEMENTATION=1',
604 ],
605 }],
commit-bot@chromium.org183f7f52013-07-11 12:48:14 +0000606 [ 'skia_profile_enabled == 1', {
607 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
djsollen@google.com3839ca12011-11-03 17:31:41 +0000608 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000609 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000610 },
611 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000612
digit@google.com1771cbf2012-01-26 21:26:40 +0000613 # We can POD-style initialization of static mutexes to avoid generating
614 # static initializers if we're using a pthread-compatible thread interface.
615 [ 'skia_os != "win"', {
616 'defines': [
borenet@google.com7158e6a2012-11-01 17:43:44 +0000617 'SK_USE_POSIX_THREADS',
digit@google.com1771cbf2012-01-26 21:26:40 +0000618 ],
619 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000620 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000621 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
622 'xcode_settings': {
623 'SYMROOT': '<(DEPTH)/xcodebuild',
624 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000625}