blob: eff47bf8b0b25d11140b18d341d337b8798996c7 [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 },
88 },
89 ],
90
91 ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
92 {
93 'defines': [
94 'SK_SAMPLES_FOR_X',
95 'SK_BUILD_FOR_UNIX',
96 ],
97 'configurations': {
98 'Debug': {
99 'cflags': ['-g']
100 },
101 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +0000102 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000103 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000104 },
105 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000106 'cflags': [
107 # TODO(tony): Enable -Werror once all the strict-aliasing problems
108 # are fixed.
109 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000110 '-Wall',
111 '-Wextra',
112 '-Wno-unused',
113 # suppressions below here were added for clang
114 '-Wno-unused-parameter',
115 '-Wno-c++11-extensions'
116 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000117 'conditions' : [
118 ['skia_arch_width == 64', {
119 'cflags': [
120 '-m64',
121 ],
122 'ldflags': [
123 '-m64',
124 ],
125 }],
126 ['skia_arch_width == 32', {
127 'cflags': [
128 '-m32',
129 ],
130 'ldflags': [
131 '-m32',
132 ],
133 }],
134 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000135 'include_dirs' : [
136 '/usr/include/freetype2',
137 ],
138 },
139 ],
140
chudy@google.combbad34d2012-08-13 14:26:36 +0000141 ['skia_os == "mac"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000142 {
143 'defines': [
144 'SK_BUILD_FOR_MAC',
145 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000146 'conditions' : [
147 ['skia_arch_width == 64', {
148 'xcode_settings': {
149 'ARCHS': 'x86_64',
150 },
151 }],
152 ['skia_arch_width == 32', {
153 'xcode_settings': {
154 'ARCHS': 'i386',
155 },
156 }],
157 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000158 'configurations': {
159 'Debug': {
160 'xcode_settings': {
161 'GCC_OPTIMIZATION_LEVEL': '0',
162 },
163 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000164 'Release': {
165 'xcode_settings': {
166 'GCC_OPTIMIZATION_LEVEL': '3',
167 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000168 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000169 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000170 },
171 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000172 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000173 'SYMROOT': '<(DEPTH)/xcodebuild',
bsalomon@google.com4d5cb452011-10-12 18:12:11 +0000174 'SDKROOT': 'macosx10.6',
reed@google.com0069aa52011-11-17 15:35:47 +0000175# trying to get this to work, but it needs clang I think...
176# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000177 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000178 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
179 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
180 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
181 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
182 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
183 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
184 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
185 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
186 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
187 'GCC_WARN_MISSING_PARENTHESES': 'YES',
188 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
189 'GCC_WARN_SIGN_COMPARE': 'YES',
190 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
191 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
192 'GCC_WARN_UNUSED_FUNCTION': 'YES',
193 'GCC_WARN_UNUSED_LABEL': 'YES',
194 'GCC_WARN_UNUSED_VALUE': 'YES',
195 'GCC_WARN_UNUSED_VARIABLE': 'YES',
caryclark@google.come5720e32012-05-31 12:39:18 +0000196 'OTHER_CPLUSPLUSFLAGS': '-mssse3 -fvisibility=hidden -fvisibility-inlines-hidden',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000197 },
198 },
199 ],
200
chudy@google.combbad34d2012-08-13 14:26:36 +0000201 ['skia_os == "ios"',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000202 {
203 'defines': [
204 'SK_BUILD_FOR_IOS',
205 ],
206 'configurations': {
207 'Debug': {
208 'xcode_settings': {
209 'GCC_OPTIMIZATION_LEVEL': '0',
210 },
211 },
212 },
213 'xcode_settings': {
214 'SYMROOT': '<(DEPTH)/xcodebuild',
215 },
216 },
217 ],
chudy@google.combbad34d2012-08-13 14:26:36 +0000218
219 ['skia_os == "android"',
djsollen@google.com58629292011-11-03 13:08:29 +0000220 {
221 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000222 'SK_BUILD_FOR_ANDROID',
223 'SK_BUILD_FOR_ANDROID_NDK',
digit@google.com70ccffe2012-01-10 10:28:30 +0000224 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
djsollen@google.com58629292011-11-03 13:08:29 +0000225 ],
226 'configurations': {
227 'Debug': {
228 'cflags': ['-g']
229 },
230 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000231 'cflags': ['-O2'],
232 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000233 },
234 },
235 'libraries': [
236 '-lstdc++',
237 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000238 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000239 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000240 'cflags': [
241 '-fno-exceptions',
242 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000243 '-fuse-ld=gold',
244 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
245 ],
246 'include_dirs' : [
247 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
248 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
249 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
250 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
251 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000252 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000253 'conditions': [
djsollen@google.come341cb32012-06-28 16:08:05 +0000254 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000255 'ldflags': [
256 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000257 ],
258 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000259 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000260 'cflags': [
261 '-mthumb',
262 ],
263 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000264 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000265 'variables': {
266 'arm_neon_optional%': 0,
267 },
djsollen@google.com58629292011-11-03 13:08:29 +0000268 'defines': [
269 '__ARM_ARCH__=7',
270 ],
271 'cflags': [
272 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000273 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000274 ],
275 'conditions': [
276 [ 'arm_neon == 1', {
277 'defines': [
278 '__ARM_HAVE_NEON',
279 ],
280 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000281 '-mfpu=neon',
282 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000283 }],
284 [ 'arm_neon_optional == 1', {
285 'defines': [
286 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
287 ],
288 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000289 ],
290 }],
chudy@google.combbad34d2012-08-13 14:26:36 +0000291 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000292 },
293 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000294
digit@google.com1771cbf2012-01-26 21:26:40 +0000295 # We can POD-style initialization of static mutexes to avoid generating
296 # static initializers if we're using a pthread-compatible thread interface.
297 [ 'skia_os != "win"', {
298 'defines': [
299 'SK_USE_POSIX_THREADS'
300 ],
301 }],
302
seanpaul@google.com1134f982011-09-15 14:24:33 +0000303 ], # end 'conditions'
304}
305
306# Local Variables:
307# tab-width:2
308# indent-tabs-mode:nil
309# End:
310# vim: set expandtab tabstop=2 shiftwidth=2: