blob: 2b9800f79e4a6b6151a606b2da74e854dda5e2a1 [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{
4 'conditions' : [
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +00005 ['skia_gpu == 1',
6 {
7 'defines': [
8 'SK_SUPPORT_GPU=1',
9 ],
10 }, {
11 'defines': [
12 'SK_SUPPORT_GPU=0',
13 ],
14 },
15 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000016 ['skia_os == "win"',
17 {
18 'defines': [
19 'SK_BUILD_FOR_WIN32',
20 'SK_IGNORE_STDINT_DOT_H',
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': {
27 'WarningLevel': '1',
28 'WarnAsError': 'false',
29 'DebugInformationFormat': '3',
seanpaul@google.com8f78fec2011-09-16 15:47:33 +000030 'AdditionalOptions': [ '/MP' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000031 },
32 'VCLinkerTool': {
33 'AdditionalDependencies': [
34 'OpenGL32.lib',
35 'usp10.lib',
36 ],
37 },
38 },
39 'configurations': {
40 'Debug': {
41 'msvs_settings': {
42 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000043 'DebugInformationFormat': '4', # editAndContiue (/ZI)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000044 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000045 'Optimization': '0', # optimizeDisabled (/Od)
46 'PreprocessorDefinitions': ['_DEBUG'],
47 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000048 'ExceptionHandling': '0',
49 'RuntimeTypeInfo': 'false', # /GR-
50 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000051 },
52 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000053 'GenerateDebugInformation': 'true', # /DEBUG
54 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000055 },
56 },
57 },
58 'Release': {
59 'msvs_settings': {
60 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000061 'DebugInformationFormat': '3', # programDatabase (/Zi)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000062 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000063 'Optimization': '3', # full (/Ox)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000064 'WholeProgramOptimization': 'true', #/GL
65 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000066 #'FloatingPointModel': '2', # fast (/fp:fast)
67 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000068 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000069 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000070 'ExceptionHandling': '0',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000071 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
72 'RuntimeTypeInfo': 'false', # /GR-
73 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000074 },
75 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000076 'GenerateDebugInformation': 'true', # /DEBUG
77 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000078 },
bungeman@google.com983297e2011-10-03 19:36:51 +000079 'VCLibrarianTool': {
80 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
81 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000082 },
83 },
84 },
85 },
86 ],
87
88 ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
89 {
90 'defines': [
91 'SK_SAMPLES_FOR_X',
92 'SK_BUILD_FOR_UNIX',
93 ],
94 'configurations': {
95 'Debug': {
96 'cflags': ['-g']
97 },
98 'Release': {
bungeman@google.com97efada2012-07-30 20:40:50 +000099 'cflags': ['-O3 -g'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000100 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000101 },
102 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +0000103 'cflags': [
104 # TODO(tony): Enable -Werror once all the strict-aliasing problems
105 # are fixed.
106 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +0000107 '-Wall',
108 '-Wextra',
109 '-Wno-unused',
110 # suppressions below here were added for clang
111 '-Wno-unused-parameter',
112 '-Wno-c++11-extensions'
113 ],
borenet@google.coma37a5172012-08-09 20:44:32 +0000114 'conditions' : [
115 ['skia_arch_width == 64', {
116 'cflags': [
117 '-m64',
118 ],
119 'ldflags': [
120 '-m64',
121 ],
122 }],
123 ['skia_arch_width == 32', {
124 'cflags': [
125 '-m32',
126 ],
127 'ldflags': [
128 '-m32',
129 ],
130 }],
131 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000132 'include_dirs' : [
133 '/usr/include/freetype2',
134 ],
135 },
136 ],
137
138 ['skia_os == "mac"',
139 {
140 'defines': [
141 'SK_BUILD_FOR_MAC',
142 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000143 'conditions' : [
144 ['skia_arch_width == 64', {
145 'xcode_settings': {
146 'ARCHS': 'x86_64',
147 },
148 }],
149 ['skia_arch_width == 32', {
150 'xcode_settings': {
151 'ARCHS': 'i386',
152 },
153 }],
154 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000155 'configurations': {
156 'Debug': {
157 'xcode_settings': {
158 'GCC_OPTIMIZATION_LEVEL': '0',
159 },
160 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000161 'Release': {
162 'xcode_settings': {
163 'GCC_OPTIMIZATION_LEVEL': '3',
164 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000165 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000166 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000167 },
168 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000169 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000170 'SYMROOT': '<(DEPTH)/xcodebuild',
bsalomon@google.com4d5cb452011-10-12 18:12:11 +0000171 'SDKROOT': 'macosx10.6',
reed@google.com0069aa52011-11-17 15:35:47 +0000172# trying to get this to work, but it needs clang I think...
173# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000174 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000175 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
176 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
177 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
178 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
179 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
180 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
181 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
182 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
183 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
184 'GCC_WARN_MISSING_PARENTHESES': 'YES',
185 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
186 'GCC_WARN_SIGN_COMPARE': 'YES',
187 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
188 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
189 'GCC_WARN_UNUSED_FUNCTION': 'YES',
190 'GCC_WARN_UNUSED_LABEL': 'YES',
191 'GCC_WARN_UNUSED_VALUE': 'YES',
192 'GCC_WARN_UNUSED_VARIABLE': 'YES',
caryclark@google.come5720e32012-05-31 12:39:18 +0000193 'OTHER_CPLUSPLUSFLAGS': '-mssse3 -fvisibility=hidden -fvisibility-inlines-hidden',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000194 },
195 },
196 ],
197
198 ['skia_os == "ios"',
199 {
200 'defines': [
201 'SK_BUILD_FOR_IOS',
202 ],
203 'configurations': {
204 'Debug': {
205 'xcode_settings': {
206 'GCC_OPTIMIZATION_LEVEL': '0',
207 },
208 },
209 },
210 'xcode_settings': {
211 'SYMROOT': '<(DEPTH)/xcodebuild',
212 },
213 },
214 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000215
216 ['skia_os == "android"',
217 {
218 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000219 'SK_BUILD_FOR_ANDROID',
220 'SK_BUILD_FOR_ANDROID_NDK',
digit@google.com70ccffe2012-01-10 10:28:30 +0000221 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
djsollen@google.com58629292011-11-03 13:08:29 +0000222 ],
223 'configurations': {
224 'Debug': {
225 'cflags': ['-g']
226 },
227 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000228 'cflags': ['-O2'],
229 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000230 },
231 },
232 'libraries': [
233 '-lstdc++',
234 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000235 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000236 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000237 'cflags': [
238 '-fno-exceptions',
239 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000240 '-fuse-ld=gold',
241 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
242 ],
243 'include_dirs' : [
244 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
245 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
246 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
247 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
248 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000249 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000250 'conditions': [
djsollen@google.come341cb32012-06-28 16:08:05 +0000251 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000252 'ldflags': [
253 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000254 ],
255 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000256 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000257 'cflags': [
258 '-mthumb',
259 ],
260 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000261 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000262 'variables': {
263 'arm_neon_optional%': 0,
264 },
djsollen@google.com58629292011-11-03 13:08:29 +0000265 'defines': [
266 '__ARM_ARCH__=7',
267 ],
268 'cflags': [
269 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000270 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000271 ],
272 'conditions': [
273 [ 'arm_neon == 1', {
274 'defines': [
275 '__ARM_HAVE_NEON',
276 ],
277 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000278 '-mfpu=neon',
279 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000280 }],
281 [ 'arm_neon_optional == 1', {
282 'defines': [
283 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
284 ],
285 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000286 ],
287 }],
288 ],
289 },
290 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000291
digit@google.com1771cbf2012-01-26 21:26:40 +0000292 # We can POD-style initialization of static mutexes to avoid generating
293 # static initializers if we're using a pthread-compatible thread interface.
294 [ 'skia_os != "win"', {
295 'defines': [
296 'SK_USE_POSIX_THREADS'
297 ],
298 }],
299
seanpaul@google.com1134f982011-09-15 14:24:33 +0000300 ], # end 'conditions'
301}
302
303# Local Variables:
304# tab-width:2
305# indent-tabs-mode:nil
306# End:
307# vim: set expandtab tabstop=2 shiftwidth=2: