blob: 985f1bdd54aab26cf0f6027d37a856bc7881fd02 [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.com8b5abec2011-09-28 14:32:01 +000050 'DebugInformationFormat': '3', # programDatabase (/Zi)
bungeman@google.com7deaa3b2011-10-03 20:15:13 +000051 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000052 'Optimization': '3', # full (/Ox)
53 'WholeProgramOptimization': 'true', #/GL
54 # Changing the floating point model requires rebaseling gm images
55 #'FloatingPointModel': '2', # fast (/fp:fast)
56 'FavorSizeOrSpeed': '1', # speed (/Ot)
seanpaul@google.com1134f982011-09-15 14:24:33 +000057 'PreprocessorDefinitions': ['NDEBUG'],
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000058 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
59 'ExceptionHandling': '0',
60 'RuntimeTypeInfo': 'false', # /GR-
61 'WarningLevel': '3', # level3 (/W3)
seanpaul@google.com1134f982011-09-15 14:24:33 +000062 },
63 'VCLinkerTool': {
bsalomon@google.com8b5abec2011-09-28 14:32:01 +000064 'GenerateDebugInformation': 'true', # /DEBUG
65 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
seanpaul@google.com1134f982011-09-15 14:24:33 +000066 },
bungeman@google.com983297e2011-10-03 19:36:51 +000067 'VCLibrarianTool': {
68 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
69 },
seanpaul@google.com1134f982011-09-15 14:24:33 +000070 },
71 },
72 },
73 },
74 ],
75
76 ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]',
77 {
78 'defines': [
79 'SK_SAMPLES_FOR_X',
80 'SK_BUILD_FOR_UNIX',
reed@google.com1ac83502012-02-28 17:06:02 +000081 'SK_USE_COLOR_LUMINANCE',
82 'SK_GAMMA_APPLY_TO_A8',
seanpaul@google.com1134f982011-09-15 14:24:33 +000083 ],
84 'configurations': {
85 'Debug': {
86 'cflags': ['-g']
87 },
88 'Release': {
reed@google.comff793db2012-05-17 13:58:26 +000089 'cflags': ['-O3'],
senorblanco@chromium.org7288c492012-01-19 19:59:22 +000090 'defines': [ 'NDEBUG' ],
seanpaul@google.com1134f982011-09-15 14:24:33 +000091 },
92 },
bsalomon@google.comcadbcb82012-01-06 19:22:11 +000093 'cflags': [
94 # TODO(tony): Enable -Werror once all the strict-aliasing problems
95 # are fixed.
96 #'-Werror',
bsalomon@google.com31648eb2011-11-23 15:01:08 +000097 '-Wall',
98 '-Wextra',
99 '-Wno-unused',
100 # suppressions below here were added for clang
101 '-Wno-unused-parameter',
102 '-Wno-c++11-extensions'
103 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000104 'include_dirs' : [
105 '/usr/include/freetype2',
106 ],
107 },
108 ],
109
110 ['skia_os == "mac"',
111 {
112 'defines': [
113 'SK_BUILD_FOR_MAC',
114 ],
115 'configurations': {
116 'Debug': {
117 'xcode_settings': {
118 'GCC_OPTIMIZATION_LEVEL': '0',
119 },
120 },
reed@google.come05cc8e2011-10-10 14:19:40 +0000121 'Release': {
122 'xcode_settings': {
123 'GCC_OPTIMIZATION_LEVEL': '3',
124 },
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000125 'defines': [ 'NDEBUG' ],
reed@google.come05cc8e2011-10-10 14:19:40 +0000126 },
seanpaul@google.com1134f982011-09-15 14:24:33 +0000127 },
128 'xcode_settings': {
robertphillips@google.com02297652012-04-05 19:29:04 +0000129 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000130 'SYMROOT': '<(DEPTH)/xcodebuild',
bsalomon@google.com4d5cb452011-10-12 18:12:11 +0000131 'SDKROOT': 'macosx10.6',
reed@google.com0069aa52011-11-17 15:35:47 +0000132# trying to get this to work, but it needs clang I think...
133# 'WARNING_CFLAGS': '-Wexit-time-destructors',
mike@reedtribe.orge51755f2011-12-10 19:36:56 +0000134 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
caryclark@google.come5720e32012-05-31 12:39:18 +0000135 'OTHER_CPLUSPLUSFLAGS': '-mssse3 -fvisibility=hidden -fvisibility-inlines-hidden',
seanpaul@google.com1134f982011-09-15 14:24:33 +0000136 },
137 },
138 ],
139
140 ['skia_os == "ios"',
141 {
142 'defines': [
143 'SK_BUILD_FOR_IOS',
144 ],
145 'configurations': {
146 'Debug': {
147 'xcode_settings': {
148 'GCC_OPTIMIZATION_LEVEL': '0',
149 },
150 },
151 },
152 'xcode_settings': {
153 'SYMROOT': '<(DEPTH)/xcodebuild',
154 },
155 },
156 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000157
158 ['skia_os == "android"',
159 {
160 'defines': [
djsollen@google.com58629292011-11-03 13:08:29 +0000161 'SK_BUILD_FOR_ANDROID',
162 'SK_BUILD_FOR_ANDROID_NDK',
digit@google.com70ccffe2012-01-10 10:28:30 +0000163 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
djsollen@google.com58629292011-11-03 13:08:29 +0000164 ],
165 'configurations': {
166 'Debug': {
167 'cflags': ['-g']
168 },
169 'Release': {
senorblanco@chromium.org7288c492012-01-19 19:59:22 +0000170 'cflags': ['-O2'],
171 'defines': [ 'NDEBUG' ],
djsollen@google.com58629292011-11-03 13:08:29 +0000172 },
173 },
174 'libraries': [
175 '-lstdc++',
176 '-lm',
djsollen@google.com318cf922011-11-08 19:03:43 +0000177 '-llog',
djsollen@google.com58629292011-11-03 13:08:29 +0000178 ],
djsollen@google.com44360bc2011-12-05 13:55:55 +0000179 'cflags': [
180 '-fno-exceptions',
181 '-fno-rtti',
182 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000183 'conditions': [
djsollen@google.com3a2b35f2012-02-24 14:10:44 +0000184 [ 'skia_target_arch == "arm"', {
djsollen@google.comcf740302012-02-24 14:09:02 +0000185 'ldflags': [
186 '-Wl',
187 '--fix-cortex-a8',
188 ],
189 }],
djsollen@google.com3839ca12011-11-03 17:31:41 +0000190 [ 'skia_target_arch == "arm" and arm_thumb == 1', {
191 'cflags': [
192 '-mthumb',
193 ],
194 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000195 [ 'skia_target_arch == "arm" and armv7 == 1', {
digit@google.comeec9dbc2012-05-30 13:54:41 +0000196 'variables': {
197 'arm_neon_optional%': 0,
198 },
djsollen@google.com58629292011-11-03 13:08:29 +0000199 'defines': [
200 '__ARM_ARCH__=7',
201 ],
202 'cflags': [
203 '-march=armv7-a',
djsollen@google.comcf740302012-02-24 14:09:02 +0000204 '-mfloat-abi=softfp',
djsollen@google.com58629292011-11-03 13:08:29 +0000205 ],
206 'conditions': [
207 [ 'arm_neon == 1', {
208 'defines': [
209 '__ARM_HAVE_NEON',
210 ],
211 'cflags': [
djsollen@google.com58629292011-11-03 13:08:29 +0000212 '-mfpu=neon',
213 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000214 }],
215 [ 'arm_neon_optional == 1', {
216 'defines': [
217 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
218 ],
219 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000220 ],
221 }],
222 ],
223 },
224 ],
seanpaul@google.com1134f982011-09-15 14:24:33 +0000225
digit@google.com1771cbf2012-01-26 21:26:40 +0000226 # We can POD-style initialization of static mutexes to avoid generating
227 # static initializers if we're using a pthread-compatible thread interface.
228 [ 'skia_os != "win"', {
229 'defines': [
230 'SK_USE_POSIX_THREADS'
231 ],
232 }],
233
seanpaul@google.com1134f982011-09-15 14:24:33 +0000234 ], # end 'conditions'
235}
236
237# Local Variables:
238# tab-width:2
239# indent-tabs-mode:nil
240# End:
241# vim: set expandtab tabstop=2 shiftwidth=2: