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