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