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