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