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