blob: 2f58c1b6e63ee79e75441993af23093a506e15a2 [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' : [
5
6 ['skia_os == "win"',
7 {
8 'defines': [
9 'SK_BUILD_FOR_WIN32',
10 'SK_IGNORE_STDINT_DOT_H',
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000011 '_CRT_SECURE_NO_WARNINGS',
senorblanco@chromium.org5f47a392012-07-12 00:34:39 +000012 'GR_GL_FUNCTION_TYPE=__stdcall',
seanpaul@google.com1134f982011-09-15 14:24:33 +000013 ],
14 'msvs_cygwin_shell': 0,
15 'msvs_settings': {
16 'VCCLCompilerTool': {
17 'WarningLevel': '1',
18 'WarnAsError': 'false',
19 'DebugInformationFormat': '3',
seanpaul@google.com8f78fec2011-09-16 15:47:33 +000020 'AdditionalOptions': [ '/MP' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000021 },
22 'VCLinkerTool': {
23 'AdditionalDependencies': [
24 'OpenGL32.lib',
25 'usp10.lib',
26 ],
27 },
28 },
29 'configurations': {
30 'Debug': {
31 'msvs_settings': {
32 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000033 'DebugInformationFormat': '4', # editAndContiue (/ZI)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000034 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000035 'Optimization': '0', # optimizeDisabled (/Od)
36 'PreprocessorDefinitions': ['_DEBUG'],
37 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000038 'ExceptionHandling': '0',
39 'RuntimeTypeInfo': 'false', # /GR-
40 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000041 },
42 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000043 'GenerateDebugInformation': 'true', # /DEBUG
44 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000045 },
46 },
47 },
48 'Release': {
49 'msvs_settings': {
50 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000051 'DebugInformationFormat': '3', # programDatabase (/Zi)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000052 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000053 'Optimization': '3', # full (/Ox)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000054 'WholeProgramOptimization': 'true', #/GL
55 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000056 #'FloatingPointModel': '2', # fast (/fp:fast)
57 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000058 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000059 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000060 'ExceptionHandling': '0',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000061 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
62 'RuntimeTypeInfo': 'false', # /GR-
63 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000064 },
65 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000066 'GenerateDebugInformation': 'true', # /DEBUG
67 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000068 },
bungeman@google.com983297e2011-10-03 19:36:51 +000069 'VCLibrarianTool': {
70 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
71 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000072 },
73 },
74 },
75 },
76 ],
77
78 ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
79 {
80 'defines': [
81 'SK_SAMPLES_FOR_X',
82 'SK_BUILD_FOR_UNIX',
reed@google.com1ac83502012-02-28 17:06:02 +000083 'SK_USE_COLOR_LUMINANCE',
84 'SK_GAMMA_APPLY_TO_A8',
seanpaul@google.com1134f982011-09-15 14:24:33 +000085 ],
86 'configurations': {
87 'Debug': {
88 'cflags': ['-g']
89 },
90 'Release': {
reed@google.comff793db2012-05-17 13:58:26 +000091 'cflags': ['-O3'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +000092 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000093 },
94 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +000095 'cflags': [
96 # TODO(tony): Enable -Werror once all the strict-aliasing problems
97 # are fixed.
98 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +000099 '-Wall',
100 '-Wextra',
101 '-Wno-unused',
102 # suppressions below here were added for clang
103 '-Wno-unused-parameter',
104 '-Wno-c++11-extensions'
105 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000106 'include_dirs' : [
107 '/usr/include/freetype2',
108 ],
109 },
110 ],
111
112 ['skia_os == "mac"',
113 {
114 'defines': [
115 'SK_BUILD_FOR_MAC',
116 ],
djsollen@google.come341cb32012-06-28 16:08:05 +0000117 'conditions' : [
118 ['skia_arch_width == 64', {
119 'xcode_settings': {
120 'ARCHS': 'x86_64',
121 },
122 }],
123 ['skia_arch_width == 32', {
124 'xcode_settings': {
125 'ARCHS': 'i386',
126 },
127 }],
128 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000129 'configurations': {
130 'Debug': {
131 'xcode_settings': {
132 'GCC_OPTIMIZATION_LEVEL': '0',
133 },
134 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000135 'Release': {
136 'xcode_settings': {
137 'GCC_OPTIMIZATION_LEVEL': '3',
138 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000139 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000140 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000141 },
142 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000143 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000144 'SYMROOT': '<(DEPTH)/xcodebuild',
bsalomon@google.com4d5cb452011-10-12 18:12:11 +0000145 'SDKROOT': 'macosx10.6',
reed@google.com0069aa52011-11-17 15:35:47 +0000146# trying to get this to work, but it needs clang I think...
147# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000148 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000149 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
150 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
151 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
152 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
153 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
154 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
155 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
156 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
157 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
158 'GCC_WARN_MISSING_PARENTHESES': 'YES',
159 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
160 'GCC_WARN_SIGN_COMPARE': 'YES',
161 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
162 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
163 'GCC_WARN_UNUSED_FUNCTION': 'YES',
164 'GCC_WARN_UNUSED_LABEL': 'YES',
165 'GCC_WARN_UNUSED_VALUE': 'YES',
166 'GCC_WARN_UNUSED_VARIABLE': 'YES',
caryclark@google.come5720e32012-05-31 12:39:18 +0000167 'OTHER_CPLUSPLUSFLAGS': '-mssse3 -fvisibility=hidden -fvisibility-inlines-hidden',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000168 },
169 },
170 ],
171
172 ['skia_os == "ios"',
173 {
174 'defines': [
175 'SK_BUILD_FOR_IOS',
176 ],
177 'configurations': {
178 'Debug': {
179 'xcode_settings': {
180 'GCC_OPTIMIZATION_LEVEL': '0',
181 },
182 },
183 },
184 'xcode_settings': {
185 'SYMROOT': '<(DEPTH)/xcodebuild',
186 },
187 },
188 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000189
190 ['skia_os == "android"',
191 {
192 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000193 'SK_BUILD_FOR_ANDROID',
194 'SK_BUILD_FOR_ANDROID_NDK',
digit@google.com70ccffe2012-01-10 10:28:30 +0000195 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
djsollen@google.com58629292011-11-03 13:08:29 +0000196 ],
197 'configurations': {
198 'Debug': {
199 'cflags': ['-g']
200 },
201 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000202 'cflags': ['-O2'],
203 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000204 },
205 },
206 'libraries': [
207 '-lstdc++',
208 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000209 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000210 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000211 'cflags': [
212 '-fno-exceptions',
213 '-fno-rtti',
borenet@google.comde9ac142012-07-25 15:17:03 +0000214 '-fuse-ld=gold',
215 '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot',
216 ],
217 'include_dirs' : [
218 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include',
219 '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed',
220 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6',
221 '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi',
222 '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include',
djsollen@google.com44360bc2011-12-05 13:55:55 +0000223 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000224 'conditions': [
djsollen@google.come341cb32012-06-28 16:08:05 +0000225 [ 'skia_arch_type == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000226 'ldflags': [
227 '-Wl',
djsollen@google.comcf740302012-02-24 14:09:02 +0000228 ],
229 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000230 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
djsollen@google.com3839ca12011-11-03 17:31:41 +0000231 'cflags': [
232 '-mthumb',
233 ],
234 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000235 [ 'skia_arch_type == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000236 'variables': {
237 'arm_neon_optional%': 0,
238 },
djsollen@google.com58629292011-11-03 13:08:29 +0000239 'defines': [
240 '__ARM_ARCH__=7',
241 ],
242 'cflags': [
243 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000244 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000245 ],
246 'conditions': [
247 [ 'arm_neon == 1', {
248 'defines': [
249 '__ARM_HAVE_NEON',
250 ],
251 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000252 '-mfpu=neon',
253 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000254 }],
255 [ 'arm_neon_optional == 1', {
256 'defines': [
257 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
258 ],
259 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000260 ],
261 }],
262 ],
263 },
264 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000265
digit@google.com1771cbf2012-01-26 21:26:40 +0000266 # We can POD-style initialization of static mutexes to avoid generating
267 # static initializers if we're using a pthread-compatible thread interface.
268 [ 'skia_os != "win"', {
269 'defines': [
270 'SK_USE_POSIX_THREADS'
271 ],
272 }],
273
seanpaul@google.com1134f982011-09-15 14:24:33 +0000274 ], # end 'conditions'
275}
276
277# Local Variables:
278# tab-width:2
279# indent-tabs-mode:nil
280# End:
281# vim: set expandtab tabstop=2 shiftwidth=2: