blob: 143e85442ba0e2db24a5fbc9d2bba62387212321 [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 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000114 'include_dirs' : [
115 '/usr/include/freetype2',
116 ],
117 },
118 ],
119
120 ['skia_os == "mac"',
121 {
122 'defines': [
123 'SK_BUILD_FOR_MAC',
124 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000125 'conditions' : [
126 ['skia_arch_width == 64', {
127 'xcode_settings': {
128 'ARCHS': 'x86_64',
129 },
130 }],
131 ['skia_arch_width == 32', {
132 'xcode_settings': {
133 'ARCHS': 'i386',
134 },
135 }],
136 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000137 'configurations': {
138 'Debug': {
139 'xcode_settings': {
140 'GCC_OPTIMIZATION_LEVEL': '0',
141 },
142 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000143 'Release': {
144 'xcode_settings': {
145 'GCC_OPTIMIZATION_LEVEL': '3',
146 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000147 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000148 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000149 },
150 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000151 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000152 'SYMROOT': '<(DEPTH)/xcodebuild',
bsalomon@google.com4d5cb452011-10-12 18:12:11 +0000153 'SDKROOT': 'macosx10.6',
reed@google.com0069aa52011-11-17 15:35:47 +0000154# trying to get this to work, but it needs clang I think...
155# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000156 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000157 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
158 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
159 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
160 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
161 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
162 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
163 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
164 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
165 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
166 'GCC_WARN_MISSING_PARENTHESES': 'YES',
167 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
168 'GCC_WARN_SIGN_COMPARE': 'YES',
169 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
170 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
171 'GCC_WARN_UNUSED_FUNCTION': 'YES',
172 'GCC_WARN_UNUSED_LABEL': 'YES',
173 'GCC_WARN_UNUSED_VALUE': 'YES',
174 'GCC_WARN_UNUSED_VARIABLE': 'YES',
caryclark@google.come5720e32012-05-31 12:39:18 +0000175 'OTHER_CPLUSPLUSFLAGS': '-mssse3 -fvisibility=hidden -fvisibility-inlines-hidden',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000176 },
177 },
178 ],
179
180 ['skia_os == "ios"',
181 {
182 'defines': [
183 'SK_BUILD_FOR_IOS',
184 ],
185 'configurations': {
186 'Debug': {
187 'xcode_settings': {
188 'GCC_OPTIMIZATION_LEVEL': '0',
189 },
190 },
191 },
192 'xcode_settings': {
193 'SYMROOT': '<(DEPTH)/xcodebuild',
194 },
195 },
196 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000197
198 ['skia_os == "android"',
199 {
200 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000201 'SK_BUILD_FOR_ANDROID',
202 'SK_BUILD_FOR_ANDROID_NDK',
digit@google.com70ccffe2012-01-10 10:28:30 +0000203 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
djsollen@google.com58629292011-11-03 13:08:29 +0000204 ],
205 'configurations': {
206 'Debug': {
207 'cflags': ['-g']
208 },
209 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000210 'cflags': ['-O2'],
211 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000212 },
213 },
214 'libraries': [
215 '-lstdc++',
216 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000217 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000218 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000219 'cflags': [
220 '-fno-exceptions',
221 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000222 '-fuse-ld=gold',
223 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
224 ],
225 'include_dirs' : [
226 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
227 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
228 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
229 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
230 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000231 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000232 'conditions': [
djsollen@google.come341cb32012-06-28 16:08:05 +0000233 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000234 'ldflags': [
235 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000236 ],
237 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000238 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000239 'cflags': [
240 '-mthumb',
241 ],
242 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000243 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000244 'variables': {
245 'arm_neon_optional%': 0,
246 },
djsollen@google.com58629292011-11-03 13:08:29 +0000247 'defines': [
248 '__ARM_ARCH__=7',
249 ],
250 'cflags': [
251 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000252 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000253 ],
254 'conditions': [
255 [ 'arm_neon == 1', {
256 'defines': [
257 '__ARM_HAVE_NEON',
258 ],
259 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000260 '-mfpu=neon',
261 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000262 }],
263 [ 'arm_neon_optional == 1', {
264 'defines': [
265 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
266 ],
267 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000268 ],
269 }],
270 ],
271 },
272 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000273
digit@google.com1771cbf2012-01-26 21:26:40 +0000274 # We can POD-style initialization of static mutexes to avoid generating
275 # static initializers if we're using a pthread-compatible thread interface.
276 [ 'skia_os != "win"', {
277 'defines': [
278 'SK_USE_POSIX_THREADS'
279 ],
280 }],
281
seanpaul@google.com1134f982011-09-15 14:24:33 +0000282 ], # end 'conditions'
283}
284
285# Local Variables:
286# tab-width:2
287# indent-tabs-mode:nil
288# End:
289# vim: set expandtab tabstop=2 shiftwidth=2: