blob: 70b4566f8a2c9853dfb15dfc9b628366c92be840 [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',
chudy@google.combbad34d2012-08-13 14:26:36 +00007 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +00008 'conditions' : [
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +00009 ['skia_gpu == 1',
10 {
11 'defines': [
12 'SK_SUPPORT_GPU=1',
13 ],
14 }, {
15 'defines': [
16 'SK_SUPPORT_GPU=0',
17 ],
18 },
19 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000020 ['skia_os == "win"',
21 {
22 'defines': [
23 'SK_BUILD_FOR_WIN32',
24 'SK_IGNORE_STDINT_DOT_H',
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000025 '_CRT_SECURE_NO_WARNINGS',
senorblanco@chromium.org5f47a392012-07-12 00:34:39 +000026 'GR_GL_FUNCTION_TYPE=__stdcall',
seanpaul@google.com1134f982011-09-15 14:24:33 +000027 ],
28 'msvs_cygwin_shell': 0,
29 'msvs_settings': {
30 'VCCLCompilerTool': {
31 'WarningLevel': '1',
32 'WarnAsError': 'false',
33 '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', {
91 'msvs_configuration_platform': 'x64'
92 }],
93 ['skia_arch_width == 32', {
94 'msvs_configuration_platform': 'Win32',
95 }],
96 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000097 },
98 ],
99
100 ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
101 {
102 'defines': [
103 'SK_SAMPLES_FOR_X',
104 'SK_BUILD_FOR_UNIX',
105 ],
106 'configurations': {
107 'Debug': {
108 'cflags': ['-g']
109 },
110 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000111 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000112 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000113 },
114 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000115 'cflags': [
116 # TODO(tony): Enable -Werror once all the strict-aliasing problems
117 # are fixed.
118 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000119 '-Wall',
120 '-Wextra',
121 '-Wno-unused',
122 # suppressions below here were added for clang
123 '-Wno-unused-parameter',
124 '-Wno-c++11-extensions'
125 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000126 'conditions' : [
127 ['skia_arch_width == 64', {
128 'cflags': [
129 '-m64',
130 ],
131 'ldflags': [
132 '-m64',
133 ],
134 }],
135 ['skia_arch_width == 32', {
136 'cflags': [
137 '-m32',
138 ],
139 'ldflags': [
140 '-m32',
141 ],
142 }],
143 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000144 'include_dirs' : [
145 '/usr/include/freetype2',
146 ],
147 },
148 ],
149
chudy@google.combbad34d2012-08-13 14:26:36 +0000150 ['skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000151 {
152 'defines': [
153 'SK_BUILD_FOR_MAC',
154 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000155 'conditions' : [
156 ['skia_arch_width == 64', {
157 'xcode_settings': {
158 'ARCHS': 'x86_64',
159 },
160 }],
161 ['skia_arch_width == 32', {
162 'xcode_settings': {
163 'ARCHS': 'i386',
164 },
165 }],
166 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000167 'configurations': {
168 'Debug': {
169 'xcode_settings': {
170 'GCC_OPTIMIZATION_LEVEL': '0',
171 },
172 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000173 'Release': {
174 'xcode_settings': {
175 'GCC_OPTIMIZATION_LEVEL': '3',
176 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000177 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000178 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000179 },
180 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000181 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
senorblanco@chromium.orgbc5cbfe2012-09-20 16:10:02 +0000182 'SDKROOT': '<(skia_osx_sdkroot)',
reed@google.com0069aa52011-11-17 15:35:47 +0000183# trying to get this to work, but it needs clang I think...
184# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000185 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000186 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
187 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
188 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
189 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
190 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
191 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
192 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
193 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
194 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
195 'GCC_WARN_MISSING_PARENTHESES': 'YES',
196 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
197 'GCC_WARN_SIGN_COMPARE': 'YES',
198 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
199 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
200 'GCC_WARN_UNUSED_FUNCTION': 'YES',
201 'GCC_WARN_UNUSED_LABEL': 'YES',
202 'GCC_WARN_UNUSED_VALUE': 'YES',
203 'GCC_WARN_UNUSED_VARIABLE': 'YES',
bungeman@google.com43b4ed52012-10-02 15:42:21 +0000204 'OTHER_CPLUSPLUSFLAGS': [
205 '-mssse3',
206 '-fvisibility=hidden',
207 '-fvisibility-inlines-hidden',
208 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000209 },
210 },
211 ],
212
chudy@google.combbad34d2012-08-13 14:26:36 +0000213 ['skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000214 {
215 'defines': [
216 'SK_BUILD_FOR_IOS',
217 ],
218 'configurations': {
219 'Debug': {
220 'xcode_settings': {
221 'GCC_OPTIMIZATION_LEVEL': '0',
222 },
223 },
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000224 'Release': {
225 'xcode_settings': {
226 'GCC_OPTIMIZATION_LEVEL': '3',
227 },
228 'defines': [ 'NDEBUG' ],
229 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000230 },
231 'xcode_settings': {
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000232 'ARCHS': 'armv6 armv7',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000233 'CODE_SIGNING_REQUIRED': 'NO',
234 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000235 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000236 'SDKROOT': 'iphoneos',
caryclark@google.com594dd3c2012-09-24 19:33:57 +0000237 'TARGETED_DEVICE_FAMILY': '1,2',
caryclark@google.com867cbd82012-09-20 15:45:41 +0000238 'OTHER_CPLUSPLUSFLAGS': '-fvisibility=hidden -fvisibility-inlines-hidden',
bsalomon@google.com89dec582012-09-28 18:33:11 +0000239 'GCC_THUMB_SUPPORT': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000240 },
241 },
242 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000243
244 ['skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000245 {
246 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000247 'SK_BUILD_FOR_ANDROID',
248 'SK_BUILD_FOR_ANDROID_NDK',
249 ],
250 'configurations': {
251 'Debug': {
252 'cflags': ['-g']
253 },
254 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000255 'cflags': ['-O2'],
256 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000257 },
258 },
259 'libraries': [
260 '-lstdc++',
261 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000262 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000263 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000264 'cflags': [
265 '-fno-exceptions',
266 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000267 '-fuse-ld=gold',
268 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
269 ],
270 'include_dirs' : [
271 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
272 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
273 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
274 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
275 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000276 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000277 'conditions': [
djsollen@google.come341cb32012-06-28 16:08:05 +0000278 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000279 'ldflags': [
280 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000281 ],
282 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000283 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000284 'cflags': [
285 '-mthumb',
286 ],
287 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000288 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000289 'variables': {
290 'arm_neon_optional%': 0,
291 },
djsollen@google.com58629292011-11-03 13:08:29 +0000292 'defines': [
293 '__ARM_ARCH__=7',
294 ],
295 'cflags': [
296 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000297 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000298 ],
299 'conditions': [
300 [ 'arm_neon == 1', {
301 'defines': [
302 '__ARM_HAVE_NEON',
303 ],
304 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000305 '-mfpu=neon',
306 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000307 }],
308 [ 'arm_neon_optional == 1', {
309 'defines': [
310 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
311 ],
312 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000313 ],
314 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000315 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000316 },
317 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000318
digit@google.com1771cbf2012-01-26 21:26:40 +0000319 # We can POD-style initialization of static mutexes to avoid generating
320 # static initializers if we're using a pthread-compatible thread interface.
321 [ 'skia_os != "win"', {
322 'defines': [
323 'SK_USE_POSIX_THREADS'
324 ],
325 }],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000326 ], # end 'conditions'
caryclark@google.com4588ce82012-09-26 15:48:43 +0000327 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
328 'xcode_settings': {
329 'SYMROOT': '<(DEPTH)/xcodebuild',
330 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000331}
332
333# Local Variables:
334# tab-width:2
335# indent-tabs-mode:nil
336# End:
337# vim: set expandtab tabstop=2 shiftwidth=2: