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", |
egdaniel | 32119f1 | 2016-02-22 10:07:54 -0800 | [diff] [blame] | 117 | |
| 118 | # Currently exclude all vulkan specific files |
| 119 | "src/gpu/vk/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 120 | ], |
| 121 | ) |
| 122 | |
| 123 | # Platform-dependent SRCS for google3-default platform. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 124 | BASE_SRCS_UNIX = struct( |
| 125 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 126 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 127 | "src/codec/*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 128 | "src/fonts/SkFontMgr_fontconfig.cpp", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 129 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 130 | "src/images/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 131 | "src/opts/**/*.cpp", |
| 132 | "src/opts/**/*.h", |
| 133 | "src/ports/**/*.cpp", |
| 134 | "src/ports/**/*.h", |
| 135 | ], |
| 136 | exclude = [ |
| 137 | "src/opts/*arm*", |
| 138 | "src/opts/*mips*", |
| 139 | "src/opts/*NEON*", |
| 140 | "src/opts/*neon*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 141 | # Included in :opts_ssse3 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 142 | "src/opts/*SSSE3*", |
| 143 | "src/opts/*ssse3*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 144 | # Included in :opts_sse4 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 145 | "src/opts/*SSE4*", |
| 146 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 147 | # Included in :opts_avx or :opts_avx2 |
| 148 | "src/opts/*avx*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 149 | "src/opts/SkBitmapProcState_opts_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 150 | "src/opts/SkBlitMask_opts_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 151 | "src/opts/SkBlitRow_opts_none.cpp", |
| 152 | "src/ports/*android*", |
| 153 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 154 | "src/ports/*mac*", |
| 155 | "src/ports/*mozalloc*", |
| 156 | "src/ports/*nacl*", |
| 157 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 158 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 159 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 160 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 161 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 404816e | 2015-12-03 05:04:03 -0800 | [diff] [blame] | 162 | "src/ports/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 9dbec09 | 2015-11-02 05:53:38 -0800 | [diff] [blame] | 163 | "src/ports/SkImageDecoder_CG.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 164 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 165 | "src/ports/SkImageDecoder_WIC.cpp", |
| 166 | "src/ports/SkImageDecoder_empty.cpp", |
| 167 | "src/ports/SkImageGenerator_none.cpp", |
| 168 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 169 | ], |
| 170 | ) |
| 171 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 172 | # Platform-dependent SRCS for google3-default Android. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 173 | BASE_SRCS_ANDROID = struct( |
| 174 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 175 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 176 | "src/codec/*", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 177 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 178 | "src/images/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 179 | # TODO(benjaminwagner): Figure out how to compile with EGL. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 180 | "src/opts/**/*.cpp", |
| 181 | "src/opts/**/*.h", |
| 182 | "src/ports/**/*.cpp", |
| 183 | "src/ports/**/*.h", |
| 184 | ], |
| 185 | exclude = [ |
| 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 = [ |
msarett | 2775cf5 | 2016-02-17 14:14:25 -0800 | [diff] [blame] | 221 | "src/android/*", |
| 222 | "src/codec/*", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 223 | "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
| 224 | "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 225 | "src/opts/**/*.cpp", |
| 226 | "src/opts/**/*.h", |
| 227 | "src/ports/**/*.cpp", |
| 228 | "src/ports/**/*.h", |
iroth | ab669de | 2016-02-16 19:17:01 -0800 | [diff] [blame] | 229 | "src/utils/mac/*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 230 | ], |
| 231 | exclude = [ |
msarett | 2775cf5 | 2016-02-17 14:14:25 -0800 | [diff] [blame] | 232 | "src/codec/*Gif*.cpp", |
| 233 | "src/codec/*Ico*.cpp", |
| 234 | "src/codec/*Jpeg*.cpp", |
| 235 | "src/codec/*Webp*.cpp", |
| 236 | "src/codec/*Png*", |
| 237 | "src/codec/*Raw*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 238 | "src/opts/*mips*", |
| 239 | "src/opts/*NEON*", |
| 240 | "src/opts/*neon*", |
| 241 | "src/opts/*SSE2*", |
| 242 | "src/opts/*SSSE3*", |
| 243 | "src/opts/*ssse3*", |
| 244 | "src/opts/*SSE4*", |
| 245 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 246 | "src/opts/*avx*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 247 | "src/opts/*x86*", |
| 248 | "src/opts/SkBitmapProcState_opts_none.cpp", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 249 | "src/opts/SkBlitMask_opts_arm*.cpp", |
| 250 | "src/opts/SkBlitRow_opts_arm*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 251 | "src/ports/*android*", |
| 252 | "src/ports/*chromium*", |
| 253 | "src/ports/*fontconfig*", |
| 254 | "src/ports/*FontConfig*", |
| 255 | "src/ports/*FreeType*", |
| 256 | "src/ports/*mozalloc*", |
| 257 | "src/ports/*nacl*", |
| 258 | "src/ports/*win*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 259 | "src/ports/SkFontMgr_custom.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 260 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 261 | "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 262 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 263 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 264 | "src/ports/SkFontMgr_empty_factory.cpp", |
| 265 | "src/ports/SkImageDecoder_CG.cpp", |
| 266 | "src/ports/SkImageDecoder_WIC.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 267 | "src/ports/SkImageGenerator_none.cpp", |
| 268 | "src/ports/SkTLS_none.cpp", |
| 269 | ], |
| 270 | ) |
| 271 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 272 | ################################################################################ |
| 273 | ## SSSE3/SSE4/AVX/AVX2 SRCS |
| 274 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 275 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 276 | SSSE3_SRCS = struct( |
| 277 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 278 | "src/opts/*SSSE3*.cpp", |
| 279 | "src/opts/*ssse3*.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 280 | ], |
| 281 | ) |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 282 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 283 | SSE4_SRCS = struct( |
| 284 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 285 | "src/opts/*SSE4*.cpp", |
| 286 | "src/opts/*sse4*.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 287 | ], |
| 288 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 289 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 290 | AVX_SRCS = struct( |
| 291 | include = [ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 292 | "src/opts/*_avx.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 293 | ], |
| 294 | ) |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 295 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 296 | AVX2_SRCS = struct( |
| 297 | include = [ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 298 | "src/opts/*_avx2.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 299 | ], |
| 300 | ) |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 301 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 302 | ################################################################################ |
| 303 | ## BASE_HDRS |
| 304 | ################################################################################ |
| 305 | |
| 306 | BASE_HDRS = struct( |
| 307 | include = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 308 | "include/**/*.h", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 309 | "src/utils/SkWhitelistChecksums.cpp", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 310 | ], |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 311 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 312 | "include/private/**/*", |
| 313 | |
| 314 | # Not used. |
| 315 | "include/animator/**/*", |
| 316 | "include/views/**/*", |
| 317 | "include/xml/SkBML_WXMLParser.h", |
| 318 | "include/xml/SkBML_XMLParser.h", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 319 | ], |
| 320 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 321 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 322 | ################################################################################ |
| 323 | ## BASE_DEPS |
| 324 | ################################################################################ |
| 325 | |
| 326 | BASE_DEPS_ALL = [] |
| 327 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 328 | BASE_DEPS_UNIX = [ |
iroth | 330043c | 2016-01-12 14:22:24 -0800 | [diff] [blame] | 329 | ":opts_ssse3", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 330 | ":opts_sse4", |
| 331 | ":opts_avx", |
| 332 | ":opts_avx2", |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 333 | ] |
| 334 | |
| 335 | BASE_DEPS_ANDROID = [] |
| 336 | |
| 337 | BASE_DEPS_IOS = [] |
| 338 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 339 | ################################################################################ |
| 340 | ## INCLUDES |
| 341 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 342 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 343 | # Includes needed by Skia implementation. Not public includes. |
| 344 | INCLUDES = [ |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 345 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 346 | "include/c", |
robertphillips | 188d44c | 2016-02-01 04:54:14 -0800 | [diff] [blame] | 347 | "include/client/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 348 | "include/codec", |
| 349 | "include/config", |
| 350 | "include/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 351 | "include/effects", |
| 352 | "include/gpu", |
| 353 | "include/images", |
| 354 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 355 | "include/pipe", |
| 356 | "include/ports", |
| 357 | "include/private", |
| 358 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 359 | "include/utils/mac", |
| 360 | "include/utils/win", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 361 | "include/svg", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 362 | "include/xml", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 363 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 364 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 365 | "src/gpu", |
| 366 | "src/image", |
| 367 | "src/lazy", |
| 368 | "src/opts", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 369 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 370 | "src/pdf", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 371 | "src/sfnt", |
| 372 | "src/utils", |
| 373 | "third_party/etc1", |
| 374 | "third_party/ktx", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 375 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 376 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 377 | ################################################################################ |
| 378 | ## DM_SRCS |
| 379 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 380 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 381 | DM_SRCS_ALL = struct( |
| 382 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 383 | "dm/*.cpp", |
| 384 | "dm/*.h", |
| 385 | "gm/*.c", |
| 386 | "gm/*.cpp", |
| 387 | "gm/*.h", |
| 388 | "tests/*.cpp", |
| 389 | "tests/*.h", |
| 390 | "tools/CrashHandler.cpp", |
| 391 | "tools/CrashHandler.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 392 | "tools/ProcStats.cpp", |
| 393 | "tools/ProcStats.h", |
| 394 | "tools/Resources.cpp", |
| 395 | "tools/Resources.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 396 | "tools/SkBitmapRegionCanvas.cpp", |
| 397 | "tools/SkBitmapRegionCanvas.h", |
| 398 | "tools/SkBitmapRegionCodec.cpp", |
| 399 | "tools/SkBitmapRegionCodec.h", |
msarett | 5cb4885 | 2015-11-06 08:56:32 -0800 | [diff] [blame] | 400 | "tools/SkBitmapRegionDecoder.cpp", |
| 401 | "tools/SkBitmapRegionDecoder.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 402 | "tools/SkBitmapRegionSampler.cpp", |
| 403 | "tools/SkBitmapRegionSampler.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 404 | "tools/flags/*.cpp", |
| 405 | "tools/flags/*.h", |
mtklein | e1fc452 | 2016-02-09 12:32:52 -0800 | [diff] [blame] | 406 | "tools/random_parse_path.cpp", |
| 407 | "tools/random_parse_path.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 408 | "tools/sk_tool_utils.cpp", |
| 409 | "tools/sk_tool_utils.h", |
| 410 | "tools/sk_tool_utils_font.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 411 | "tools/timer/*.cpp", |
| 412 | "tools/timer/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 413 | ], |
| 414 | exclude = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 415 | "dm/DMSrcSinkAndroid.cpp", # Android-only. |
| 416 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
| 417 | "tests/PathOpsSkpClipTest.cpp", # Alternate main. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 418 | "tests/skia_test.cpp", # Old main. |
| 419 | "tests/SkpSkGrTest.cpp", # Alternate main. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 420 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 421 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 422 | ], |
| 423 | ) |
| 424 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 425 | DM_SRCS_UNIX = struct() |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 426 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 427 | DM_SRCS_ANDROID = struct( |
| 428 | include = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 429 | # Depends on Android HWUI library that is not available in google3. |
| 430 | #"dm/DMSrcSinkAndroid.cpp", |
| 431 | "tests/FontMgrAndroidParserTest.cpp", |
| 432 | ], |
| 433 | ) |
| 434 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 435 | DM_SRCS_IOS = struct() |
| 436 | |
| 437 | ################################################################################ |
| 438 | ## DM_INCLUDES |
| 439 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 440 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 441 | DM_INCLUDES = [ |
benjaminwagner | b1fe8f6 | 2016-02-01 09:05:08 -0800 | [diff] [blame] | 442 | "dm", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 443 | "gm", |
| 444 | "src/codec", |
| 445 | "src/effects", |
benjaminwagner | bc9a9b4 | 2016-02-22 13:30:39 -0800 | [diff] [blame] | 446 | "src/effects/gradients", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 447 | "src/fonts", |
| 448 | "src/pathops", |
| 449 | "src/pipe/utils", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 450 | "src/ports", |
ethannicholas | 3cb9542 | 2016-02-09 12:44:06 -0800 | [diff] [blame] | 451 | "tools/debugger", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 452 | "tests", |
| 453 | "tools", |
| 454 | "tools/flags", |
| 455 | "tools/timer", |
| 456 | ] |
| 457 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 458 | ################################################################################ |
| 459 | ## DM_ARGS |
| 460 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 461 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 462 | def DM_ARGS(base_dir): |
| 463 | return [ |
| 464 | "--nogpu", |
| 465 | "--verbose", |
| 466 | # TODO(mtklein): maybe investigate why these fail? |
benjaminwagner | f6bfccd | 2016-02-25 10:28:11 -0800 | [diff] [blame] | 467 | "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 468 | "--resourcePath %s/resources" % base_dir, |
| 469 | "--images %s/resources" % base_dir, |
| 470 | ] |
| 471 | |
| 472 | ################################################################################ |
| 473 | ## COPTS |
| 474 | ################################################################################ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 475 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 476 | COPTS_UNIX = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 477 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
benjaminwagner | 7d974f5 | 2015-10-19 13:55:55 -0700 | [diff] [blame] | 478 | "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 479 | ] |
| 480 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 481 | COPTS_ANDROID = ["-mfpu=neon"] |
| 482 | |
| 483 | COPTS_IOS = [] |
| 484 | |
| 485 | COPTS_ALL = [] |
| 486 | |
| 487 | ################################################################################ |
| 488 | ## DEFINES |
| 489 | ################################################################################ |
| 490 | |
| 491 | DEFINES_UNIX = [ |
msarett | 70e418b | 2016-02-12 12:35:48 -0800 | [diff] [blame] | 492 | "PNG_SKIP_SETJMP_CHECK", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 493 | "SK_BUILD_FOR_UNIX", |
| 494 | "SK_SAMPLES_FOR_X", |
| 495 | "SK_SFNTLY_SUBSETTER", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 496 | "SK_CODEC_DECODES_GIF", |
| 497 | "SK_CODEC_DECODES_JPEG", |
| 498 | "SK_CODEC_DECODES_PNG", |
benjaminwagner | 186e0b9 | 2016-02-11 16:00:24 -0800 | [diff] [blame] | 499 | "SK_CODEC_DECODES_RAW", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 500 | "SK_CODEC_DECODES_WEBP", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 501 | ] |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 502 | |
| 503 | DEFINES_ANDROID = [ |
| 504 | "SK_BUILD_FOR_ANDROID", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 505 | "SK_CODEC_DECODES_GIF", |
| 506 | "SK_CODEC_DECODES_JPEG", |
| 507 | "SK_CODEC_DECODES_PNG", |
benjaminwagner | 186e0b9 | 2016-02-11 16:00:24 -0800 | [diff] [blame] | 508 | "SK_CODEC_DECODES_RAW", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 509 | "SK_CODEC_DECODES_WEBP", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 510 | ] |
| 511 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 512 | DEFINES_IOS = [ |
| 513 | "SK_BUILD_FOR_IOS", |
| 514 | "SK_IGNORE_ETC1_SUPPORT", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 515 | "SKNX_NO_SIMD", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 516 | ] |
| 517 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 518 | DEFINES_ALL = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 519 | # Chrome DEFINES. |
| 520 | "SK_USE_FLOATBITS", |
| 521 | "SK_USE_FREETYPE_EMBOLDEN", |
| 522 | # Turn on a few Google3-specific build fixes. |
| 523 | "GOOGLE3", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 524 | ] |
| 525 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 526 | ################################################################################ |
| 527 | ## LINKOPTS |
| 528 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 529 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 530 | LINKOPTS_UNIX = [] |
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_ANDROID = [ |
| 533 | "-lEGL", |
| 534 | ] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 535 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 536 | LINKOPTS_IOS = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 537 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 538 | LINKOPTS_ALL = [ |
| 539 | "-ldl", |
| 540 | ] |