benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # Skylark macros |
| 3 | ################################################################################ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 4 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 5 | is_bazel = not hasattr(native, "genmpm") |
| 6 | |
| 7 | def portable_select(select_dict, bazel_condition, default_condition): |
| 8 | """Replaces select() with a Bazel-friendly wrapper. |
| 9 | |
| 10 | Args: |
| 11 | select_dict: Dictionary in the same format as select(). |
| 12 | Returns: |
| 13 | If Blaze platform, returns select() using select_dict. |
| 14 | If Bazel platform, returns dependencies for condition |
| 15 | bazel_condition, or empty list if none specified. |
| 16 | """ |
| 17 | if is_bazel: |
| 18 | return select_dict.get(bazel_condition, select_dict[default_condition]) |
| 19 | else: |
| 20 | return select(select_dict) |
| 21 | |
| 22 | def skia_select(conditions, results): |
| 23 | """Replaces select() for conditions [UNIX, ANDROID, IOS] |
| 24 | |
| 25 | Args: |
| 26 | conditions: [CONDITION_UNIX, CONDITION_ANDROID, CONDITION_IOS] |
| 27 | results: [RESULT_UNIX, RESULT_ANDROID, RESULT_IOS] |
| 28 | Returns: |
| 29 | The result matching the platform condition. |
| 30 | """ |
| 31 | if len(conditions) != 3 or len(results) != 3: |
| 32 | fail("Must provide exactly 3 conditions and 3 results") |
| 33 | |
| 34 | selector = {} |
| 35 | for i in range(3): |
| 36 | selector[conditions[i]] = results[i] |
| 37 | return portable_select(selector, conditions[2], conditions[0]) |
| 38 | |
| 39 | def skia_glob(srcs): |
| 40 | """Replaces glob() with a version that accepts a struct. |
| 41 | |
| 42 | Args: |
| 43 | srcs: struct(include=[], exclude=[]) |
| 44 | Returns: |
| 45 | Equivalent of glob(srcs.include, exclude=srcs.exclude) |
| 46 | """ |
| 47 | if hasattr(srcs, 'include'): |
| 48 | if hasattr(srcs, 'exclude'): |
| 49 | return native.glob(srcs.include, exclude=srcs.exclude) |
| 50 | else: |
| 51 | return native.glob(srcs.include) |
| 52 | return [] |
| 53 | |
| 54 | ################################################################################ |
| 55 | ## BASE_SRCS |
| 56 | ################################################################################ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 57 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 58 | # All platform-independent SRCS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 59 | BASE_SRCS_ALL = struct( |
| 60 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 61 | "include/private/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 62 | "src/**/*.h", |
| 63 | "src/**/*.cpp", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 64 | |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 65 | # Third Party |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 66 | "third_party/etc1/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 67 | "third_party/etc1/*.h", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 68 | "third_party/ktx/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 69 | "third_party/ktx/*.h", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 70 | ], |
| 71 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 72 | # Exclude platform-dependent files. |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 73 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 74 | "src/codec/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 75 | "src/device/xps/*", # Windows-only. Move to ports? |
| 76 | "src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 77 | "src/fonts/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 78 | "src/gpu/gl/android/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 79 | "src/gpu/gl/egl/*", |
| 80 | "src/gpu/gl/glx/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 81 | "src/gpu/gl/iOS/*", |
| 82 | "src/gpu/gl/mac/*", |
| 83 | "src/gpu/gl/win/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 84 | "src/images/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 85 | "src/opts/**/*", |
| 86 | "src/ports/**/*", |
| 87 | "src/utils/android/**/*", |
| 88 | "src/utils/mac/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 89 | "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? |
| 90 | "src/utils/win/**/*", |
| 91 | "src/views/sdl/*", |
| 92 | "src/views/win/*", |
| 93 | "src/views/unix/*", |
| 94 | |
| 95 | # Exclude multiple definitions. |
| 96 | # TODO(mtklein): Move to opts? |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 97 | "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 98 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
| 99 | "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 100 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 101 | |
| 102 | # Exclude files that don't compile with the current DEFINES. |
| 103 | "src/gpu/gl/angle/*", # Requires SK_ANGLE define. |
| 104 | "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' |
| 105 | "src/gpu/gl/mesa/*", # Requires SK_MESA define. |
| 106 | "src/svg/parser/*", # Missing SkSVG.h. |
| 107 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 108 | # Conflicting dependencies among Lua versions. See cl/107087297. |
| 109 | "src/utils/SkLua*", |
| 110 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 111 | # Not used. |
| 112 | "src/animator/**/*", |
| 113 | "src/views/**/*", |
| 114 | "src/xml/SkBML_Verbs.h", |
| 115 | "src/xml/SkBML_XMLParser.cpp", |
| 116 | "src/xml/SkXMLPullParser.cpp", |
| 117 | ], |
| 118 | ) |
| 119 | |
| 120 | # Platform-dependent SRCS for google3-default platform. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 121 | BASE_SRCS_UNIX = struct( |
| 122 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 123 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 124 | "src/codec/*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 125 | "src/fonts/SkFontMgr_fontconfig.cpp", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 126 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 127 | "src/images/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 128 | "src/opts/**/*.cpp", |
| 129 | "src/opts/**/*.h", |
| 130 | "src/ports/**/*.cpp", |
| 131 | "src/ports/**/*.h", |
| 132 | ], |
| 133 | exclude = [ |
| 134 | "src/opts/*arm*", |
| 135 | "src/opts/*mips*", |
| 136 | "src/opts/*NEON*", |
| 137 | "src/opts/*neon*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 138 | # Included in :opts_ssse3 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 139 | "src/opts/*SSSE3*", |
| 140 | "src/opts/*ssse3*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 141 | # Included in :opts_sse4 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 142 | "src/opts/*SSE4*", |
| 143 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 144 | # Included in :opts_avx or :opts_avx2 |
| 145 | "src/opts/*avx*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 146 | "src/opts/SkBitmapProcState_opts_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 147 | "src/opts/SkBlitMask_opts_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 148 | "src/opts/SkBlitRow_opts_none.cpp", |
| 149 | "src/ports/*android*", |
| 150 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 151 | "src/ports/*mac*", |
| 152 | "src/ports/*mozalloc*", |
| 153 | "src/ports/*nacl*", |
| 154 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 155 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 156 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 157 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 158 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 404816e | 2015-12-03 05:04:03 -0800 | [diff] [blame] | 159 | "src/ports/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 9dbec09 | 2015-11-02 05:53:38 -0800 | [diff] [blame] | 160 | "src/ports/SkImageDecoder_CG.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 161 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 162 | "src/ports/SkImageDecoder_WIC.cpp", |
| 163 | "src/ports/SkImageDecoder_empty.cpp", |
| 164 | "src/ports/SkImageGenerator_none.cpp", |
| 165 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 166 | ], |
| 167 | ) |
| 168 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 169 | # Platform-dependent SRCS for google3-default Android. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 170 | BASE_SRCS_ANDROID = struct( |
| 171 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 172 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 173 | "src/codec/*", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 174 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 175 | "src/images/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 176 | # TODO(benjaminwagner): Figure out how to compile with EGL. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 177 | "src/opts/**/*.cpp", |
| 178 | "src/opts/**/*.h", |
| 179 | "src/ports/**/*.cpp", |
| 180 | "src/ports/**/*.h", |
| 181 | ], |
| 182 | exclude = [ |
| 183 | "src/opts/*mips*", |
| 184 | "src/opts/*SSE2*", |
| 185 | "src/opts/*SSSE3*", |
| 186 | "src/opts/*ssse3*", |
| 187 | "src/opts/*SSE4*", |
| 188 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 189 | "src/opts/*avx*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 190 | "src/opts/*x86*", |
| 191 | "src/opts/SkBitmapProcState_opts_none.cpp", |
| 192 | "src/opts/SkBlitMask_opts_none.cpp", |
| 193 | "src/opts/SkBlitRow_opts_none.cpp", |
| 194 | "src/ports/*chromium*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 195 | "src/ports/*fontconfig*", |
| 196 | "src/ports/*FontConfig*", |
| 197 | "src/ports/*mac*", |
| 198 | "src/ports/*mozalloc*", |
| 199 | "src/ports/*nacl*", |
| 200 | "src/ports/*win*", |
| 201 | "src/ports/SkDebug_stdio.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 202 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 203 | "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 204 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 205 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 206 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 9dbec09 | 2015-11-02 05:53:38 -0800 | [diff] [blame] | 207 | "src/ports/SkImageDecoder_CG.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 208 | "src/ports/SkImageDecoder_WIC.cpp", |
| 209 | "src/ports/SkImageDecoder_empty.cpp", |
| 210 | "src/ports/SkImageGenerator_none.cpp", |
| 211 | "src/ports/SkTLS_none.cpp", |
| 212 | ], |
| 213 | ) |
| 214 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 215 | # Platform-dependent SRCS for google3-default iOS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 216 | BASE_SRCS_IOS = struct( |
| 217 | include = [ |
msarett | 2775cf5 | 2016-02-17 14:14:25 -0800 | [diff] [blame] | 218 | "src/android/*", |
| 219 | "src/codec/*", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 220 | "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
| 221 | "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 222 | "src/opts/**/*.cpp", |
| 223 | "src/opts/**/*.h", |
| 224 | "src/ports/**/*.cpp", |
| 225 | "src/ports/**/*.h", |
iroth | ab669de | 2016-02-16 19:17:01 -0800 | [diff] [blame] | 226 | "src/utils/mac/*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 227 | ], |
| 228 | exclude = [ |
msarett | 2775cf5 | 2016-02-17 14:14:25 -0800 | [diff] [blame] | 229 | "src/codec/*Gif*.cpp", |
| 230 | "src/codec/*Ico*.cpp", |
| 231 | "src/codec/*Jpeg*.cpp", |
| 232 | "src/codec/*Webp*.cpp", |
| 233 | "src/codec/*Png*", |
| 234 | "src/codec/*Raw*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 235 | "src/opts/*mips*", |
| 236 | "src/opts/*NEON*", |
| 237 | "src/opts/*neon*", |
| 238 | "src/opts/*SSE2*", |
| 239 | "src/opts/*SSSE3*", |
| 240 | "src/opts/*ssse3*", |
| 241 | "src/opts/*SSE4*", |
| 242 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 243 | "src/opts/*avx*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 244 | "src/opts/*x86*", |
| 245 | "src/opts/SkBitmapProcState_opts_none.cpp", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 246 | "src/opts/SkBlitMask_opts_arm*.cpp", |
| 247 | "src/opts/SkBlitRow_opts_arm*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 248 | "src/ports/*android*", |
| 249 | "src/ports/*chromium*", |
| 250 | "src/ports/*fontconfig*", |
| 251 | "src/ports/*FontConfig*", |
| 252 | "src/ports/*FreeType*", |
| 253 | "src/ports/*mozalloc*", |
| 254 | "src/ports/*nacl*", |
| 255 | "src/ports/*win*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 256 | "src/ports/SkFontMgr_custom.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 257 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 258 | "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 259 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 260 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 261 | "src/ports/SkFontMgr_empty_factory.cpp", |
| 262 | "src/ports/SkImageDecoder_CG.cpp", |
| 263 | "src/ports/SkImageDecoder_WIC.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 264 | "src/ports/SkImageGenerator_none.cpp", |
| 265 | "src/ports/SkTLS_none.cpp", |
| 266 | ], |
| 267 | ) |
| 268 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 269 | ################################################################################ |
| 270 | ## SSSE3/SSE4/AVX/AVX2 SRCS |
| 271 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 272 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 273 | SSSE3_SRCS = struct( |
| 274 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 275 | "src/opts/*SSSE3*.cpp", |
| 276 | "src/opts/*ssse3*.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 277 | ], |
| 278 | ) |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 279 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 280 | SSE4_SRCS = struct( |
| 281 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 282 | "src/opts/*SSE4*.cpp", |
| 283 | "src/opts/*sse4*.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 284 | ], |
| 285 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 286 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 287 | AVX_SRCS = struct( |
| 288 | include = [ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 289 | "src/opts/*_avx.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 290 | ], |
| 291 | ) |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 292 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 293 | AVX2_SRCS = struct( |
| 294 | include = [ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 295 | "src/opts/*_avx2.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 296 | ], |
| 297 | ) |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 298 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 299 | ################################################################################ |
| 300 | ## BASE_HDRS |
| 301 | ################################################################################ |
| 302 | |
| 303 | BASE_HDRS = struct( |
| 304 | include = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 305 | "include/**/*.h", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 306 | "src/utils/SkWhitelistChecksums.cpp", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 307 | ], |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 308 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 309 | "include/private/**/*", |
| 310 | |
| 311 | # Not used. |
| 312 | "include/animator/**/*", |
| 313 | "include/views/**/*", |
| 314 | "include/xml/SkBML_WXMLParser.h", |
| 315 | "include/xml/SkBML_XMLParser.h", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 316 | ], |
| 317 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 318 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 319 | ################################################################################ |
| 320 | ## BASE_DEPS |
| 321 | ################################################################################ |
| 322 | |
| 323 | BASE_DEPS_ALL = [] |
| 324 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 325 | BASE_DEPS_UNIX = [ |
iroth | 330043c | 2016-01-12 14:22:24 -0800 | [diff] [blame] | 326 | ":opts_ssse3", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 327 | ":opts_sse4", |
| 328 | ":opts_avx", |
| 329 | ":opts_avx2", |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 330 | ] |
| 331 | |
| 332 | BASE_DEPS_ANDROID = [] |
| 333 | |
| 334 | BASE_DEPS_IOS = [] |
| 335 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 336 | ################################################################################ |
| 337 | ## INCLUDES |
| 338 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 339 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 340 | # Includes needed by Skia implementation. Not public includes. |
| 341 | INCLUDES = [ |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 342 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 343 | "include/c", |
robertphillips | 188d44c | 2016-02-01 04:54:14 -0800 | [diff] [blame] | 344 | "include/client/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 345 | "include/codec", |
| 346 | "include/config", |
| 347 | "include/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 348 | "include/effects", |
| 349 | "include/gpu", |
| 350 | "include/images", |
| 351 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 352 | "include/pipe", |
| 353 | "include/ports", |
| 354 | "include/private", |
| 355 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 356 | "include/utils/mac", |
| 357 | "include/utils/win", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 358 | "include/svg", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 359 | "include/xml", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 360 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 361 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 362 | "src/gpu", |
| 363 | "src/image", |
| 364 | "src/lazy", |
| 365 | "src/opts", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 366 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 367 | "src/pdf", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 368 | "src/sfnt", |
| 369 | "src/utils", |
| 370 | "third_party/etc1", |
| 371 | "third_party/ktx", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 372 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 373 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 374 | ################################################################################ |
| 375 | ## DM_SRCS |
| 376 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 377 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 378 | DM_SRCS_ALL = struct( |
| 379 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 380 | "dm/*.cpp", |
| 381 | "dm/*.h", |
| 382 | "gm/*.c", |
| 383 | "gm/*.cpp", |
| 384 | "gm/*.h", |
| 385 | "tests/*.cpp", |
| 386 | "tests/*.h", |
| 387 | "tools/CrashHandler.cpp", |
| 388 | "tools/CrashHandler.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 389 | "tools/ProcStats.cpp", |
| 390 | "tools/ProcStats.h", |
| 391 | "tools/Resources.cpp", |
| 392 | "tools/Resources.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 393 | "tools/SkBitmapRegionCanvas.cpp", |
| 394 | "tools/SkBitmapRegionCanvas.h", |
| 395 | "tools/SkBitmapRegionCodec.cpp", |
| 396 | "tools/SkBitmapRegionCodec.h", |
msarett | 5cb4885 | 2015-11-06 08:56:32 -0800 | [diff] [blame] | 397 | "tools/SkBitmapRegionDecoder.cpp", |
| 398 | "tools/SkBitmapRegionDecoder.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 399 | "tools/SkBitmapRegionSampler.cpp", |
| 400 | "tools/SkBitmapRegionSampler.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 401 | "tools/flags/*.cpp", |
| 402 | "tools/flags/*.h", |
mtklein | e1fc452 | 2016-02-09 12:32:52 -0800 | [diff] [blame] | 403 | "tools/random_parse_path.cpp", |
| 404 | "tools/random_parse_path.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 405 | "tools/sk_tool_utils.cpp", |
| 406 | "tools/sk_tool_utils.h", |
| 407 | "tools/sk_tool_utils_font.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 408 | "tools/timer/*.cpp", |
| 409 | "tools/timer/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 410 | ], |
| 411 | exclude = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 412 | "dm/DMSrcSinkAndroid.cpp", # Android-only. |
| 413 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
| 414 | "tests/PathOpsSkpClipTest.cpp", # Alternate main. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 415 | "tests/skia_test.cpp", # Old main. |
| 416 | "tests/SkpSkGrTest.cpp", # Alternate main. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 417 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 418 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 419 | ], |
| 420 | ) |
| 421 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 422 | DM_SRCS_UNIX = struct() |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 423 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 424 | DM_SRCS_ANDROID = struct( |
| 425 | include = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 426 | # Depends on Android HWUI library that is not available in google3. |
| 427 | #"dm/DMSrcSinkAndroid.cpp", |
| 428 | "tests/FontMgrAndroidParserTest.cpp", |
| 429 | ], |
| 430 | ) |
| 431 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 432 | DM_SRCS_IOS = struct() |
| 433 | |
| 434 | ################################################################################ |
| 435 | ## DM_INCLUDES |
| 436 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 437 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 438 | DM_INCLUDES = [ |
benjaminwagner | b1fe8f6 | 2016-02-01 09:05:08 -0800 | [diff] [blame] | 439 | "dm", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 440 | "gm", |
| 441 | "src/codec", |
| 442 | "src/effects", |
| 443 | "src/fonts", |
| 444 | "src/pathops", |
| 445 | "src/pipe/utils", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 446 | "src/ports", |
ethannicholas | 3cb9542 | 2016-02-09 12:44:06 -0800 | [diff] [blame] | 447 | "tools/debugger", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 448 | "tests", |
| 449 | "tools", |
| 450 | "tools/flags", |
| 451 | "tools/timer", |
| 452 | ] |
| 453 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 454 | ################################################################################ |
| 455 | ## DM_ARGS |
| 456 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 457 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 458 | def DM_ARGS(base_dir): |
| 459 | return [ |
| 460 | "--nogpu", |
| 461 | "--verbose", |
| 462 | # TODO(mtklein): maybe investigate why these fail? |
| 463 | "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds", |
| 464 | "--resourcePath %s/resources" % base_dir, |
| 465 | "--images %s/resources" % base_dir, |
| 466 | ] |
| 467 | |
| 468 | ################################################################################ |
| 469 | ## COPTS |
| 470 | ################################################################################ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 471 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 472 | COPTS_UNIX = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 473 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
benjaminwagner | 7d974f5 | 2015-10-19 13:55:55 -0700 | [diff] [blame] | 474 | "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 475 | ] |
| 476 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 477 | COPTS_ANDROID = ["-mfpu=neon"] |
| 478 | |
| 479 | COPTS_IOS = [] |
| 480 | |
| 481 | COPTS_ALL = [] |
| 482 | |
| 483 | ################################################################################ |
| 484 | ## DEFINES |
| 485 | ################################################################################ |
| 486 | |
| 487 | DEFINES_UNIX = [ |
msarett | 70e418b | 2016-02-12 12:35:48 -0800 | [diff] [blame] | 488 | "PNG_SKIP_SETJMP_CHECK", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 489 | "SK_BUILD_FOR_UNIX", |
| 490 | "SK_SAMPLES_FOR_X", |
| 491 | "SK_SFNTLY_SUBSETTER", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 492 | "SK_CODEC_DECODES_GIF", |
| 493 | "SK_CODEC_DECODES_JPEG", |
| 494 | "SK_CODEC_DECODES_PNG", |
benjaminwagner | 186e0b9 | 2016-02-11 16:00:24 -0800 | [diff] [blame] | 495 | "SK_CODEC_DECODES_RAW", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 496 | "SK_CODEC_DECODES_WEBP", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 497 | ] |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 498 | |
| 499 | DEFINES_ANDROID = [ |
| 500 | "SK_BUILD_FOR_ANDROID", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 501 | "SK_CODEC_DECODES_GIF", |
| 502 | "SK_CODEC_DECODES_JPEG", |
| 503 | "SK_CODEC_DECODES_PNG", |
benjaminwagner | 186e0b9 | 2016-02-11 16:00:24 -0800 | [diff] [blame] | 504 | "SK_CODEC_DECODES_RAW", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 505 | "SK_CODEC_DECODES_WEBP", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 506 | ] |
| 507 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 508 | DEFINES_IOS = [ |
| 509 | "SK_BUILD_FOR_IOS", |
| 510 | "SK_IGNORE_ETC1_SUPPORT", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 511 | "SKNX_NO_SIMD", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 512 | ] |
| 513 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 514 | DEFINES_ALL = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 515 | # Chrome DEFINES. |
| 516 | "SK_USE_FLOATBITS", |
| 517 | "SK_USE_FREETYPE_EMBOLDEN", |
| 518 | # Turn on a few Google3-specific build fixes. |
| 519 | "GOOGLE3", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 520 | ] |
| 521 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 522 | ################################################################################ |
| 523 | ## LINKOPTS |
| 524 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 525 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 526 | LINKOPTS_UNIX = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 527 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 528 | LINKOPTS_ANDROID = [ |
| 529 | "-lEGL", |
| 530 | ] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 531 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 532 | LINKOPTS_IOS = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 533 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 534 | LINKOPTS_ALL = [ |
| 535 | "-ldl", |
| 536 | ] |