| 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' : [ |
| bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 8 | ['skia_gpu == 1', |
| 9 | { |
| 10 | 'defines': [ |
| 11 | 'SK_SUPPORT_GPU=1', |
| 12 | ], |
| 13 | }, { |
| 14 | 'defines': [ |
| 15 | 'SK_SUPPORT_GPU=0', |
| 16 | ], |
| 17 | }, |
| 18 | ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 19 | ['skia_os == "win"', |
| 20 | { |
| 21 | 'defines': [ |
| 22 | 'SK_BUILD_FOR_WIN32', |
| 23 | 'SK_IGNORE_STDINT_DOT_H', |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 24 | '_CRT_SECURE_NO_WARNINGS', |
| senorblanco@chromium.org | 5f47a39 | 2012-07-12 00:34:39 +0000 | [diff] [blame] | 25 | 'GR_GL_FUNCTION_TYPE=__stdcall', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 26 | ], |
| 27 | 'msvs_cygwin_shell': 0, |
| 28 | 'msvs_settings': { |
| 29 | 'VCCLCompilerTool': { |
| 30 | 'WarningLevel': '1', |
| 31 | 'WarnAsError': 'false', |
| 32 | 'DebugInformationFormat': '3', |
| seanpaul@google.com | 8f78fec | 2011-09-16 15:47:33 +0000 | [diff] [blame] | 33 | 'AdditionalOptions': [ '/MP' ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 34 | }, |
| 35 | 'VCLinkerTool': { |
| 36 | 'AdditionalDependencies': [ |
| 37 | 'OpenGL32.lib', |
| 38 | 'usp10.lib', |
| 39 | ], |
| 40 | }, |
| 41 | }, |
| 42 | 'configurations': { |
| 43 | 'Debug': { |
| 44 | 'msvs_settings': { |
| 45 | 'VCCLCompilerTool': { |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 46 | 'DebugInformationFormat': '4', # editAndContiue (/ZI) |
| bungeman@google.com | 7deaa3b | 2011-10-03 20:15:13 +0000 | [diff] [blame] | 47 | 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 48 | 'Optimization': '0', # optimizeDisabled (/Od) |
| 49 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 50 | 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd) |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 51 | 'ExceptionHandling': '0', |
| 52 | 'RuntimeTypeInfo': 'false', # /GR- |
| 53 | 'WarningLevel': '3', # level3 (/W3) |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 54 | }, |
| 55 | 'VCLinkerTool': { |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 56 | 'GenerateDebugInformation': 'true', # /DEBUG |
| 57 | 'LinkIncremental': '2', # /INCREMENTAL |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 58 | }, |
| 59 | }, |
| 60 | }, |
| 61 | 'Release': { |
| 62 | 'msvs_settings': { |
| 63 | 'VCCLCompilerTool': { |
| bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 64 | 'DebugInformationFormat': '3', # programDatabase (/Zi) |
| bungeman@google.com | 7deaa3b | 2011-10-03 20:15:13 +0000 | [diff] [blame] | 65 | 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb', |
| bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 66 | 'Optimization': '3', # full (/Ox) |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 67 | 'WholeProgramOptimization': 'true', #/GL |
| 68 | # Changing the floating point model requires rebaseling gm images |
| bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 69 | #'FloatingPointModel': '2', # fast (/fp:fast) |
| 70 | 'FavorSizeOrSpeed': '1', # speed (/Ot) |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 71 | 'PreprocessorDefinitions': ['NDEBUG'], |
| bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 72 | 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD) |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 73 | 'ExceptionHandling': '0', |
| bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 74 | 'EnableEnhancedInstructionSet': '2',# /arch:SSE2 |
| 75 | 'RuntimeTypeInfo': 'false', # /GR- |
| 76 | 'WarningLevel': '3', # level3 (/W3) |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 77 | }, |
| 78 | 'VCLinkerTool': { |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 79 | 'GenerateDebugInformation': 'true', # /DEBUG |
| 80 | 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 81 | }, |
| bungeman@google.com | 983297e | 2011-10-03 19:36:51 +0000 | [diff] [blame] | 82 | 'VCLibrarianTool': { |
| 83 | 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG |
| 84 | }, |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 85 | }, |
| 86 | }, |
| 87 | }, |
| 88 | }, |
| 89 | ], |
| 90 | |
| 91 | ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]', |
| 92 | { |
| 93 | 'defines': [ |
| 94 | 'SK_SAMPLES_FOR_X', |
| 95 | 'SK_BUILD_FOR_UNIX', |
| 96 | ], |
| 97 | 'configurations': { |
| 98 | 'Debug': { |
| 99 | 'cflags': ['-g'] |
| 100 | }, |
| 101 | 'Release': { |
| bungeman@google.com | 97efada | 2012-07-30 20:40:50 +0000 | [diff] [blame] | 102 | 'cflags': ['-O3 -g'], |
| senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 103 | 'defines': [ 'NDEBUG' ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 104 | }, |
| 105 | }, |
| bsalomon@google.com | cadbcb8 | 2012-01-06 19:22:11 +0000 | [diff] [blame] | 106 | 'cflags': [ |
| 107 | # TODO(tony): Enable -Werror once all the strict-aliasing problems |
| 108 | # are fixed. |
| 109 | #'-Werror', |
| bsalomon@google.com | 31648eb | 2011-11-23 15:01:08 +0000 | [diff] [blame] | 110 | '-Wall', |
| 111 | '-Wextra', |
| 112 | '-Wno-unused', |
| 113 | # suppressions below here were added for clang |
| 114 | '-Wno-unused-parameter', |
| 115 | '-Wno-c++11-extensions' |
| 116 | ], |
| borenet@google.com | a37a517 | 2012-08-09 20:44:32 +0000 | [diff] [blame] | 117 | 'conditions' : [ |
| 118 | ['skia_arch_width == 64', { |
| 119 | 'cflags': [ |
| 120 | '-m64', |
| 121 | ], |
| 122 | 'ldflags': [ |
| 123 | '-m64', |
| 124 | ], |
| 125 | }], |
| 126 | ['skia_arch_width == 32', { |
| 127 | 'cflags': [ |
| 128 | '-m32', |
| 129 | ], |
| 130 | 'ldflags': [ |
| 131 | '-m32', |
| 132 | ], |
| 133 | }], |
| 134 | ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 135 | 'include_dirs' : [ |
| 136 | '/usr/include/freetype2', |
| 137 | ], |
| 138 | }, |
| 139 | ], |
| 140 | |
| chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 141 | ['skia_os == "mac"', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 142 | { |
| 143 | 'defines': [ |
| 144 | 'SK_BUILD_FOR_MAC', |
| 145 | ], |
| djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 146 | 'conditions' : [ |
| 147 | ['skia_arch_width == 64', { |
| 148 | 'xcode_settings': { |
| 149 | 'ARCHS': 'x86_64', |
| 150 | }, |
| 151 | }], |
| 152 | ['skia_arch_width == 32', { |
| 153 | 'xcode_settings': { |
| 154 | 'ARCHS': 'i386', |
| 155 | }, |
| 156 | }], |
| 157 | ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 158 | 'configurations': { |
| 159 | 'Debug': { |
| 160 | 'xcode_settings': { |
| 161 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 162 | }, |
| 163 | }, |
| reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 164 | 'Release': { |
| 165 | 'xcode_settings': { |
| 166 | 'GCC_OPTIMIZATION_LEVEL': '3', |
| 167 | }, |
| senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 168 | 'defines': [ 'NDEBUG' ], |
| reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 169 | }, |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 170 | }, |
| 171 | 'xcode_settings': { |
| robertphillips@google.com | 0229765 | 2012-04-05 19:29:04 +0000 | [diff] [blame] | 172 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 173 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| bsalomon@google.com | 4d5cb45 | 2011-10-12 18:12:11 +0000 | [diff] [blame] | 174 | 'SDKROOT': 'macosx10.6', |
| reed@google.com | 0069aa5 | 2011-11-17 15:35:47 +0000 | [diff] [blame] | 175 | # trying to get this to work, but it needs clang I think... |
| 176 | # 'WARNING_CFLAGS': '-Wexit-time-destructors', |
| mike@reedtribe.org | e51755f | 2011-12-10 19:36:56 +0000 | [diff] [blame] | 177 | 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO', |
| caryclark@google.com | b462a42 | 2012-06-06 12:12:28 +0000 | [diff] [blame] | 178 | 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES', |
| 179 | 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES', |
| 180 | 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES', |
| 181 | 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', |
| 182 | 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES', |
| 183 | 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES', |
| 184 | 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES', |
| 185 | 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES', |
| 186 | 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES', |
| 187 | 'GCC_WARN_MISSING_PARENTHESES': 'YES', |
| 188 | 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES', |
| 189 | 'GCC_WARN_SIGN_COMPARE': 'YES', |
| 190 | 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES', |
| 191 | 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES', |
| 192 | 'GCC_WARN_UNUSED_FUNCTION': 'YES', |
| 193 | 'GCC_WARN_UNUSED_LABEL': 'YES', |
| 194 | 'GCC_WARN_UNUSED_VALUE': 'YES', |
| 195 | 'GCC_WARN_UNUSED_VARIABLE': 'YES', |
| caryclark@google.com | e5720e3 | 2012-05-31 12:39:18 +0000 | [diff] [blame] | 196 | 'OTHER_CPLUSPLUSFLAGS': '-mssse3 -fvisibility=hidden -fvisibility-inlines-hidden', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 197 | }, |
| 198 | }, |
| 199 | ], |
| 200 | |
| chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 201 | ['skia_os == "ios"', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 202 | { |
| 203 | 'defines': [ |
| 204 | 'SK_BUILD_FOR_IOS', |
| 205 | ], |
| 206 | 'configurations': { |
| 207 | 'Debug': { |
| 208 | 'xcode_settings': { |
| 209 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 210 | }, |
| 211 | }, |
| 212 | }, |
| 213 | 'xcode_settings': { |
| 214 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 215 | }, |
| 216 | }, |
| 217 | ], |
| chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 218 | |
| 219 | ['skia_os == "android"', |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 220 | { |
| 221 | 'defines': [ |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 222 | 'SK_BUILD_FOR_ANDROID', |
| 223 | 'SK_BUILD_FOR_ANDROID_NDK', |
| digit@google.com | 70ccffe | 2012-01-10 10:28:30 +0000 | [diff] [blame] | 224 | 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0', |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 225 | ], |
| 226 | 'configurations': { |
| 227 | 'Debug': { |
| 228 | 'cflags': ['-g'] |
| 229 | }, |
| 230 | 'Release': { |
| senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 231 | 'cflags': ['-O2'], |
| 232 | 'defines': [ 'NDEBUG' ], |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 233 | }, |
| 234 | }, |
| 235 | 'libraries': [ |
| 236 | '-lstdc++', |
| 237 | '-lm', |
| djsollen@google.com | 318cf92 | 2011-11-08 19:03:43 +0000 | [diff] [blame] | 238 | '-llog', |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 239 | ], |
| djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 240 | 'cflags': [ |
| 241 | '-fno-exceptions', |
| 242 | '-fno-rtti', |
| borenet@google.com | de9ac14 | 2012-07-25 15:17:03 +0000 | [diff] [blame] | 243 | '-fuse-ld=gold', |
| 244 | '--sysroot=<(android_base)/toolchains/<(android_toolchain)/sysroot', |
| 245 | ], |
| 246 | 'include_dirs' : [ |
| 247 | '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include', |
| 248 | '<(android_base)/toolchains/<(android_toolchain)/lib/gcc/arm-linux-androideabi/4.6.x-google/include-fixed', |
| 249 | '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6', |
| 250 | '<(android_base)/toolchains/<(android_toolchain)/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi', |
| 251 | '<(android_base)/toolchains/<(android_toolchain)/sysroot/usr/include', |
| djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 252 | ], |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 253 | 'conditions': [ |
| djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 254 | [ 'skia_arch_type == "arm"', { |
| djsollen@google.com | cf74030 | 2012-02-24 14:09:02 +0000 | [diff] [blame] | 255 | 'ldflags': [ |
| 256 | '-Wl', |
| djsollen@google.com | cf74030 | 2012-02-24 14:09:02 +0000 | [diff] [blame] | 257 | ], |
| 258 | }], |
| djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 259 | [ 'skia_arch_type == "arm" and arm_thumb == 1', { |
| djsollen@google.com | 3839ca1 | 2011-11-03 17:31:41 +0000 | [diff] [blame] | 260 | 'cflags': [ |
| 261 | '-mthumb', |
| 262 | ], |
| 263 | }], |
| djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 264 | [ 'skia_arch_type == "arm" and armv7 == 1', { |
| digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 265 | 'variables': { |
| 266 | 'arm_neon_optional%': 0, |
| 267 | }, |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 268 | 'defines': [ |
| 269 | '__ARM_ARCH__=7', |
| 270 | ], |
| 271 | 'cflags': [ |
| 272 | '-march=armv7-a', |
| djsollen@google.com | cf74030 | 2012-02-24 14:09:02 +0000 | [diff] [blame] | 273 | '-mfloat-abi=softfp', |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 274 | ], |
| 275 | 'conditions': [ |
| 276 | [ 'arm_neon == 1', { |
| 277 | 'defines': [ |
| 278 | '__ARM_HAVE_NEON', |
| 279 | ], |
| 280 | 'cflags': [ |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 281 | '-mfpu=neon', |
| 282 | ], |
| digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 283 | }], |
| 284 | [ 'arm_neon_optional == 1', { |
| 285 | 'defines': [ |
| 286 | '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', |
| 287 | ], |
| 288 | }], |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 289 | ], |
| 290 | }], |
| chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 291 | ], |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 292 | }, |
| 293 | ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 294 | |
| digit@google.com | 1771cbf | 2012-01-26 21:26:40 +0000 | [diff] [blame] | 295 | # We can POD-style initialization of static mutexes to avoid generating |
| 296 | # static initializers if we're using a pthread-compatible thread interface. |
| 297 | [ 'skia_os != "win"', { |
| 298 | 'defines': [ |
| 299 | 'SK_USE_POSIX_THREADS' |
| 300 | ], |
| 301 | }], |
| 302 | |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 303 | ], # end 'conditions' |
| 304 | } |
| 305 | |
| 306 | # Local Variables: |
| 307 | # tab-width:2 |
| 308 | # indent-tabs-mode:nil |
| 309 | # End: |
| 310 | # vim: set expandtab tabstop=2 shiftwidth=2: |