blob: 1256ef6760ab66f0c2b47dc85d94c75b6cb5d31c [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)',
6 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +00007 'conditions' : [
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +00008 ['skia_gpu == 1',
9 {
10 'defines': [
11 'SK_SUPPORT_GPU=1',
12 ],
13 }, {
14 'defines': [
15 'SK_SUPPORT_GPU=0',
16 ],
17 },
18 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000019 ['skia_os == "win"',
20 {
21 'defines': [
22 'SK_BUILD_FOR_WIN32',
23 'SK_IGNORE_STDINT_DOT_H',
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000024 '_CRT_SECURE_NO_WARNINGS',
senorblanco@chromium.org5f47a392012-07-12 00:34:39 +000025 'GR_GL_FUNCTION_TYPE=__stdcall',
seanpaul@google.com1134f982011-09-15 14:24:33 +000026 ],
27 'msvs_cygwin_shell': 0,
28 'msvs_settings': {
29 'VCCLCompilerTool': {
30 'WarningLevel': '1',
31 'WarnAsError': 'false',
32 'DebugInformationFormat': '3',
seanpaul@google.com8f78fec2011-09-16 15:47:33 +000033 'AdditionalOptions': [ '/MP' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000034 },
35 'VCLinkerTool': {
36 'AdditionalDependencies': [
37 'OpenGL32.lib',
38 'usp10.lib',
39 ],
40 },
41 },
42 'configurations': {
43 'Debug': {
44 'msvs_settings': {
45 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000046 'DebugInformationFormat': '4', # editAndContiue (/ZI)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000047 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000048 'Optimization': '0', # optimizeDisabled (/Od)
49 'PreprocessorDefinitions': ['_DEBUG'],
50 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000051 'ExceptionHandling': '0',
52 'RuntimeTypeInfo': 'false', # /GR-
53 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000054 },
55 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000056 'GenerateDebugInformation': 'true', # /DEBUG
57 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000058 },
59 },
60 },
61 'Release': {
62 'msvs_settings': {
63 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000064 'DebugInformationFormat': '3', # programDatabase (/Zi)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000065 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000066 'Optimization': '3', # full (/Ox)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000067 'WholeProgramOptimization': 'true', #/GL
68 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000069 #'FloatingPointModel': '2', # fast (/fp:fast)
70 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000071 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000072 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000073 'ExceptionHandling': '0',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000074 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
75 'RuntimeTypeInfo': 'false', # /GR-
76 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000077 },
78 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000079 'GenerateDebugInformation': 'true', # /DEBUG
80 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000081 },
bungeman@google.com983297e2011-10-03 19:36:51 +000082 'VCLibrarianTool': {
83 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
84 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000085 },
86 },
87 },
borenet@google.comb7961192012-08-20 18:58:26 +000088 'conditions' : [
89 ['skia_arch_width == 64', {
90 'msvs_configuration_platform': 'x64'
91 }],
92 ['skia_arch_width == 32', {
93 'msvs_configuration_platform': 'Win32',
94 }],
95 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000096 },
97 ],
98
99 ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
100 {
101 'defines': [
102 'SK_SAMPLES_FOR_X',
103 'SK_BUILD_FOR_UNIX',
104 ],
105 'configurations': {
106 'Debug': {
107 'cflags': ['-g']
108 },
109 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000110 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000111 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000112 },
113 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000114 'cflags': [
115 # TODO(tony): Enable -Werror once all the strict-aliasing problems
116 # are fixed.
117 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000118 '-Wall',
119 '-Wextra',
120 '-Wno-unused',
121 # suppressions below here were added for clang
122 '-Wno-unused-parameter',
123 '-Wno-c++11-extensions'
124 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000125 'conditions' : [
126 ['skia_arch_width == 64', {
127 'cflags': [
128 '-m64',
129 ],
130 'ldflags': [
131 '-m64',
132 ],
133 }],
134 ['skia_arch_width == 32', {
135 'cflags': [
136 '-m32',
137 ],
138 'ldflags': [
139 '-m32',
140 ],
141 }],
142 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000143 'include_dirs' : [
144 '/usr/include/freetype2',
145 ],
146 },
147 ],
148
chudy@google.combbad34d2012-08-13 14:26:36 +0000149 ['skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000150 {
151 'defines': [
152 'SK_BUILD_FOR_MAC',
153 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000154 'conditions' : [
155 ['skia_arch_width == 64', {
156 'xcode_settings': {
157 'ARCHS': 'x86_64',
158 },
159 }],
160 ['skia_arch_width == 32', {
161 'xcode_settings': {
162 'ARCHS': 'i386',
163 },
164 }],
165 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000166 'configurations': {
167 'Debug': {
168 'xcode_settings': {
169 'GCC_OPTIMIZATION_LEVEL': '0',
170 },
171 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000172 'Release': {
173 'xcode_settings': {
174 'GCC_OPTIMIZATION_LEVEL': '3',
175 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000176 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000177 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000178 },
179 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000180 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000181 'SYMROOT': '<(DEPTH)/xcodebuild',
bsalomon@google.com4d5cb452011-10-12 18:12:11 +0000182 'SDKROOT': 'macosx10.6',
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',
caryclark@google.come5720e32012-05-31 12:39:18 +0000204 'OTHER_CPLUSPLUSFLAGS': '-mssse3 -fvisibility=hidden -fvisibility-inlines-hidden',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000205 },
206 },
207 ],
208
chudy@google.combbad34d2012-08-13 14:26:36 +0000209 ['skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000210 {
211 'defines': [
212 'SK_BUILD_FOR_IOS',
213 ],
214 'configurations': {
215 'Debug': {
216 'xcode_settings': {
217 'GCC_OPTIMIZATION_LEVEL': '0',
218 },
219 },
220 },
221 'xcode_settings': {
222 'SYMROOT': '<(DEPTH)/xcodebuild',
223 },
224 },
225 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000226
227 ['skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000228 {
229 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000230 'SK_BUILD_FOR_ANDROID',
231 'SK_BUILD_FOR_ANDROID_NDK',
232 ],
233 'configurations': {
234 'Debug': {
235 'cflags': ['-g']
236 },
237 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000238 'cflags': ['-O2'],
239 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000240 },
241 },
242 'libraries': [
243 '-lstdc++',
244 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000245 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000246 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000247 'cflags': [
248 '-fno-exceptions',
249 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000250 '-fuse-ld=gold',
251 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
252 ],
253 'include_dirs' : [
254 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
255 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
256 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
257 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
258 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000259 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000260 'conditions': [
djsollen@google.come341cb32012-06-28 16:08:05 +0000261 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000262 'ldflags': [
263 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000264 ],
265 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000266 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000267 'cflags': [
268 '-mthumb',
269 ],
270 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000271 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000272 'variables': {
273 'arm_neon_optional%': 0,
274 },
djsollen@google.com58629292011-11-03 13:08:29 +0000275 'defines': [
276 '__ARM_ARCH__=7',
277 ],
278 'cflags': [
279 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000280 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000281 ],
282 'conditions': [
283 [ 'arm_neon == 1', {
284 'defines': [
285 '__ARM_HAVE_NEON',
286 ],
287 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000288 '-mfpu=neon',
289 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000290 }],
291 [ 'arm_neon_optional == 1', {
292 'defines': [
293 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
294 ],
295 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000296 ],
297 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000298 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000299 },
300 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000301
digit@google.com1771cbf2012-01-26 21:26:40 +0000302 # We can POD-style initialization of static mutexes to avoid generating
303 # static initializers if we're using a pthread-compatible thread interface.
304 [ 'skia_os != "win"', {
305 'defines': [
306 'SK_USE_POSIX_THREADS'
307 ],
308 }],
309
seanpaul@google.com1134f982011-09-15 14:24:33 +0000310 ], # end 'conditions'
311}
312
313# Local Variables:
314# tab-width:2
315# indent-tabs-mode:nil
316# End:
317# vim: set expandtab tabstop=2 shiftwidth=2: