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): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 8 | """Replaces select() with a Bazel-friendly wrapper. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 9 | |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 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) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 21 | |
| 22 | def skia_select(conditions, results): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 23 | """Replaces select() for conditions [UNIX, ANDROID, IOS] |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 24 | |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 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") |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 33 | |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 34 | selector = {} |
| 35 | for i in range(3): |
| 36 | selector[conditions[i]] = results[i] |
| 37 | return portable_select(selector, conditions[2], conditions[0]) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 38 | |
| 39 | def skia_glob(srcs): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 40 | """Replaces glob() with a version that accepts a struct. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 41 | |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 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 [] |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 53 | |
| 54 | ################################################################################ |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 55 | ## skia_{all,public}_hdrs() |
| 56 | ################################################################################ |
| 57 | def skia_all_hdrs(): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 58 | return native.glob([ |
| 59 | "src/**/*.h", |
| 60 | "include/**/*.h", |
| 61 | "third_party/**/*.h", |
| 62 | ]) |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 63 | |
| 64 | def skia_public_hdrs(): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 65 | return native.glob( |
| 66 | ["include/**/*.h"], |
| 67 | exclude = [ |
| 68 | "include/private/**/*", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 69 | ], |
| 70 | ) |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 71 | |
| 72 | ################################################################################ |
| 73 | ## skia_opts_srcs() |
| 74 | ################################################################################ |
| 75 | # Intel |
| 76 | SKIA_OPTS_SSE2 = "SSE2" |
| 77 | |
| 78 | SKIA_OPTS_SSSE3 = "SSSE3" |
| 79 | |
| 80 | SKIA_OPTS_SSE41 = "SSE41" |
| 81 | |
| 82 | SKIA_OPTS_SSE42 = "SSE42" |
| 83 | |
| 84 | SKIA_OPTS_AVX = "AVX" |
| 85 | |
Mike Klein | 33d077d | 2018-02-27 13:43:53 -0500 | [diff] [blame] | 86 | SKIA_OPTS_HSW = "HSW" |
| 87 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 88 | # Arm |
| 89 | SKIA_OPTS_NEON = "NEON" |
| 90 | |
| 91 | SKIA_OPTS_CRC32 = "CRC32" # arm64 |
| 92 | |
| 93 | def opts_srcs(opts): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 94 | if opts == SKIA_OPTS_SSE2: |
| 95 | return native.glob([ |
| 96 | "src/opts/*_SSE2.cpp", |
| 97 | "src/opts/*_sse2.cpp", # No matches currently. |
| 98 | ]) |
| 99 | elif opts == SKIA_OPTS_SSSE3: |
| 100 | return native.glob([ |
| 101 | "src/opts/*_SSSE3.cpp", |
| 102 | "src/opts/*_ssse3.cpp", |
| 103 | ]) |
| 104 | elif opts == SKIA_OPTS_SSE41: |
| 105 | return native.glob([ |
| 106 | "src/opts/*_sse41.cpp", |
| 107 | ]) |
| 108 | elif opts == SKIA_OPTS_SSE42: |
| 109 | return native.glob([ |
| 110 | "src/opts/*_sse42.cpp", |
| 111 | ]) |
| 112 | elif opts == SKIA_OPTS_AVX: |
| 113 | return native.glob([ |
| 114 | "src/opts/*_avx.cpp", |
| 115 | ]) |
| 116 | elif opts == SKIA_OPTS_HSW: |
| 117 | return native.glob([ |
| 118 | "src/opts/*_hsw.cpp", |
| 119 | ]) |
| 120 | elif opts == SKIA_OPTS_NEON: |
| 121 | return native.glob([ |
| 122 | "src/opts/*_neon.cpp", |
| 123 | ]) |
| 124 | elif opts == SKIA_OPTS_CRC32: |
| 125 | return native.glob([ |
| 126 | "src/opts/*_crc32.cpp", |
| 127 | ]) |
| 128 | else: |
| 129 | fail("skia_opts_srcs parameter 'opts' must be one of SKIA_OPTS_*.") |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 130 | |
| 131 | def opts_cflags(opts): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 132 | if opts == SKIA_OPTS_SSE2: |
| 133 | return ["-msse2"] |
| 134 | elif opts == SKIA_OPTS_SSSE3: |
| 135 | return ["-mssse3"] |
| 136 | elif opts == SKIA_OPTS_SSE41: |
| 137 | return ["-msse4.1"] |
| 138 | elif opts == SKIA_OPTS_SSE42: |
| 139 | return ["-msse4.2"] |
| 140 | elif opts == SKIA_OPTS_AVX: |
| 141 | return ["-mavx"] |
| 142 | elif opts == SKIA_OPTS_HSW: |
| 143 | return ["-mavx2", "-mf16c", "-mfma"] |
| 144 | elif opts == SKIA_OPTS_NEON: |
| 145 | return ["-mfpu=neon"] |
| 146 | elif opts == SKIA_OPTS_CRC32: |
| 147 | # NDK r11's Clang (3.8) doesn't pass along this -march setting correctly to an external |
| 148 | # assembler, so we do it manually with -Wa. This is just a bug, fixed in later Clangs. |
| 149 | return ["-march=armv8-a+crc", "-Wa,-march=armv8-a+crc"] |
| 150 | else: |
| 151 | return [] |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 152 | |
| 153 | SKIA_CPU_ARM = "ARM" |
| 154 | |
| 155 | SKIA_CPU_ARM64 = "ARM64" |
| 156 | |
| 157 | SKIA_CPU_X86 = "X86" |
| 158 | |
| 159 | SKIA_CPU_OTHER = "OTHER" |
| 160 | |
| 161 | def opts_rest_srcs(cpu): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 162 | srcs = [] |
| 163 | if cpu == SKIA_CPU_ARM or cpu == SKIA_CPU_ARM64: |
| 164 | srcs += native.glob([ |
| 165 | "src/opts/*_arm.cpp", |
| 166 | "src/opts/SkBitmapProcState_opts_none.cpp", |
| 167 | ]) |
| 168 | if cpu == SKIA_CPU_ARM64: |
| 169 | # NEON doesn't need special flags to compile on ARM64. |
| 170 | srcs += native.glob([ |
| 171 | "src/opts/*_neon.cpp", |
| 172 | ]) |
| 173 | elif cpu == SKIA_CPU_X86: |
| 174 | srcs += native.glob([ |
| 175 | "src/opts/*_x86.cpp", |
| 176 | ]) |
| 177 | elif cpu == SKIA_CPU_OTHER: |
| 178 | srcs += native.glob([ |
| 179 | "src/opts/*_none.cpp", |
| 180 | ]) |
| 181 | else: |
| 182 | fail("opts_rest_srcs parameter 'cpu' must be one of " + |
| 183 | "SKIA_CPU_{ARM,ARM64,X86,OTHER}.") |
| 184 | return srcs |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 185 | |
| 186 | def skia_opts_deps(cpu): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 187 | res = [":opts_rest"] |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 188 | |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 189 | if cpu == SKIA_CPU_ARM: |
| 190 | res += [":opts_neon"] |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 191 | |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 192 | if cpu == SKIA_CPU_ARM64: |
| 193 | res += [":opts_crc32"] |
Mike Klein | c29bb57 | 2017-10-24 11:40:41 -0400 | [diff] [blame] | 194 | |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 195 | if cpu == SKIA_CPU_X86: |
| 196 | res += [ |
| 197 | ":opts_sse2", |
| 198 | ":opts_ssse3", |
| 199 | ":opts_sse41", |
| 200 | ":opts_sse42", |
| 201 | ":opts_avx", |
| 202 | ":opts_hsw", |
| 203 | ] |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 204 | |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 205 | return res |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 206 | |
| 207 | ################################################################################ |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 208 | ## BASE_SRCS |
| 209 | ################################################################################ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 210 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 211 | # All platform-independent SRCS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 212 | BASE_SRCS_ALL = struct( |
| 213 | include = [ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 214 | "include/private/**/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 215 | "src/**/*.h", |
| 216 | "src/**/*.cpp", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 217 | "src/**/*.inc", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 218 | ], |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 219 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 220 | # Exclude platform-dependent files. |
Mike Klein | 9509e04 | 2019-05-15 21:57:48 +0000 | [diff] [blame] | 221 | "src/codec/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 222 | "src/device/xps/*", # Windows-only. Move to ports? |
| 223 | "src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
| 224 | "src/gpu/gl/android/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 225 | "src/gpu/gl/egl/*", |
benjaminwagner | af3b35e | 2016-03-28 13:27:28 -0700 | [diff] [blame] | 226 | "src/gpu/gl/glfw/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 227 | "src/gpu/gl/glx/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 228 | "src/gpu/gl/iOS/*", |
| 229 | "src/gpu/gl/mac/*", |
| 230 | "src/gpu/gl/win/*", |
| 231 | "src/opts/**/*", |
| 232 | "src/ports/**/*", |
| 233 | "src/utils/android/**/*", |
| 234 | "src/utils/mac/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 235 | "src/utils/win/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 236 | |
| 237 | # Exclude multiple definitions. |
Kevin Lubick | c921067 | 2018-10-15 11:36:55 -0400 | [diff] [blame] | 238 | "src/gpu/GrPathRendering_none.cpp", |
Kevin Lubick | 93faa67 | 2018-10-10 15:54:53 -0400 | [diff] [blame] | 239 | "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp", |
Kevin Lubick | c921067 | 2018-10-15 11:36:55 -0400 | [diff] [blame] | 240 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
| 241 | "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 242 | |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 243 | # Exclude files that don't compile everywhere. |
| 244 | "src/svg/**/*", # Depends on xml, SkJpegCodec, and SkPngCodec. |
| 245 | "src/xml/**/*", # Avoid dragging in expat when not needed. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 246 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 247 | # Conflicting dependencies among Lua versions. See cl/107087297. |
| 248 | "src/utils/SkLua*", |
| 249 | |
egdaniel | 32119f1 | 2016-02-22 10:07:54 -0800 | [diff] [blame] | 250 | # Currently exclude all vulkan specific files |
| 251 | "src/gpu/vk/*", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 252 | |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 253 | # Currently exclude all Dawn-specific files |
| 254 | "src/gpu/dawn/*", |
| 255 | |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 256 | # Defines main. |
| 257 | "src/sksl/SkSLMain.cpp", |
Ethan Nicholas | 8d7f4ae | 2017-09-07 11:07:42 -0400 | [diff] [blame] | 258 | |
| 259 | # Only used to regenerate the lexer |
| 260 | "src/sksl/lex/*", |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 261 | |
| 262 | # Atlas text |
| 263 | "src/atlastext/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 264 | ], |
| 265 | ) |
| 266 | |
Hal Canary | ce4693f | 2019-11-20 21:43:54 +0000 | [diff] [blame] | 267 | def codec_srcs(limited): |
| 268 | """Sources for the codecs. Excludes Raw, and Ico, Webp, and Png if limited.""" |
Ben Wagner | ec8c660 | 2018-10-26 12:31:36 -0400 | [diff] [blame] | 269 | |
Hal Canary | b5c217b | 2019-11-20 10:16:10 -0500 | [diff] [blame] | 270 | exclude = ["src/codec/*Raw*.cpp"] |
Hal Canary | ce4693f | 2019-11-20 21:43:54 +0000 | [diff] [blame] | 271 | if limited: |
| 272 | exclude += [ |
| 273 | "src/codec/*Ico*.cpp", |
| 274 | "src/codec/*Webp*.cpp", |
| 275 | "src/codec/*Png*", |
| 276 | ] |
Hal Canary | b5c217b | 2019-11-20 10:16:10 -0500 | [diff] [blame] | 277 | return native.glob(["src/codec/*.cpp"], exclude = exclude) |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 278 | |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 279 | GL_SRCS_UNIX = struct( |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 280 | include = [ |
Brian Salomon | b3ce76e | 2017-12-11 15:21:39 -0500 | [diff] [blame] | 281 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 282 | ], |
| 283 | exclude = [], |
| 284 | ) |
| 285 | PORTS_SRCS_UNIX = struct( |
| 286 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 287 | "src/ports/**/*.cpp", |
| 288 | "src/ports/**/*.h", |
| 289 | ], |
| 290 | exclude = [ |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 291 | "src/ports/*CG*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 292 | "src/ports/*WIC*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 293 | "src/ports/*android*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 294 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 295 | "src/ports/*mac*", |
| 296 | "src/ports/*mozalloc*", |
| 297 | "src/ports/*nacl*", |
| 298 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 299 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 300 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 301 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 302 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 303 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 304 | "src/ports/SkFontMgr_fuchsia.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 305 | "src/ports/SkImageGenerator_none.cpp", |
| 306 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 307 | ], |
| 308 | ) |
| 309 | |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 310 | GL_SRCS_ANDROID = struct( |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 311 | include = [ |
Ben Wagner | 773151f | 2018-08-17 09:28:53 -0400 | [diff] [blame] | 312 | "src/gpu/gl/android/*.cpp", |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 313 | ], |
| 314 | exclude = [], |
| 315 | ) |
| 316 | PORTS_SRCS_ANDROID = struct( |
| 317 | include = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 318 | "src/ports/**/*.cpp", |
| 319 | "src/ports/**/*.h", |
| 320 | ], |
| 321 | exclude = [ |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 322 | "src/ports/*CG*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 323 | "src/ports/*FontConfig*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 324 | "src/ports/*WIC*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 325 | "src/ports/*chromium*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 326 | "src/ports/*fontconfig*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 327 | "src/ports/*mac*", |
| 328 | "src/ports/*mozalloc*", |
| 329 | "src/ports/*nacl*", |
| 330 | "src/ports/*win*", |
| 331 | "src/ports/SkDebug_stdio.cpp", |
| 332 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 333 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 334 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 335 | "src/ports/SkFontMgr_empty_factory.cpp", |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 336 | "src/ports/SkFontMgr_fuchsia.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 337 | "src/ports/SkImageGenerator_none.cpp", |
| 338 | "src/ports/SkTLS_none.cpp", |
| 339 | ], |
| 340 | ) |
| 341 | |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 342 | GL_SRCS_IOS = struct( |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 343 | include = [ |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 344 | "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp", |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 345 | ], |
| 346 | exclude = [], |
| 347 | ) |
| 348 | PORTS_SRCS_IOS = struct( |
| 349 | include = [ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 350 | "src/ports/**/*.cpp", |
| 351 | "src/ports/**/*.h", |
iroth | ab669de | 2016-02-16 19:17:01 -0800 | [diff] [blame] | 352 | "src/utils/mac/*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 353 | ], |
| 354 | exclude = [ |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 355 | "src/ports/*FontConfig*", |
| 356 | "src/ports/*FreeType*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 357 | "src/ports/*WIC*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 358 | "src/ports/*android*", |
| 359 | "src/ports/*chromium*", |
| 360 | "src/ports/*fontconfig*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 361 | "src/ports/*mozalloc*", |
| 362 | "src/ports/*nacl*", |
| 363 | "src/ports/*win*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 364 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 365 | "src/ports/SkFontMgr_custom_directory.cpp", |
| 366 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 367 | "src/ports/SkFontMgr_custom_empty.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 368 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 369 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 370 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 371 | "src/ports/SkFontMgr_empty_factory.cpp", |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 372 | "src/ports/SkFontMgr_fuchsia.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 373 | "src/ports/SkImageGenerator_none.cpp", |
| 374 | "src/ports/SkTLS_none.cpp", |
| 375 | ], |
| 376 | ) |
| 377 | |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 378 | def base_srcs(): |
| 379 | return skia_glob(BASE_SRCS_ALL) |
| 380 | |
| 381 | def ports_srcs(os_conditions): |
Mike Klein | 299ea7b | 2019-03-27 13:53:08 -0500 | [diff] [blame] | 382 | return skia_select( |
| 383 | os_conditions, |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 384 | [ |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 385 | skia_glob(PORTS_SRCS_UNIX), |
| 386 | skia_glob(PORTS_SRCS_ANDROID), |
| 387 | skia_glob(PORTS_SRCS_IOS), |
Mike Klein | 299ea7b | 2019-03-27 13:53:08 -0500 | [diff] [blame] | 388 | ], |
| 389 | ) |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 390 | |
| 391 | def gl_srcs(os_conditions): |
Mike Klein | 299ea7b | 2019-03-27 13:53:08 -0500 | [diff] [blame] | 392 | return skia_select( |
| 393 | os_conditions, |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 394 | [ |
| 395 | skia_glob(GL_SRCS_UNIX), |
| 396 | skia_glob(GL_SRCS_ANDROID), |
| 397 | skia_glob(GL_SRCS_IOS), |
Mike Klein | 299ea7b | 2019-03-27 13:53:08 -0500 | [diff] [blame] | 398 | ], |
| 399 | ) |
Mike Klein | 7f95c29 | 2019-03-27 11:16:25 -0500 | [diff] [blame] | 400 | |
| 401 | def skia_srcs(os_conditions): |
| 402 | return base_srcs() + ports_srcs(os_conditions) + gl_srcs(os_conditions) |
| 403 | |
Hal Canary | 6ad6c50 | 2019-12-11 14:09:16 -0500 | [diff] [blame] | 404 | def metal_objc_srcs(): |
| 405 | return native.glob( |
| 406 | [ |
| 407 | "include/**/*.h", |
| 408 | "src/**/*.h", |
| 409 | "src/gpu/mtl/**/*.mm", |
| 410 | "third_party/**/*.h", |
Ben Wagner | 8718be9 | 2019-12-11 20:11:30 -0500 | [diff] [blame] | 411 | ], |
Hal Canary | 6ad6c50 | 2019-12-11 14:09:16 -0500 | [diff] [blame] | 412 | ) + [ |
| 413 | "src/image/SkSurface_GpuMtl.mm", |
| 414 | ] |
| 415 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 416 | ################################################################################ |
| 417 | ## INCLUDES |
| 418 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 419 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 420 | # Includes needed by Skia implementation. Not public includes. |
| 421 | INCLUDES = [ |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 422 | ".", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 423 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 424 | "include/c", |
| 425 | "include/codec", |
| 426 | "include/config", |
| 427 | "include/core", |
Ben Wagner | cc62b5d | 2018-09-20 16:26:31 -0400 | [diff] [blame] | 428 | "include/docs", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 429 | "include/effects", |
Matt Sarett | d7093c2 | 2017-05-09 15:28:32 -0400 | [diff] [blame] | 430 | "include/encode", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 431 | "include/gpu", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 432 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 433 | "include/ports", |
| 434 | "include/private", |
Brian Osman | ea236bf | 2019-04-29 10:28:22 -0400 | [diff] [blame] | 435 | "include/third_party/skcms", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 436 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 437 | "include/utils/mac", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 438 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 439 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 440 | "src/gpu", |
| 441 | "src/image", |
Mike Klein | 135a1b1 | 2017-08-15 13:13:59 -0400 | [diff] [blame] | 442 | "src/images", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 443 | "src/lazy", |
| 444 | "src/opts", |
| 445 | "src/pdf", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 446 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 447 | "src/sfnt", |
Florin Malita | 5edba45 | 2017-05-30 16:39:47 -0400 | [diff] [blame] | 448 | "src/shaders", |
Michael Ludwig | 4f94ef6 | 2018-09-12 15:22:16 -0400 | [diff] [blame] | 449 | "src/shaders/gradients", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 450 | "src/sksl", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 451 | "src/utils", |
Ben Wagner | d0a3b06 | 2016-10-24 14:11:12 -0400 | [diff] [blame] | 452 | "third_party/gif", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 453 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 454 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 455 | ################################################################################ |
| 456 | ## DM_SRCS |
| 457 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 458 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 459 | DM_SRCS_ALL = struct( |
| 460 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 461 | "dm/*.cpp", |
| 462 | "dm/*.h", |
Mike Klein | 60900b5 | 2018-09-21 11:19:45 -0400 | [diff] [blame] | 463 | "experimental/pipe/*.cpp", |
| 464 | "experimental/pipe/*.h", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 465 | "experimental/svg/model/*.cpp", |
| 466 | "experimental/svg/model/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 467 | "gm/*.cpp", |
| 468 | "gm/*.h", |
Nathaniel Nifong | 0426c38 | 2019-06-21 11:09:19 -0400 | [diff] [blame] | 469 | "src/utils/SkMultiPictureDocument.cpp", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 470 | "src/xml/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 471 | "tests/*.cpp", |
| 472 | "tests/*.h", |
Jim Van Verth | 8a9a371 | 2019-05-31 10:49:12 -0400 | [diff] [blame] | 473 | "tools/AutoreleasePool.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 474 | "tools/BigPathBench.inc", |
Hal Canary | e574f1e | 2019-07-15 14:01:37 -0400 | [diff] [blame] | 475 | "tools/BinaryAsset.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 476 | "tools/CrashHandler.cpp", |
| 477 | "tools/CrashHandler.h", |
Robert Phillips | e61ba84 | 2018-05-30 08:27:26 -0400 | [diff] [blame] | 478 | "tools/DDLPromiseImageHelper.cpp", |
| 479 | "tools/DDLPromiseImageHelper.h", |
| 480 | "tools/DDLTileHelper.cpp", |
| 481 | "tools/DDLTileHelper.h", |
Mike Klein | b61e25b | 2019-03-27 10:51:28 -0500 | [diff] [blame] | 482 | "tools/HashAndEncode.cpp", |
| 483 | "tools/HashAndEncode.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 484 | "tools/ProcStats.cpp", |
| 485 | "tools/ProcStats.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 486 | "tools/Registry.h", |
| 487 | "tools/ResourceFactory.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 488 | "tools/Resources.cpp", |
| 489 | "tools/Resources.h", |
Hal Canary | e574f1e | 2019-07-15 14:01:37 -0400 | [diff] [blame] | 490 | "tools/SkMetaData.cpp", |
| 491 | "tools/SkMetaData.h", |
| 492 | "tools/SkSharingProc.cpp", |
Mike Klein | a4bb020 | 2019-06-04 13:40:15 -0500 | [diff] [blame] | 493 | "tools/SkVMBuilders.cpp", |
| 494 | "tools/SkVMBuilders.h", |
Hal Canary | e574f1e | 2019-07-15 14:01:37 -0400 | [diff] [blame] | 495 | "tools/ToolUtils.cpp", |
| 496 | "tools/ToolUtils.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 497 | "tools/UrlDataManager.cpp", |
| 498 | "tools/UrlDataManager.h", |
| 499 | "tools/debugger/*.cpp", |
| 500 | "tools/debugger/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 501 | "tools/flags/*.cpp", |
| 502 | "tools/flags/*.h", |
Mike Klein | 0cffcbf9 | 2019-03-20 11:08:46 -0500 | [diff] [blame] | 503 | "tools/fonts/RandomScalerContext.cpp", |
| 504 | "tools/fonts/RandomScalerContext.h", |
| 505 | "tools/fonts/TestFontMgr.cpp", |
| 506 | "tools/fonts/TestFontMgr.h", |
| 507 | "tools/fonts/TestSVGTypeface.cpp", |
| 508 | "tools/fonts/TestSVGTypeface.h", |
| 509 | "tools/fonts/TestTypeface.cpp", |
| 510 | "tools/fonts/TestTypeface.h", |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 511 | "tools/fonts/ToolUtilsFont.cpp", |
Hal Canary | e574f1e | 2019-07-15 14:01:37 -0400 | [diff] [blame] | 512 | "tools/fonts/test_font_index.inc", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 513 | "tools/fonts/test_font_monospace.inc", |
| 514 | "tools/fonts/test_font_sans_serif.inc", |
| 515 | "tools/fonts/test_font_serif.inc", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 516 | "tools/gpu/**/*.cpp", |
| 517 | "tools/gpu/**/*.h", |
Hal Canary | e574f1e | 2019-07-15 14:01:37 -0400 | [diff] [blame] | 518 | "tools/ios_utils.h", |
mtklein | e1fc452 | 2016-02-09 12:32:52 -0800 | [diff] [blame] | 519 | "tools/random_parse_path.cpp", |
| 520 | "tools/random_parse_path.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 521 | "tools/timer/*.cpp", |
| 522 | "tools/timer/*.h", |
Brian Salomon | 40d0119 | 2017-07-19 13:05:11 -0400 | [diff] [blame] | 523 | "tools/trace/*.cpp", |
| 524 | "tools/trace/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 525 | ], |
| 526 | exclude = [ |
Mike Klein | db53760 | 2018-06-01 11:01:11 -0400 | [diff] [blame] | 527 | "gm/cgms.cpp", |
Mike Klein | c4abade | 2019-08-09 10:11:35 -0400 | [diff] [blame] | 528 | "gm/fiddle.cpp", |
Mike Reed | 7bf160e | 2019-05-17 16:50:51 -0400 | [diff] [blame] | 529 | "gm/video_decoder.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 530 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
Ben Wagner | 37a06c0 | 2018-06-22 21:11:00 +0000 | [diff] [blame] | 531 | "tests/FontMgrFontConfigTest.cpp", # FontConfig-only. |
Julia Lavrova | f0ade8a | 2019-11-08 12:58:57 -0500 | [diff] [blame] | 532 | "tests/SkParagraphTest.cpp", # Skipping tests for now. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 533 | "tests/skia_test.cpp", # Old main. |
Brian Salomon | f9ec470 | 2017-11-19 14:46:36 -0500 | [diff] [blame] | 534 | "tools/gpu/atlastext/*", |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 535 | "tools/gpu/dawn/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 536 | "tools/gpu/gl/angle/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 537 | "tools/gpu/gl/egl/*", |
| 538 | "tools/gpu/gl/glx/*", |
| 539 | "tools/gpu/gl/iOS/*", |
| 540 | "tools/gpu/gl/mac/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 541 | "tools/gpu/gl/win/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 542 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 543 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 544 | ], |
| 545 | ) |
| 546 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 547 | ################################################################################ |
| 548 | ## dm_srcs() |
| 549 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 550 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 551 | def dm_srcs(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 552 | """Sources for the dm binary for the specified os.""" |
| 553 | return skia_glob(DM_SRCS_ALL) + skia_select( |
| 554 | os_conditions, |
| 555 | [ |
Ben Wagner | c5ee499 | 2019-03-25 15:58:31 -0400 | [diff] [blame] | 556 | ["tests/FontMgrFontConfigTest.cpp"], |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 557 | ["tests/FontMgrAndroidParserTest.cpp"], |
| 558 | [], |
| 559 | ], |
| 560 | ) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 561 | |
| 562 | ################################################################################ |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 563 | ## DM_ARGS |
| 564 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 565 | |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 566 | def DM_ARGS(asan): |
Mike Klein | dd650c4 | 2018-11-08 14:26:02 -0500 | [diff] [blame] | 567 | source = ["gm", "image", "lottie"] |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 568 | |
| 569 | # TODO(benjaminwagner): f16, pic-8888, serialize-8888, and tiles_rt-8888 fail. |
| 570 | config = ["565", "8888", "pdf"] |
| 571 | match = ["~Codec_78329453"] |
| 572 | return (["--src"] + source + ["--config"] + config + ["--nonativeFonts"] + |
| 573 | ["--match"] + match) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 574 | |
| 575 | ################################################################################ |
| 576 | ## COPTS |
| 577 | ################################################################################ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 578 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 579 | def base_copts(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 580 | return skia_select( |
| 581 | os_conditions, |
| 582 | [ |
| 583 | # UNIX |
| 584 | [ |
| 585 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
| 586 | # Internal use of deprecated methods. :( |
| 587 | "-Wno-deprecated-declarations", |
| 588 | # TODO(kjlubick) |
| 589 | "-Wno-self-assign", # Spurious warning in tests/PathOpsDVectorTest.cpp? |
| 590 | ], |
| 591 | # ANDROID |
| 592 | [ |
Mike Klein | 9b7e99e | 2018-08-22 16:45:11 -0400 | [diff] [blame] | 593 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 594 | # 'GrResourceCache' declared with greater visibility than the |
| 595 | # type of its field 'GrResourceCache::fPurgeableQueue'... bogus. |
| 596 | "-Wno-error=attributes", |
| 597 | ], |
| 598 | # IOS |
Benjamin Barenblat | fd10d17 | 2018-07-31 16:41:37 -0400 | [diff] [blame] | 599 | [ |
| 600 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
| 601 | ], |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 602 | ], |
| 603 | ) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 604 | |
| 605 | ################################################################################ |
| 606 | ## DEFINES |
| 607 | ################################################################################ |
| 608 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 609 | def base_defines(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 610 | return [ |
| 611 | # Chrome DEFINES. |
| 612 | "SK_USE_FREETYPE_EMBOLDEN", |
| 613 | # Turn on a few Google3-specific build fixes. |
| 614 | "SK_BUILD_FOR_GOOGLE3", |
| 615 | # Required for building dm. |
| 616 | "GR_TEST_UTILS", |
Robert Phillips | 6db27c2 | 2019-05-01 10:43:56 -0400 | [diff] [blame] | 617 | # Google3 probably doesn't want this feature yet |
| 618 | "SK_DISABLE_REDUCE_OPLIST_SPLITTING", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 619 | # Staging flags for API changes |
| 620 | # Should remove after we update golden images |
| 621 | "SK_WEBP_ENCODER_USE_DEFAULT_METHOD", |
| 622 | # Experiment to diagnose image diffs in Google3 |
Mike Klein | 0ade68c | 2018-10-24 06:52:35 -0400 | [diff] [blame] | 623 | "SK_DISABLE_LOWP_RASTER_PIPELINE", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 624 | # JPEG is in codec_limited |
| 625 | "SK_HAS_JPEG_LIBRARY", |
Brian Osman | 489cf88 | 2019-07-09 10:48:28 -0400 | [diff] [blame] | 626 | # Needed for some tests in dm |
| 627 | "SK_ENABLE_SKSL_INTERPRETER", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 628 | ] + skia_select( |
| 629 | os_conditions, |
| 630 | [ |
| 631 | # UNIX |
| 632 | [ |
| 633 | "PNG_SKIP_SETJMP_CHECK", |
| 634 | "SK_BUILD_FOR_UNIX", |
Mike Klein | f0a5369 | 2019-04-24 11:42:40 -0500 | [diff] [blame] | 635 | "SK_R32_SHIFT=16", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 636 | "SK_HAS_PNG_LIBRARY", |
| 637 | "SK_HAS_WEBP_LIBRARY", |
| 638 | ], |
| 639 | # ANDROID |
| 640 | [ |
| 641 | "SK_BUILD_FOR_ANDROID", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 642 | "SK_HAS_PNG_LIBRARY", |
| 643 | "SK_HAS_WEBP_LIBRARY", |
| 644 | ], |
| 645 | # IOS |
| 646 | [ |
| 647 | "SK_BUILD_FOR_IOS", |
| 648 | "SK_BUILD_NO_OPTS", |
| 649 | "SKNX_NO_SIMD", |
| 650 | ], |
| 651 | ], |
| 652 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 653 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 654 | ################################################################################ |
| 655 | ## LINKOPTS |
| 656 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 657 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 658 | def base_linkopts(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 659 | return [ |
| 660 | "-ldl", |
| 661 | ] + skia_select( |
| 662 | os_conditions, |
| 663 | [ |
| 664 | # UNIX |
| 665 | [], |
| 666 | # ANDROID |
| 667 | [ |
| 668 | "-lEGL", |
Ben Wagner | 773151f | 2018-08-17 09:28:53 -0400 | [diff] [blame] | 669 | "-lGLESv2", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 670 | ], |
| 671 | # IOS |
| 672 | [ |
| 673 | "-framework CoreFoundation", |
| 674 | "-framework CoreGraphics", |
| 675 | "-framework CoreText", |
| 676 | "-framework ImageIO", |
| 677 | "-framework MobileCoreServices", |
| 678 | ], |
| 679 | ], |
| 680 | ) |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 681 | |
| 682 | ################################################################################ |
Florin Malita | e4e9551 | 2019-05-03 14:03:50 -0400 | [diff] [blame] | 683 | ## sksg_lib |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 684 | ################################################################################ |
| 685 | |
Florin Malita | e4e9551 | 2019-05-03 14:03:50 -0400 | [diff] [blame] | 686 | def sksg_lib_hdrs(): |
| 687 | return native.glob(["modules/sksg/include/*.h"]) |
| 688 | |
| 689 | def sksg_lib_srcs(): |
Florin Malita | ccacfa0 | 2019-07-10 13:38:48 -0400 | [diff] [blame] | 690 | return native.glob([ |
| 691 | "modules/sksg/src/*.cpp", |
| 692 | "modules/sksg/src/*.h", |
| 693 | ]) |
Florin Malita | e4e9551 | 2019-05-03 14:03:50 -0400 | [diff] [blame] | 694 | |
| 695 | ################################################################################ |
Julia Lavrova | 5ec1b8f | 2019-06-10 11:10:17 -0400 | [diff] [blame] | 696 | ## skparagraph_lib |
| 697 | ################################################################################ |
| 698 | |
| 699 | def skparagraph_lib_hdrs(): |
| 700 | return native.glob(["modules/skparagraph/include/*.h"]) |
| 701 | |
| 702 | def skparagraph_lib_srcs(): |
| 703 | return native.glob(["modules/skparagraph/src/*.cpp"]) |
| 704 | |
| 705 | ################################################################################ |
Mike Reed | daf1945 | 2019-06-11 17:20:33 -0400 | [diff] [blame] | 706 | ## experimental xform |
| 707 | ################################################################################ |
| 708 | |
| 709 | def exp_xform_lib_hdrs(): |
| 710 | return native.glob(["experimental/xform/*.h"]) |
| 711 | |
| 712 | def exp_xform_lib_srcs(): |
| 713 | return native.glob(["experimental/xform/*.cpp"]) |
| 714 | |
| 715 | ################################################################################ |
Hal Canary | 484384b | 2019-12-17 10:50:26 -0500 | [diff] [blame] | 716 | ## skresources_lib |
| 717 | ################################################################################ |
| 718 | |
| 719 | def skresources_lib_hdrs(): |
| 720 | return ["modules/skresources/include/SkResources.h"] |
| 721 | |
| 722 | def skresources_lib_srcs(): |
| 723 | return ["modules/skresources/src/SkResources.cpp"] |
| 724 | |
| 725 | ################################################################################ |
Florin Malita | e4e9551 | 2019-05-03 14:03:50 -0400 | [diff] [blame] | 726 | ## skottie_lib |
| 727 | ################################################################################ |
| 728 | |
| 729 | def skottie_lib_hdrs(): |
Florin Malita | 1b1b657 | 2019-05-03 15:16:30 -0400 | [diff] [blame] | 730 | return native.glob(["modules/skottie/include/*.h"]) |
Florin Malita | e4e9551 | 2019-05-03 14:03:50 -0400 | [diff] [blame] | 731 | |
| 732 | def skottie_lib_srcs(): |
| 733 | return native.glob( |
| 734 | [ |
| 735 | "modules/skottie/src/*.cpp", |
| 736 | "modules/skottie/src/*.h", |
Florin Malita | e47d8af | 2019-06-14 12:20:10 -0400 | [diff] [blame] | 737 | "modules/skottie/src/effects/*.cpp", |
| 738 | "modules/skottie/src/effects/*.h", |
Florin Malita | 45dc1f0 | 2019-07-01 13:57:43 -0400 | [diff] [blame] | 739 | "modules/skottie/src/layers/*.cpp", |
| 740 | "modules/skottie/src/layers/*.h", |
Florin Malita | ca449d5 | 2019-05-08 10:04:09 -0400 | [diff] [blame] | 741 | "modules/skottie/src/text/*.cpp", |
| 742 | "modules/skottie/src/text/*.h", |
Florin Malita | e4e9551 | 2019-05-03 14:03:50 -0400 | [diff] [blame] | 743 | ], |
| 744 | exclude = [ |
| 745 | "modules/skottie/src/SkottieTest.cpp", |
| 746 | "modules/skottie/src/SkottieTool.cpp", |
| 747 | ], |
| 748 | ) |
| 749 | |
| 750 | ################################################################################ |
| 751 | ## skottie_shaper |
| 752 | ################################################################################ |
| 753 | |
| 754 | SKOTTIE_SHAPER_HDRS = [ |
Florin Malita | ca449d5 | 2019-05-08 10:04:09 -0400 | [diff] [blame] | 755 | "modules/skottie/src/text/SkottieShaper.h", |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 756 | ] |
| 757 | |
Florin Malita | e4e9551 | 2019-05-03 14:03:50 -0400 | [diff] [blame] | 758 | SKOTTIE_SHAPER_SRCS = [ |
Florin Malita | ca449d5 | 2019-05-08 10:04:09 -0400 | [diff] [blame] | 759 | "modules/skottie/src/text/SkottieShaper.cpp", |
Florin Malita | e4e9551 | 2019-05-03 14:03:50 -0400 | [diff] [blame] | 760 | ] |
| 761 | |
| 762 | ################################################################################ |
| 763 | ## skottie_tool |
| 764 | ################################################################################ |
| 765 | |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 766 | SKOTTIE_TOOL_SRCS = [ |
| 767 | "modules/skottie/src/SkottieTool.cpp", |
Brian Osman | 849f4d6 | 2019-11-26 08:58:26 -0500 | [diff] [blame] | 768 | "modules/skresources/src/SkResources.cpp", |
| 769 | "modules/skresources/include/SkResources.h", |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 770 | # TODO(benjaminwagner): Add "flags" target. |
Mike Klein | 88544fb | 2019-03-20 10:50:33 -0500 | [diff] [blame] | 771 | "tools/flags/CommandLineFlags.cpp", |
| 772 | "tools/flags/CommandLineFlags.h", |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 773 | ] |
Florin Malita | 6d415bc | 2019-01-17 16:42:15 -0500 | [diff] [blame] | 774 | |
| 775 | ################################################################################ |
| 776 | ## SkShaper |
| 777 | ################################################################################ |
| 778 | |
Florin Malita | 226ba98 | 2019-01-21 11:55:51 -0500 | [diff] [blame] | 779 | SKSHAPER_HARFBUZZ_SRCS = [ |
Florin Malita | 6d415bc | 2019-01-17 16:42:15 -0500 | [diff] [blame] | 780 | "modules/skshaper/include/SkShaper.h", |
| 781 | "modules/skshaper/src/SkShaper.cpp", |
| 782 | "modules/skshaper/src/SkShaper_harfbuzz.cpp", |
Hal Canary | 30c9eda | 2019-02-22 15:23:45 -0500 | [diff] [blame] | 783 | "modules/skshaper/src/SkShaper_primitive.cpp", |
Florin Malita | 6d415bc | 2019-01-17 16:42:15 -0500 | [diff] [blame] | 784 | ] |
Florin Malita | 226ba98 | 2019-01-21 11:55:51 -0500 | [diff] [blame] | 785 | |
| 786 | SKSHAPER_PRIMITIVE_SRCS = [ |
| 787 | "modules/skshaper/include/SkShaper.h", |
| 788 | "modules/skshaper/src/SkShaper.cpp", |
| 789 | "modules/skshaper/src/SkShaper_primitive.cpp", |
| 790 | ] |
Hal Canary | b56b554 | 2019-12-19 09:48:28 -0500 | [diff] [blame] | 791 | |
| 792 | ################################################################################ |
| 793 | ## skottie_ios_lib |
| 794 | ################################################################################ |
| 795 | |
| 796 | SKOTTIE_IOS_LIB_SRCS = [ |
Hal Canary | 118df7c | 2019-12-18 16:26:19 -0500 | [diff] [blame] | 797 | "tools/skottie_ios_app/SkiaContext.mm", |
| 798 | "tools/skottie_ios_app/SkiaUIContext.mm", |
| 799 | "tools/skottie_ios_app/SkiaViewController.mm", |
| 800 | "tools/skottie_ios_app/SkottieViewController.mm", |
Hal Canary | b56b554 | 2019-12-19 09:48:28 -0500 | [diff] [blame] | 801 | ] |
| 802 | |
| 803 | SKOTTIE_IOS_LIB_HDRS = [ |
Hal Canary | 118df7c | 2019-12-18 16:26:19 -0500 | [diff] [blame] | 804 | "tools/skottie_ios_app/SkiaContext.h", |
| 805 | "tools/skottie_ios_app/SkiaViewController.h", |
| 806 | "tools/skottie_ios_app/SkottieViewController.h", |
Hal Canary | b56b554 | 2019-12-19 09:48:28 -0500 | [diff] [blame] | 807 | ] |
Hal Canary | 76cc2c5 | 2020-01-07 12:39:13 -0500 | [diff] [blame] | 808 | |
| 809 | SKOTTIE_IOS_LIB_SDK_FRAMEWORKS = [ |
| 810 | "Foundation", |
| 811 | "UIKit", |
| 812 | ] |