blob: f73fa505196e279ed9a432db1153c5f2e2569457 [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',
seanpaul@google.com1134f982011-09-15 14:24:33 +000012 ],
13 'msvs_cygwin_shell': 0,
14 'msvs_settings': {
15 'VCCLCompilerTool': {
16 'WarningLevel': '1',
17 'WarnAsError': 'false',
18 'DebugInformationFormat': '3',
seanpaul@google.com8f78fec2011-09-16 15:47:33 +000019 'AdditionalOptions': [ '/MP' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000020 },
21 'VCLinkerTool': {
22 'AdditionalDependencies': [
23 'OpenGL32.lib',
24 'usp10.lib',
25 ],
26 },
27 },
28 'configurations': {
29 'Debug': {
30 'msvs_settings': {
31 'VCCLCompilerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000032 'DebugInformationFormat': '4', # editAndContiue (/ZI)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000033 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
seanpaul@google.com1134f982011-09-15 14:24:33 +000034 'Optimization': '0', # optimizeDisabled (/Od)
35 'PreprocessorDefinitions': ['_DEBUG'],
36 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000037 'ExceptionHandling': '0',
38 'RuntimeTypeInfo': 'false', # /GR-
39 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000040 },
41 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000042 'GenerateDebugInformation': 'true', # /DEBUG
43 'LinkIncremental': '2', # /INCREMENTAL
seanpaul@google.com1134f982011-09-15 14:24:33 +000044 },
45 },
46 },
47 'Release': {
48 'msvs_settings': {
49 'VCCLCompilerTool': {
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000050 'DebugInformationFormat': '3', # programDatabase (/Zi)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000051 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000052 'Optimization': '3', # full (/Ox)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000053 'WholeProgramOptimization': 'true', #/GL
54 # Changing the floating point model requires rebaseling gm images
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000055 #'FloatingPointModel': '2', # fast (/fp:fast)
56 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000057 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000058 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000059 'ExceptionHandling': '0',
bsalomon@google.com9aabfc72012-05-31 14:12:46 +000060 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
61 'RuntimeTypeInfo': 'false', # /GR-
62 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000063 },
64 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000065 'GenerateDebugInformation': 'true', # /DEBUG
66 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000067 },
bungeman@google.com983297e2011-10-03 19:36:51 +000068 'VCLibrarianTool': {
69 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
70 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000071 },
72 },
73 },
74 },
75 ],
76
77 ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
78 {
79 'defines': [
80 'SK_SAMPLES_FOR_X',
81 'SK_BUILD_FOR_UNIX',
reed@google.com1ac83502012-02-28 17:06:02 +000082 'SK_USE_COLOR_LUMINANCE',
83 'SK_GAMMA_APPLY_TO_A8',
seanpaul@google.com1134f982011-09-15 14:24:33 +000084 ],
85 'configurations': {
86 'Debug': {
87 'cflags': ['-g']
88 },
89 'Release': {
reed@google.comff793db2012-05-17 13:58:26 +000090 'cflags': ['-O3'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +000091 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000092 },
93 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +000094 'cflags': [
95 # TODO(tony): Enable -Werror once all the strict-aliasing problems
96 # are fixed.
97 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +000098 '-Wall',
99 '-Wextra',
100 '-Wno-unused',
101 # suppressions below here were added for clang
102 '-Wno-unused-parameter',
103 '-Wno-c++11-extensions'
104 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000105 'include_dirs' : [
106 '/usr/include/freetype2',
107 ],
108 },
109 ],
110
111 ['skia_os == "mac"',
112 {
113 'defines': [
114 'SK_BUILD_FOR_MAC',
115 ],
116 'configurations': {
117 'Debug': {
118 'xcode_settings': {
119 'GCC_OPTIMIZATION_LEVEL': '0',
120 },
121 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000122 'Release': {
123 'xcode_settings': {
124 'GCC_OPTIMIZATION_LEVEL': '3',
125 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000126 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000127 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000128 },
129 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000130 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000131 'SYMROOT': '<(DEPTH)/xcodebuild',
bsalomon@google.com4d5cb452011-10-12 18:12:11 +0000132 'SDKROOT': 'macosx10.6',
reed@google.com0069aa52011-11-17 15:35:47 +0000133# trying to get this to work, but it needs clang I think...
134# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000135 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.comb462a422012-06-06 12:12:28 +0000136 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
137 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
138 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
139 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
140 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
141 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
142 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
143 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
144 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
145 'GCC_WARN_MISSING_PARENTHESES': 'YES',
146 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
147 'GCC_WARN_SIGN_COMPARE': 'YES',
148 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
149 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
150 'GCC_WARN_UNUSED_FUNCTION': 'YES',
151 'GCC_WARN_UNUSED_LABEL': 'YES',
152 'GCC_WARN_UNUSED_VALUE': 'YES',
153 'GCC_WARN_UNUSED_VARIABLE': 'YES',
caryclark@google.come5720e32012-05-31 12:39:18 +0000154 'OTHER_CPLUSPLUSFLAGS': '-mssse3 -fvisibility=hidden -fvisibility-inlines-hidden',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000155 },
156 },
157 ],
158
159 ['skia_os == "ios"',
160 {
161 'defines': [
162 'SK_BUILD_FOR_IOS',
163 ],
164 'configurations': {
165 'Debug': {
166 'xcode_settings': {
167 'GCC_OPTIMIZATION_LEVEL': '0',
168 },
169 },
170 },
171 'xcode_settings': {
172 'SYMROOT': '<(DEPTH)/xcodebuild',
173 },
174 },
175 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000176
177 ['skia_os == "android"',
178 {
179 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000180 'SK_BUILD_FOR_ANDROID',
181 'SK_BUILD_FOR_ANDROID_NDK',
digit@google.com70ccffe2012-01-10 10:28:30 +0000182 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
djsollen@google.com58629292011-11-03 13:08:29 +0000183 ],
184 'configurations': {
185 'Debug': {
186 'cflags': ['-g']
187 },
188 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000189 'cflags': ['-O2'],
190 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000191 },
192 },
193 'libraries': [
194 '-lstdc++',
195 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000196 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000197 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000198 'cflags': [
199 '-fno-exceptions',
200 '-fno-rtti',
201 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000202 'conditions': [
djsollen@google.com3a2b35f2012-02-24 14:10:44 +0000203 [ 'skia_target_arch == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000204 'ldflags': [
205 '-Wl',
206 '--fix-cortex-a8',
207 ],
208 }],
djsollen@google.com3839ca12011-11-03 17:31:41 +0000209 [ 'skia_target_arch == "arm" and arm_thumb == 1', {
210 'cflags': [
211 '-mthumb',
212 ],
213 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000214 [ 'skia_target_arch == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000215 'variables': {
216 'arm_neon_optional%': 0,
217 },
djsollen@google.com58629292011-11-03 13:08:29 +0000218 'defines': [
219 '__ARM_ARCH__=7',
220 ],
221 'cflags': [
222 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000223 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000224 ],
225 'conditions': [
226 [ 'arm_neon == 1', {
227 'defines': [
228 '__ARM_HAVE_NEON',
229 ],
230 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000231 '-mfpu=neon',
232 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000233 }],
234 [ 'arm_neon_optional == 1', {
235 'defines': [
236 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
237 ],
238 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000239 ],
240 }],
241 ],
242 },
243 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000244
digit@google.com1771cbf2012-01-26 21:26:40 +0000245 # We can POD-style initialization of static mutexes to avoid generating
246 # static initializers if we're using a pthread-compatible thread interface.
247 [ 'skia_os != "win"', {
248 'defines': [
249 'SK_USE_POSIX_THREADS'
250 ],
251 }],
252
seanpaul@google.com1134f982011-09-15 14:24:33 +0000253 ], # end 'conditions'
254}
255
256# Local Variables:
257# tab-width:2
258# indent-tabs-mode:nil
259# End:
260# vim: set expandtab tabstop=2 shiftwidth=2: