seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 1 | # conditions used in both common.gypi and skia.gyp in chromium |
| 2 | # |
| 3 | { |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 4 | 'defines': [ |
| 5 | 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)', |
| 6 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 7 | 'conditions' : [ |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 8 | [ 'skia_gpu == 1', |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 9 | { |
| 10 | 'defines': [ |
| 11 | 'SK_SUPPORT_GPU=1', |
| 12 | ], |
| 13 | }, { |
| 14 | 'defines': [ |
| 15 | 'SK_SUPPORT_GPU=0', |
| 16 | ], |
| 17 | }, |
| 18 | ], |
zachr@google.com | d658568 | 2013-07-17 19:29:19 +0000 | [diff] [blame] | 19 | [ 'skia_opencl == 1', |
| 20 | { |
| 21 | 'defines': [ |
| 22 | 'SK_SUPPORT_OPENCL=1', |
| 23 | ], |
| 24 | }, { |
| 25 | 'defines': [ |
| 26 | 'SK_SUPPORT_OPENCL=0', |
| 27 | ], |
| 28 | }, |
| 29 | ], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 30 | [ 'skia_os == "win"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 31 | { |
| 32 | 'defines': [ |
| 33 | 'SK_BUILD_FOR_WIN32', |
reed@google.com | ebbda76 | 2013-08-07 15:30:09 +0000 | [diff] [blame] | 34 | 'SK_FONTHOST_USES_FONTMGR', |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 35 | '_CRT_SECURE_NO_WARNINGS', |
senorblanco@chromium.org | 5f47a39 | 2012-07-12 00:34:39 +0000 | [diff] [blame] | 36 | 'GR_GL_FUNCTION_TYPE=__stdcall', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 37 | ], |
| 38 | 'msvs_cygwin_shell': 0, |
| 39 | 'msvs_settings': { |
| 40 | 'VCCLCompilerTool': { |
bsalomon@google.com | b58a639 | 2013-03-21 20:29:05 +0000 | [diff] [blame] | 41 | 'WarningLevel': '3', |
| 42 | 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 43 | 'DebugInformationFormat': '3', |
bsalomon@google.com | b58a639 | 2013-03-21 20:29:05 +0000 | [diff] [blame] | 44 | 'ExceptionHandling': '0', |
| 45 | 'AdditionalOptions': [ '/MP', ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 46 | }, |
| 47 | 'VCLinkerTool': { |
| 48 | 'AdditionalDependencies': [ |
| 49 | 'OpenGL32.lib', |
| 50 | 'usp10.lib', |
bungeman@google.com | f51e125 | 2013-06-05 18:35:22 +0000 | [diff] [blame] | 51 | |
| 52 | # Prior to gyp r1584, the following were included automatically. |
| 53 | 'kernel32.lib', |
| 54 | 'gdi32.lib', |
| 55 | 'winspool.lib', |
| 56 | 'comdlg32.lib', |
| 57 | 'advapi32.lib', |
| 58 | 'shell32.lib', |
| 59 | 'ole32.lib', |
| 60 | 'oleaut32.lib', |
| 61 | 'user32.lib', |
| 62 | 'uuid.lib', |
| 63 | 'odbc32.lib', |
| 64 | 'odbccp32.lib', |
bsalomon@google.com | bbba784 | 2013-06-06 18:34:13 +0000 | [diff] [blame] | 65 | 'DelayImp.lib', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 66 | ], |
| 67 | }, |
| 68 | }, |
| 69 | 'configurations': { |
| 70 | 'Debug': { |
| 71 | 'msvs_settings': { |
| 72 | 'VCCLCompilerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 73 | 'DebugInformationFormat': '4', # editAndContiue (/ZI) |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 74 | 'Optimization': '0', # optimizeDisabled (/Od) |
| 75 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 76 | 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd) |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 77 | 'RuntimeTypeInfo': 'false', # /GR- |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 78 | }, |
| 79 | 'VCLinkerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 80 | 'GenerateDebugInformation': 'true', # /DEBUG |
| 81 | 'LinkIncremental': '2', # /INCREMENTAL |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 82 | }, |
| 83 | }, |
| 84 | }, |
| 85 | 'Release': { |
| 86 | 'msvs_settings': { |
| 87 | 'VCCLCompilerTool': { |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 88 | 'DebugInformationFormat': '3', # programDatabase (/Zi) |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 89 | 'Optimization': '<(skia_release_optimization_level)', |
bsalomon@google.com | d971869 | 2013-04-22 14:56:50 +0000 | [diff] [blame] | 90 | 'WholeProgramOptimization': 'true', #/GL |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 91 | # Changing the floating point model requires rebaseling gm images |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 92 | #'FloatingPointModel': '2', # fast (/fp:fast) |
| 93 | 'FavorSizeOrSpeed': '1', # speed (/Ot) |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 94 | 'PreprocessorDefinitions': ['NDEBUG'], |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 95 | 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD) |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 96 | 'EnableEnhancedInstructionSet': '2',# /arch:SSE2 |
| 97 | 'RuntimeTypeInfo': 'false', # /GR- |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 98 | }, |
| 99 | 'VCLinkerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 100 | 'GenerateDebugInformation': 'true', # /DEBUG |
bsalomon@google.com | d971869 | 2013-04-22 14:56:50 +0000 | [diff] [blame] | 101 | 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 102 | }, |
bungeman@google.com | 983297e | 2011-10-03 19:36:51 +0000 | [diff] [blame] | 103 | 'VCLibrarianTool': { |
bsalomon@google.com | d971869 | 2013-04-22 14:56:50 +0000 | [diff] [blame] | 104 | 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG |
bungeman@google.com | 983297e | 2011-10-03 19:36:51 +0000 | [diff] [blame] | 105 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 106 | }, |
| 107 | }, |
| 108 | }, |
borenet@google.com | b796119 | 2012-08-20 18:58:26 +0000 | [diff] [blame] | 109 | 'conditions' : [ |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 110 | [ 'skia_arch_width == 64', { |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 111 | 'msvs_configuration_platform': 'x64', |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 112 | }], |
| 113 | [ 'skia_arch_width == 32', { |
| 114 | 'msvs_configuration_platform': 'Win32', |
| 115 | }], |
| 116 | [ 'skia_warnings_as_errors', { |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 117 | 'msvs_settings': { |
| 118 | 'VCCLCompilerTool': { |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 119 | 'WarnAsError': 'true', |
| 120 | 'AdditionalOptions': [ |
| 121 | '/we4189', # initialized but unused var warning |
| 122 | ], |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 123 | }, |
| 124 | }, |
borenet@google.com | b796119 | 2012-08-20 18:58:26 +0000 | [diff] [blame] | 125 | }], |
commit-bot@chromium.org | 5a6c2d8 | 2013-06-14 17:10:09 +0000 | [diff] [blame] | 126 | [ 'skia_win_exceptions', { |
| 127 | 'msvs_settings': { |
| 128 | 'VCCLCompilerTool': { |
| 129 | 'AdditionalOptions': [ |
| 130 | '/EHsc', |
| 131 | ], |
| 132 | }, |
| 133 | }, |
| 134 | }], |
borenet@google.com | b796119 | 2012-08-20 18:58:26 +0000 | [diff] [blame] | 135 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 136 | }, |
| 137 | ], |
| 138 | |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 139 | # The following section is common to linux + derivatives and android |
| 140 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', |
| 141 | { |
| 142 | 'conditions': [ |
| 143 | [ 'skia_warnings_as_errors', { |
| 144 | 'cflags': [ |
| 145 | '-Werror', |
| 146 | ], |
| 147 | }], |
| 148 | [ 'skia_arch_type == "arm" and arm_thumb == 1', { |
| 149 | 'cflags': [ |
| 150 | '-mthumb', |
| 151 | ], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 152 | # The --fix-cortex-a8 switch enables a link-time workaround for |
| 153 | # an erratum in certain Cortex-A8 processors. The workaround is |
| 154 | # enabled by default if you target the ARM v7-A arch profile. |
| 155 | # It can be enabled otherwise by specifying --fix-cortex-a8, or |
| 156 | # disabled unconditionally by specifying --no-fix-cortex-a8. |
| 157 | # |
| 158 | # The erratum only affects Thumb-2 code. |
| 159 | 'conditions': [ |
| 160 | [ 'arm_version < 7', { |
| 161 | 'ldflags': [ |
| 162 | '-Wl,--fix-cortex-a8', |
| 163 | ], |
| 164 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 165 | ], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 166 | }], |
| 167 | [ 'skia_arch_type == "arm" and arm_version >= 7', { |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 168 | 'cflags': [ |
| 169 | '-march=armv7-a', |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 170 | ], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 171 | 'ldflags': [ |
| 172 | '-march=armv7-a', |
| 173 | ], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 174 | 'conditions': [ |
| 175 | [ 'arm_neon == 1', { |
| 176 | 'defines': [ |
| 177 | '__ARM_HAVE_NEON', |
| 178 | ], |
| 179 | 'cflags': [ |
| 180 | '-mfpu=neon', |
| 181 | ], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 182 | }], |
| 183 | [ 'arm_neon_optional == 1', { |
| 184 | 'defines': [ |
| 185 | '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', |
| 186 | ], |
| 187 | }], |
borenet@google.com | e2b9037 | 2013-07-11 18:46:30 +0000 | [diff] [blame] | 188 | [ 'skia_os != "chromeos"', { |
| 189 | 'cflags': [ |
| 190 | '-mfloat-abi=softfp', |
| 191 | ], |
| 192 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 193 | ], |
| 194 | }], |
| 195 | ], |
| 196 | }, |
| 197 | ], |
| 198 | |
| 199 | |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 200 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 201 | { |
| 202 | 'defines': [ |
| 203 | 'SK_SAMPLES_FOR_X', |
| 204 | 'SK_BUILD_FOR_UNIX', |
| 205 | ], |
| 206 | 'configurations': { |
mtklein@google.com | 1fb04e2 | 2013-09-13 19:32:43 +0000 | [diff] [blame] | 207 | 'Coverage': { |
| 208 | 'cflags': ['-g --coverage'], |
| 209 | 'ldflags': ['--coverage'], |
| 210 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 211 | 'Debug': { |
| 212 | 'cflags': ['-g'] |
| 213 | }, |
| 214 | 'Release': { |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 215 | 'cflags': [ |
| 216 | '-O<(skia_release_optimization_level)', |
| 217 | '-g', |
| 218 | ], |
senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 219 | 'defines': [ 'NDEBUG' ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 220 | }, |
| 221 | }, |
bsalomon@google.com | cadbcb8 | 2012-01-06 19:22:11 +0000 | [diff] [blame] | 222 | 'cflags': [ |
bsalomon@google.com | 31648eb | 2011-11-23 15:01:08 +0000 | [diff] [blame] | 223 | '-Wall', |
| 224 | '-Wextra', |
bsalomon@google.com | 31648eb | 2011-11-23 15:01:08 +0000 | [diff] [blame] | 225 | # suppressions below here were added for clang |
| 226 | '-Wno-unused-parameter', |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 227 | '-Wno-c++11-extensions', |
bsalomon@google.com | 31648eb | 2011-11-23 15:01:08 +0000 | [diff] [blame] | 228 | ], |
borenet@google.com | a37a517 | 2012-08-09 20:44:32 +0000 | [diff] [blame] | 229 | 'conditions' : [ |
zachr@google.com | 28c27c8 | 2013-06-20 17:15:05 +0000 | [diff] [blame] | 230 | [ 'skia_shared_lib', { |
| 231 | 'cflags': [ |
| 232 | '-fPIC', |
| 233 | ], |
| 234 | 'defines': [ |
zachr@google.com | 28c27c8 | 2013-06-20 17:15:05 +0000 | [diff] [blame] | 235 | 'SKIA_DLL', |
| 236 | 'SKIA_IMPLEMENTATION=1', |
| 237 | ], |
| 238 | }], |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 239 | [ 'skia_os == "nacl"', { |
| 240 | 'defines': [ |
| 241 | 'SK_BUILD_FOR_NACL', |
| 242 | ], |
| 243 | 'link_settings': { |
| 244 | 'libraries': [ |
| 245 | '-lppapi', |
| 246 | '-lppapi_cpp', |
| 247 | '-lnosys', |
| 248 | '-pthread', |
| 249 | ], |
| 250 | }, |
borenet@google.com | cb9445d | 2013-08-19 18:26:04 +0000 | [diff] [blame] | 251 | }, { # skia_os != "nacl" |
| 252 | 'link_settings': { |
| 253 | 'ldflags': [ |
| 254 | '-lstdc++', |
| 255 | '-lm', |
| 256 | ], |
| 257 | }, |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 258 | }], |
borenet@google.com | cb9445d | 2013-08-19 18:26:04 +0000 | [diff] [blame] | 259 | [ 'skia_os != "chromeos"', { |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 260 | 'conditions': [ |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 261 | [ 'skia_arch_width == 64 and skia_arch_type == "x86"', { |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 262 | 'cflags': [ |
| 263 | '-m64', |
| 264 | ], |
| 265 | 'ldflags': [ |
| 266 | '-m64', |
| 267 | ], |
| 268 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 269 | [ 'skia_arch_width == 32 and skia_arch_type == "x86"', { |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 270 | 'cflags': [ |
| 271 | '-m32', |
| 272 | ], |
| 273 | 'ldflags': [ |
| 274 | '-m32', |
| 275 | ], |
| 276 | }], |
| 277 | ], |
| 278 | }], |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 279 | # Enable asan, tsan, etc. |
| 280 | [ 'skia_sanitizer', { |
borenet@google.com | 0d19309 | 2013-07-03 15:55:05 +0000 | [diff] [blame] | 281 | 'cflags': [ |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 282 | '-fsanitize=<(skia_sanitizer)', |
borenet@google.com | 0d19309 | 2013-07-03 15:55:05 +0000 | [diff] [blame] | 283 | '-fno-omit-frame-pointer', |
| 284 | ], |
| 285 | 'ldflags': [ |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 286 | '-fsanitize=<(skia_sanitizer)', |
bungeman@google.com | 1435f9f | 2013-09-25 22:39:22 +0000 | [diff] [blame] | 287 | ], |
mtklein@google.com | 3a19fb5 | 2013-10-09 16:12:23 +0000 | [diff] [blame] | 288 | 'conditions' : [ |
| 289 | [ 'skia_sanitizer == "thread"', { |
| 290 | 'defines': [ 'DYNAMIC_ANNOTATIONS_ENABLED=1' ], |
bungeman@google.com | 0fbe01f | 2013-10-10 17:24:17 +0000 | [diff] [blame] | 291 | 'cflags': [ '-fPIC' ], |
bungeman@google.com | 27d4ffe | 2013-10-10 17:09:49 +0000 | [diff] [blame] | 292 | 'target_conditions': [ |
| 293 | [ '_type == "executable"', { |
| 294 | 'cflags': [ '-fPIE' ], |
| 295 | 'ldflags': [ '-pie' ], |
| 296 | }], |
| 297 | ], |
mtklein@google.com | 3a19fb5 | 2013-10-09 16:12:23 +0000 | [diff] [blame] | 298 | }], |
| 299 | ], |
bungeman@google.com | 1435f9f | 2013-09-25 22:39:22 +0000 | [diff] [blame] | 300 | }], |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 301 | [ 'skia_clang_build', { |
| 302 | 'cflags': [ |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 303 | # Extra warnings we like but that only Clang knows about. |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 304 | '-Wstring-conversion', |
| 305 | ], |
| 306 | }], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 307 | ], |
| 308 | }, |
| 309 | ], |
| 310 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 311 | [ 'skia_os == "mac"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 312 | { |
humper@google.com | 522dbd2 | 2013-02-08 21:45:33 +0000 | [diff] [blame] | 313 | 'variables': { |
| 314 | 'mac_sdk%': '<!(python <(DEPTH)/tools/find_mac_sdk.py 10.6)', |
| 315 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 316 | 'defines': [ |
| 317 | 'SK_BUILD_FOR_MAC', |
reed@google.com | ebbda76 | 2013-08-07 15:30:09 +0000 | [diff] [blame] | 318 | 'SK_FONTHOST_USES_FONTMGR', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 319 | ], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 320 | 'conditions' : [ |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 321 | [ 'skia_arch_width == 64', { |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 322 | 'xcode_settings': { |
commit-bot@chromium.org | 5d7ca95 | 2013-04-22 20:26:44 +0000 | [diff] [blame] | 323 | 'ARCHS': ['x86_64'], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 324 | }, |
| 325 | }], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 326 | [ 'skia_arch_width == 32', { |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 327 | 'xcode_settings': { |
commit-bot@chromium.org | 5d7ca95 | 2013-04-22 20:26:44 +0000 | [diff] [blame] | 328 | 'ARCHS': ['i386'], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 329 | }, |
| 330 | }], |
| 331 | [ 'skia_warnings_as_errors', { |
| 332 | 'xcode_settings': { |
humper@google.com | fe0d680 | 2013-01-07 20:28:16 +0000 | [diff] [blame] | 333 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 334 | '-Werror', |
commit-bot@chromium.org | faa5ae4 | 2013-07-23 11:13:56 +0000 | [diff] [blame] | 335 | '-Wall', |
| 336 | '-Wextra', |
| 337 | '-Wno-unused-parameter', |
humper@google.com | fe0d680 | 2013-01-07 20:28:16 +0000 | [diff] [blame] | 338 | ], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 339 | }, |
| 340 | }], |
mtklein@google.com | 8d725b2 | 2013-07-24 16:20:05 +0000 | [diff] [blame] | 341 | # This old compiler is really bad at figuring out when things are uninitialized, so ignore it. |
| 342 | [ '<(mac_sdk)==10.6', { |
| 343 | 'xcode_settings': { |
| 344 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 345 | '-Wno-uninitialized', |
| 346 | ], |
| 347 | }, |
| 348 | }], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 349 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 350 | 'configurations': { |
| 351 | 'Debug': { |
| 352 | 'xcode_settings': { |
| 353 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 354 | }, |
| 355 | }, |
reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 356 | 'Release': { |
| 357 | 'xcode_settings': { |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 358 | 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', |
reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 359 | }, |
senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 360 | 'defines': [ 'NDEBUG' ], |
reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 361 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 362 | }, |
| 363 | 'xcode_settings': { |
robertphillips@google.com | 0229765 | 2012-04-05 19:29:04 +0000 | [diff] [blame] | 364 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', |
humper@google.com | 522dbd2 | 2013-02-08 21:45:33 +0000 | [diff] [blame] | 365 | 'conditions': [ |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 366 | [ 'skia_osx_sdkroot==""', { |
humper@google.com | 522dbd2 | 2013-02-08 21:45:33 +0000 | [diff] [blame] | 367 | 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot |
| 368 | }, { |
| 369 | 'SDKROOT': '<(skia_osx_sdkroot)', # -isysroot |
| 370 | }], |
| 371 | ], |
reed@google.com | 0069aa5 | 2011-11-17 15:35:47 +0000 | [diff] [blame] | 372 | # trying to get this to work, but it needs clang I think... |
| 373 | # 'WARNING_CFLAGS': '-Wexit-time-destructors', |
mike@reedtribe.org | e51755f | 2011-12-10 19:36:56 +0000 | [diff] [blame] | 374 | 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO', |
caryclark@google.com | b462a42 | 2012-06-06 12:12:28 +0000 | [diff] [blame] | 375 | 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES', |
| 376 | 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES', |
| 377 | 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES', |
| 378 | 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', |
| 379 | 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES', |
| 380 | 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES', |
| 381 | 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES', |
| 382 | 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES', |
| 383 | 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES', |
| 384 | 'GCC_WARN_MISSING_PARENTHESES': 'YES', |
| 385 | 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES', |
| 386 | 'GCC_WARN_SIGN_COMPARE': 'YES', |
| 387 | 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES', |
| 388 | 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES', |
| 389 | 'GCC_WARN_UNUSED_FUNCTION': 'YES', |
| 390 | 'GCC_WARN_UNUSED_LABEL': 'YES', |
| 391 | 'GCC_WARN_UNUSED_VALUE': 'YES', |
| 392 | 'GCC_WARN_UNUSED_VARIABLE': 'YES', |
bungeman@google.com | 43b4ed5 | 2012-10-02 15:42:21 +0000 | [diff] [blame] | 393 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 394 | '-mssse3', |
| 395 | '-fvisibility=hidden', |
| 396 | '-fvisibility-inlines-hidden', |
| 397 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 398 | }, |
| 399 | }, |
| 400 | ], |
| 401 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 402 | [ 'skia_os == "ios"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 403 | { |
| 404 | 'defines': [ |
| 405 | 'SK_BUILD_FOR_IOS', |
| 406 | ], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 407 | 'conditions' : [ |
| 408 | [ 'skia_warnings_as_errors', { |
| 409 | 'xcode_settings': { |
| 410 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 411 | '-Werror', |
| 412 | ], |
| 413 | }, |
| 414 | }], |
| 415 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 416 | 'configurations': { |
| 417 | 'Debug': { |
| 418 | 'xcode_settings': { |
| 419 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 420 | }, |
| 421 | }, |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 422 | 'Release': { |
| 423 | 'xcode_settings': { |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 424 | 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 425 | }, |
| 426 | 'defines': [ 'NDEBUG' ], |
| 427 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 428 | }, |
| 429 | 'xcode_settings': { |
commit-bot@chromium.org | 5d7ca95 | 2013-04-22 20:26:44 +0000 | [diff] [blame] | 430 | 'ARCHS': ['armv6', 'armv7'], |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 431 | 'CODE_SIGNING_REQUIRED': 'NO', |
| 432 | 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 433 | 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)', |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 434 | 'SDKROOT': 'iphoneos', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 435 | 'TARGETED_DEVICE_FAMILY': '1,2', |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 436 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 437 | '-fvisibility=hidden', |
| 438 | '-fvisibility-inlines-hidden', |
| 439 | ], |
bsalomon@google.com | 89dec58 | 2012-09-28 18:33:11 +0000 | [diff] [blame] | 440 | 'GCC_THUMB_SUPPORT': 'NO', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 441 | }, |
| 442 | }, |
| 443 | ], |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 444 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 445 | [ 'skia_os == "android"', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 446 | { |
| 447 | 'defines': [ |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 448 | 'SK_BUILD_FOR_ANDROID', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 449 | ], |
| 450 | 'configurations': { |
| 451 | 'Debug': { |
| 452 | 'cflags': ['-g'] |
| 453 | }, |
| 454 | 'Release': { |
djsollen@google.com | bde506c | 2013-04-04 19:42:51 +0000 | [diff] [blame] | 455 | 'cflags': ['-O2'], |
senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 456 | 'defines': [ 'NDEBUG' ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 457 | }, |
| 458 | }, |
| 459 | 'libraries': [ |
| 460 | '-lstdc++', |
| 461 | '-lm', |
djsollen@google.com | 318cf92 | 2011-11-08 19:03:43 +0000 | [diff] [blame] | 462 | '-llog', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 463 | ], |
djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 464 | 'cflags': [ |
djsollen@google.com | efbe8e9 | 2013-02-07 18:58:35 +0000 | [diff] [blame] | 465 | '-Wall', |
djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 466 | '-fno-exceptions', |
djsollen@google.com | efbe8e9 | 2013-02-07 18:58:35 +0000 | [diff] [blame] | 467 | '-fstrict-aliasing', |
borenet@google.com | de9ac14 | 2012-07-25 15:17:03 +0000 | [diff] [blame] | 468 | '-fuse-ld=gold', |
djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 469 | ], |
reed@google.com | e52d291 | 2013-05-15 20:01:07 +0000 | [diff] [blame] | 470 | 'cflags_cc': [ |
| 471 | '-fno-rtti', |
| 472 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 473 | 'conditions': [ |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 474 | [ 'skia_shared_lib', { |
| 475 | 'cflags': [ |
| 476 | '-fPIC', |
| 477 | ], |
| 478 | 'defines': [ |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 479 | 'SKIA_DLL', |
| 480 | 'SKIA_IMPLEMENTATION=1', |
| 481 | ], |
| 482 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 483 | [ 'skia_profile_enabled == 1', { |
| 484 | 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'], |
djsollen@google.com | 3839ca1 | 2011-11-03 17:31:41 +0000 | [diff] [blame] | 485 | }], |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 486 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 487 | }, |
| 488 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 489 | |
digit@google.com | 1771cbf | 2012-01-26 21:26:40 +0000 | [diff] [blame] | 490 | # We can POD-style initialization of static mutexes to avoid generating |
| 491 | # static initializers if we're using a pthread-compatible thread interface. |
| 492 | [ 'skia_os != "win"', { |
| 493 | 'defines': [ |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 494 | 'SK_USE_POSIX_THREADS', |
digit@google.com | 1771cbf | 2012-01-26 21:26:40 +0000 | [diff] [blame] | 495 | ], |
| 496 | }], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 497 | ], # end 'conditions' |
caryclark@google.com | 4588ce8 | 2012-09-26 15:48:43 +0000 | [diff] [blame] | 498 | # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details |
| 499 | 'xcode_settings': { |
| 500 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 501 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | # Local Variables: |
| 505 | # tab-width:2 |
| 506 | # indent-tabs-mode:nil |
| 507 | # End: |
| 508 | # vim: set expandtab tabstop=2 shiftwidth=2: |