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", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 100 | |
| 101 | # Exclude files that don't compile with the current DEFINES. |
| 102 | "src/gpu/gl/angle/*", # Requires SK_ANGLE define. |
| 103 | "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' |
| 104 | "src/gpu/gl/mesa/*", # Requires SK_MESA define. |
| 105 | "src/svg/parser/*", # Missing SkSVG.h. |
| 106 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 107 | # Conflicting dependencies among Lua versions. See cl/107087297. |
| 108 | "src/utils/SkLua*", |
| 109 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 110 | # Not used. |
| 111 | "src/animator/**/*", |
| 112 | "src/views/**/*", |
| 113 | "src/xml/SkBML_Verbs.h", |
| 114 | "src/xml/SkBML_XMLParser.cpp", |
| 115 | "src/xml/SkXMLPullParser.cpp", |
| 116 | ], |
| 117 | ) |
| 118 | |
| 119 | # Platform-dependent SRCS for google3-default platform. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 120 | BASE_SRCS_UNIX = struct( |
| 121 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 122 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 123 | "src/codec/*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 124 | "src/fonts/SkFontMgr_fontconfig.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 125 | "src/images/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 126 | "src/opts/**/*.cpp", |
| 127 | "src/opts/**/*.h", |
| 128 | "src/ports/**/*.cpp", |
| 129 | "src/ports/**/*.h", |
| 130 | ], |
| 131 | exclude = [ |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 132 | "src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch. |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 133 | # TODO(benjaminwagner): Can this be enabled? |
| 134 | "src/codec/SkRaw*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 135 | "src/opts/*arm*", |
| 136 | "src/opts/*mips*", |
| 137 | "src/opts/*NEON*", |
| 138 | "src/opts/*neon*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 139 | # Included in :opts_ssse3 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 140 | "src/opts/*SSSE3*", |
| 141 | "src/opts/*ssse3*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 142 | # Included in :opts_sse4 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 143 | "src/opts/*SSE4*", |
| 144 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 145 | # Included in :opts_avx or :opts_avx2 |
| 146 | "src/opts/*avx*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 147 | "src/opts/SkBitmapProcState_opts_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 148 | "src/opts/SkBlitMask_opts_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 149 | "src/opts/SkBlitRow_opts_none.cpp", |
| 150 | "src/ports/*android*", |
| 151 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 152 | "src/ports/*mac*", |
| 153 | "src/ports/*mozalloc*", |
| 154 | "src/ports/*nacl*", |
| 155 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 156 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 157 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 158 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 159 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 404816e | 2015-12-03 05:04:03 -0800 | [diff] [blame] | 160 | "src/ports/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 9dbec09 | 2015-11-02 05:53:38 -0800 | [diff] [blame] | 161 | "src/ports/SkImageDecoder_CG.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 162 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 163 | "src/ports/SkImageDecoder_WIC.cpp", |
| 164 | "src/ports/SkImageDecoder_empty.cpp", |
| 165 | "src/ports/SkImageGenerator_none.cpp", |
| 166 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 167 | ], |
| 168 | ) |
| 169 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 170 | # Platform-dependent SRCS for google3-default Android. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 171 | BASE_SRCS_ANDROID = struct( |
| 172 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 173 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 174 | "src/codec/*", |
| 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 = [ |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 183 | "src/codec/SkJpegCodec.cpp", # libjpeg_turbo version mismatch. |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 184 | # TODO(benjaminwagner): Can this be enabled? |
| 185 | "src/codec/SkRaw*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 186 | "src/opts/*mips*", |
| 187 | "src/opts/*SSE2*", |
| 188 | "src/opts/*SSSE3*", |
| 189 | "src/opts/*ssse3*", |
| 190 | "src/opts/*SSE4*", |
| 191 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 192 | "src/opts/*avx*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 193 | "src/opts/*x86*", |
| 194 | "src/opts/SkBitmapProcState_opts_none.cpp", |
| 195 | "src/opts/SkBlitMask_opts_none.cpp", |
| 196 | "src/opts/SkBlitRow_opts_none.cpp", |
| 197 | "src/ports/*chromium*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 198 | "src/ports/*fontconfig*", |
| 199 | "src/ports/*FontConfig*", |
| 200 | "src/ports/*mac*", |
| 201 | "src/ports/*mozalloc*", |
| 202 | "src/ports/*nacl*", |
| 203 | "src/ports/*win*", |
| 204 | "src/ports/SkDebug_stdio.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 205 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 206 | "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 207 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 208 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 209 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 9dbec09 | 2015-11-02 05:53:38 -0800 | [diff] [blame] | 210 | "src/ports/SkImageDecoder_CG.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 211 | "src/ports/SkImageDecoder_WIC.cpp", |
| 212 | "src/ports/SkImageDecoder_empty.cpp", |
| 213 | "src/ports/SkImageGenerator_none.cpp", |
| 214 | "src/ports/SkTLS_none.cpp", |
| 215 | ], |
| 216 | ) |
| 217 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 218 | # Platform-dependent SRCS for google3-default iOS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 219 | BASE_SRCS_IOS = struct( |
| 220 | include = [ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 221 | "src/opts/**/*.cpp", |
| 222 | "src/opts/**/*.h", |
| 223 | "src/ports/**/*.cpp", |
| 224 | "src/ports/**/*.h", |
| 225 | ], |
| 226 | exclude = [ |
| 227 | "src/opts/*mips*", |
| 228 | "src/opts/*NEON*", |
| 229 | "src/opts/*neon*", |
| 230 | "src/opts/*SSE2*", |
| 231 | "src/opts/*SSSE3*", |
| 232 | "src/opts/*ssse3*", |
| 233 | "src/opts/*SSE4*", |
| 234 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 235 | "src/opts/*avx*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 236 | "src/opts/*x86*", |
| 237 | "src/opts/SkBitmapProcState_opts_none.cpp", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 238 | "src/opts/SkBlitMask_opts_arm*.cpp", |
| 239 | "src/opts/SkBlitRow_opts_arm*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 240 | "src/ports/*android*", |
| 241 | "src/ports/*chromium*", |
| 242 | "src/ports/*fontconfig*", |
| 243 | "src/ports/*FontConfig*", |
| 244 | "src/ports/*FreeType*", |
| 245 | "src/ports/*mozalloc*", |
| 246 | "src/ports/*nacl*", |
| 247 | "src/ports/*win*", |
| 248 | "src/ports/SkDebug_stdio.cpp", |
| 249 | "src/ports/SkFontMgr_custom.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 250 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 251 | "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 252 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 253 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 254 | "src/ports/SkFontMgr_empty_factory.cpp", |
| 255 | "src/ports/SkImageDecoder_CG.cpp", |
| 256 | "src/ports/SkImageDecoder_WIC.cpp", |
| 257 | "src/ports/SkImageDecoder_empty.cpp", |
| 258 | "src/ports/SkImageGenerator_none.cpp", |
| 259 | "src/ports/SkTLS_none.cpp", |
| 260 | ], |
| 261 | ) |
| 262 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 263 | ################################################################################ |
| 264 | ## SSSE3/SSE4/AVX/AVX2 SRCS |
| 265 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 266 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 267 | SSSE3_SRCS = struct( |
| 268 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 269 | "src/opts/*SSSE3*.cpp", |
| 270 | "src/opts/*ssse3*.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 271 | ], |
| 272 | ) |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 273 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 274 | SSE4_SRCS = struct( |
| 275 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 276 | "src/opts/*SSE4*.cpp", |
| 277 | "src/opts/*sse4*.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 278 | ], |
| 279 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 280 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 281 | AVX_SRCS = struct( |
| 282 | include = [ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 283 | "src/opts/*_avx.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 284 | ], |
| 285 | ) |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 286 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 287 | AVX2_SRCS = struct( |
| 288 | include = [ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 289 | "src/opts/*_avx2.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 | ################################################################################ |
| 294 | ## BASE_HDRS |
| 295 | ################################################################################ |
| 296 | |
| 297 | BASE_HDRS = struct( |
| 298 | include = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 299 | "include/**/*.h", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 300 | "src/utils/SkWhitelistChecksums.cpp", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 301 | ], |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 302 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 303 | "include/private/**/*", |
| 304 | |
| 305 | # Not used. |
| 306 | "include/animator/**/*", |
| 307 | "include/views/**/*", |
| 308 | "include/xml/SkBML_WXMLParser.h", |
| 309 | "include/xml/SkBML_XMLParser.h", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 310 | ], |
| 311 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 312 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 313 | ################################################################################ |
| 314 | ## BASE_DEPS |
| 315 | ################################################################################ |
| 316 | |
| 317 | BASE_DEPS_ALL = [] |
| 318 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 319 | BASE_DEPS_UNIX = [ |
iroth | 330043c | 2016-01-12 14:22:24 -0800 | [diff] [blame] | 320 | ":opts_ssse3", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 321 | ":opts_sse4", |
| 322 | ":opts_avx", |
| 323 | ":opts_avx2", |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 324 | ] |
| 325 | |
| 326 | BASE_DEPS_ANDROID = [] |
| 327 | |
| 328 | BASE_DEPS_IOS = [] |
| 329 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 330 | ################################################################################ |
| 331 | ## INCLUDES |
| 332 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 333 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 334 | # Includes needed by Skia implementation. Not public includes. |
| 335 | INCLUDES = [ |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 336 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 337 | "include/c", |
robertphillips | 188d44c | 2016-02-01 04:54:14 -0800 | [diff] [blame] | 338 | "include/client/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 339 | "include/codec", |
| 340 | "include/config", |
| 341 | "include/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 342 | "include/effects", |
| 343 | "include/gpu", |
| 344 | "include/images", |
| 345 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 346 | "include/pipe", |
| 347 | "include/ports", |
| 348 | "include/private", |
| 349 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 350 | "include/utils/mac", |
| 351 | "include/utils/win", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 352 | "include/svg", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 353 | "include/xml", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 354 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 355 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 356 | "src/gpu", |
| 357 | "src/image", |
| 358 | "src/lazy", |
| 359 | "src/opts", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 360 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 361 | "src/pdf", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 362 | "src/sfnt", |
| 363 | "src/utils", |
| 364 | "third_party/etc1", |
| 365 | "third_party/ktx", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 366 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 367 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 368 | ################################################################################ |
| 369 | ## DM_SRCS |
| 370 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 371 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 372 | DM_SRCS_ALL = struct( |
| 373 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 374 | "dm/*.cpp", |
| 375 | "dm/*.h", |
| 376 | "gm/*.c", |
| 377 | "gm/*.cpp", |
| 378 | "gm/*.h", |
| 379 | "tests/*.cpp", |
| 380 | "tests/*.h", |
| 381 | "tools/CrashHandler.cpp", |
| 382 | "tools/CrashHandler.h", |
| 383 | "tools/LazyDecodeBitmap.cpp", |
| 384 | "tools/LazyDecodeBitmap.h", |
| 385 | "tools/ProcStats.cpp", |
| 386 | "tools/ProcStats.h", |
| 387 | "tools/Resources.cpp", |
| 388 | "tools/Resources.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 389 | "tools/SkBitmapRegionCanvas.cpp", |
| 390 | "tools/SkBitmapRegionCanvas.h", |
| 391 | "tools/SkBitmapRegionCodec.cpp", |
| 392 | "tools/SkBitmapRegionCodec.h", |
msarett | 5cb4885 | 2015-11-06 08:56:32 -0800 | [diff] [blame] | 393 | "tools/SkBitmapRegionDecoder.cpp", |
| 394 | "tools/SkBitmapRegionDecoder.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 395 | "tools/SkBitmapRegionSampler.cpp", |
| 396 | "tools/SkBitmapRegionSampler.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 397 | "tools/flags/*.cpp", |
| 398 | "tools/flags/*.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 399 | "tools/sk_tool_utils.cpp", |
| 400 | "tools/sk_tool_utils.h", |
| 401 | "tools/sk_tool_utils_font.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 402 | "tools/timer/*.cpp", |
| 403 | "tools/timer/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 404 | ], |
| 405 | exclude = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 406 | "dm/DMSrcSinkAndroid.cpp", # Android-only. |
| 407 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
| 408 | "tests/PathOpsSkpClipTest.cpp", # Alternate main. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 409 | "tests/skia_test.cpp", # Old main. |
| 410 | "tests/SkpSkGrTest.cpp", # Alternate main. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 411 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 412 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 413 | ], |
| 414 | ) |
| 415 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 416 | DM_SRCS_UNIX = struct() |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 417 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 418 | DM_SRCS_ANDROID = struct( |
| 419 | include = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 420 | # Depends on Android HWUI library that is not available in google3. |
| 421 | #"dm/DMSrcSinkAndroid.cpp", |
| 422 | "tests/FontMgrAndroidParserTest.cpp", |
| 423 | ], |
| 424 | ) |
| 425 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 426 | DM_SRCS_IOS = struct() |
| 427 | |
| 428 | ################################################################################ |
| 429 | ## DM_INCLUDES |
| 430 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 431 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 432 | DM_INCLUDES = [ |
benjaminwagner | b1fe8f6 | 2016-02-01 09:05:08 -0800 | [diff] [blame] | 433 | "dm", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 434 | "gm", |
| 435 | "src/codec", |
| 436 | "src/effects", |
| 437 | "src/fonts", |
| 438 | "src/pathops", |
| 439 | "src/pipe/utils", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 440 | "src/ports", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 441 | "src/utils/debugger", |
| 442 | "tests", |
| 443 | "tools", |
| 444 | "tools/flags", |
| 445 | "tools/timer", |
| 446 | ] |
| 447 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 448 | ################################################################################ |
| 449 | ## DM_ARGS |
| 450 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 451 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 452 | def DM_ARGS(base_dir): |
| 453 | return [ |
| 454 | "--nogpu", |
| 455 | "--verbose", |
| 456 | # TODO(mtklein): maybe investigate why these fail? |
| 457 | "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds", |
| 458 | "--resourcePath %s/resources" % base_dir, |
| 459 | "--images %s/resources" % base_dir, |
| 460 | ] |
| 461 | |
| 462 | ################################################################################ |
| 463 | ## COPTS |
| 464 | ################################################################################ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 465 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 466 | COPTS_UNIX = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 467 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
benjaminwagner | 7d974f5 | 2015-10-19 13:55:55 -0700 | [diff] [blame] | 468 | "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 469 | ] |
| 470 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 471 | COPTS_ANDROID = ["-mfpu=neon"] |
| 472 | |
| 473 | COPTS_IOS = [] |
| 474 | |
| 475 | COPTS_ALL = [] |
| 476 | |
| 477 | ################################################################################ |
| 478 | ## DEFINES |
| 479 | ################################################################################ |
| 480 | |
| 481 | DEFINES_UNIX = [ |
| 482 | "SK_BUILD_FOR_UNIX", |
| 483 | "SK_SAMPLES_FOR_X", |
| 484 | "SK_SFNTLY_SUBSETTER", |
| 485 | ] |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 486 | |
| 487 | DEFINES_ANDROID = [ |
| 488 | "SK_BUILD_FOR_ANDROID", |
| 489 | # TODO(benjaminwagner): Try to get png library updated? |
| 490 | "SK_PNG_NO_INDEX_SUPPORTED", |
| 491 | ] |
| 492 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 493 | DEFINES_IOS = [ |
| 494 | "SK_BUILD_FOR_IOS", |
| 495 | "SK_IGNORE_ETC1_SUPPORT", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 496 | "SKNX_NO_SIMD", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 497 | ] |
| 498 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 499 | DEFINES_ALL = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 500 | # Chrome DEFINES. |
| 501 | "SK_USE_FLOATBITS", |
| 502 | "SK_USE_FREETYPE_EMBOLDEN", |
| 503 | # Turn on a few Google3-specific build fixes. |
| 504 | "GOOGLE3", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 505 | ] |
| 506 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 507 | ################################################################################ |
| 508 | ## LINKOPTS |
| 509 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 510 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 511 | LINKOPTS_UNIX = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 512 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 513 | LINKOPTS_ANDROID = [ |
| 514 | "-lEGL", |
| 515 | ] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 516 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 517 | LINKOPTS_IOS = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 518 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 519 | LINKOPTS_ALL = [ |
| 520 | "-ldl", |
| 521 | ] |