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. |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [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 | 8014c48 | 2018-10-18 11:05:21 -0400 | [diff] [blame] | 238 | "src/core/SkPicture_none.cpp", |
Kevin Lubick | c921067 | 2018-10-15 11:36:55 -0400 | [diff] [blame] | 239 | "src/gpu/GrPathRendering_none.cpp", |
Kevin Lubick | 93faa67 | 2018-10-10 15:54:53 -0400 | [diff] [blame] | 240 | "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp", |
Kevin Lubick | c921067 | 2018-10-15 11:36:55 -0400 | [diff] [blame] | 241 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
| 242 | "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 243 | |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 244 | # Exclude files that don't compile everywhere. |
| 245 | "src/svg/**/*", # Depends on xml, SkJpegCodec, and SkPngCodec. |
| 246 | "src/xml/**/*", # Avoid dragging in expat when not needed. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 247 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 248 | # Conflicting dependencies among Lua versions. See cl/107087297. |
| 249 | "src/utils/SkLua*", |
| 250 | |
egdaniel | 32119f1 | 2016-02-22 10:07:54 -0800 | [diff] [blame] | 251 | # Currently exclude all vulkan specific files |
| 252 | "src/gpu/vk/*", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 253 | |
| 254 | # Defines main. |
| 255 | "src/sksl/SkSLMain.cpp", |
Ethan Nicholas | 8d7f4ae | 2017-09-07 11:07:42 -0400 | [diff] [blame] | 256 | |
| 257 | # Only used to regenerate the lexer |
| 258 | "src/sksl/lex/*", |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 259 | |
| 260 | # Atlas text |
| 261 | "src/atlastext/*", |
Mike Klein | 83ee463 | 2018-03-27 13:22:50 -0400 | [diff] [blame] | 262 | |
Mike Klein | b056e7f | 2018-06-20 09:44:59 -0400 | [diff] [blame] | 263 | # Compute backend not yet even hooked into Skia. |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 264 | "src/compute/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 265 | ], |
| 266 | ) |
| 267 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 268 | def codec_srcs(limited): |
Mike Klein | 5d58d09 | 2018-11-08 09:11:43 -0500 | [diff] [blame] | 269 | """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] | 270 | |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 271 | # TODO: Enable wuffs in Google3 |
Mike Klein | 5d58d09 | 2018-11-08 09:11:43 -0500 | [diff] [blame] | 272 | exclude = ["src/codec/SkWuffsCodec.cpp", "src/codec/*Raw*.cpp"] |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 273 | if limited: |
| 274 | exclude += [ |
| 275 | "src/codec/*Ico*.cpp", |
| 276 | "src/codec/*Webp*.cpp", |
| 277 | "src/codec/*Png*", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 278 | ] |
Mike Klein | 4991cd3 | 2018-11-07 08:46:29 -0500 | [diff] [blame] | 279 | return native.glob(["src/codec/*.cpp", "third_party/gif/*.cpp"], exclude = exclude) |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 280 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 281 | # Platform-dependent SRCS for google3-default platform. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 282 | BASE_SRCS_UNIX = struct( |
| 283 | include = [ |
Brian Salomon | b3ce76e | 2017-12-11 15:21:39 -0500 | [diff] [blame] | 284 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 285 | "src/ports/**/*.cpp", |
| 286 | "src/ports/**/*.h", |
| 287 | ], |
| 288 | exclude = [ |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 289 | "src/ports/*CG*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 290 | "src/ports/*WIC*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 291 | "src/ports/*android*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 292 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 293 | "src/ports/*mac*", |
| 294 | "src/ports/*mozalloc*", |
| 295 | "src/ports/*nacl*", |
| 296 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 297 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 298 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 299 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 300 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 404816e | 2015-12-03 05:04:03 -0800 | [diff] [blame] | 301 | "src/ports/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 302 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 303 | "src/ports/SkImageGenerator_none.cpp", |
| 304 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 305 | ], |
| 306 | ) |
| 307 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 308 | # Platform-dependent SRCS for google3-default Android. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 309 | BASE_SRCS_ANDROID = struct( |
| 310 | include = [ |
Ben Wagner | 773151f | 2018-08-17 09:28:53 -0400 | [diff] [blame] | 311 | "src/gpu/gl/android/*.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 312 | "src/ports/**/*.cpp", |
| 313 | "src/ports/**/*.h", |
| 314 | ], |
| 315 | exclude = [ |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 316 | "src/ports/*CG*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 317 | "src/ports/*FontConfig*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 318 | "src/ports/*WIC*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 319 | "src/ports/*chromium*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 320 | "src/ports/*fontconfig*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 321 | "src/ports/*mac*", |
| 322 | "src/ports/*mozalloc*", |
| 323 | "src/ports/*nacl*", |
| 324 | "src/ports/*win*", |
| 325 | "src/ports/SkDebug_stdio.cpp", |
| 326 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 327 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 328 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 329 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 330 | "src/ports/SkImageGenerator_none.cpp", |
| 331 | "src/ports/SkTLS_none.cpp", |
| 332 | ], |
| 333 | ) |
| 334 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 335 | # Platform-dependent SRCS for google3-default iOS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 336 | BASE_SRCS_IOS = struct( |
| 337 | include = [ |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 338 | "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 339 | "src/ports/**/*.cpp", |
| 340 | "src/ports/**/*.h", |
iroth | ab669de | 2016-02-16 19:17:01 -0800 | [diff] [blame] | 341 | "src/utils/mac/*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 342 | ], |
| 343 | exclude = [ |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 344 | "src/ports/*FontConfig*", |
| 345 | "src/ports/*FreeType*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 346 | "src/ports/*WIC*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 347 | "src/ports/*android*", |
| 348 | "src/ports/*chromium*", |
| 349 | "src/ports/*fontconfig*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 350 | "src/ports/*mozalloc*", |
| 351 | "src/ports/*nacl*", |
| 352 | "src/ports/*win*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 353 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 354 | "src/ports/SkFontMgr_custom_directory.cpp", |
| 355 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 356 | "src/ports/SkFontMgr_custom_empty.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 357 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 358 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 359 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 360 | "src/ports/SkFontMgr_empty_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 361 | "src/ports/SkImageGenerator_none.cpp", |
| 362 | "src/ports/SkTLS_none.cpp", |
| 363 | ], |
| 364 | ) |
| 365 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 366 | ################################################################################ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 367 | ## skia_srcs() |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 368 | ################################################################################ |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 369 | def skia_srcs(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 370 | """Sources to be compiled into the skia library.""" |
| 371 | return skia_glob(BASE_SRCS_ALL) + skia_select( |
| 372 | os_conditions, |
| 373 | [ |
| 374 | skia_glob(BASE_SRCS_UNIX), |
| 375 | skia_glob(BASE_SRCS_ANDROID), |
| 376 | skia_glob(BASE_SRCS_IOS), |
| 377 | ], |
| 378 | ) |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 379 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 380 | ################################################################################ |
| 381 | ## INCLUDES |
| 382 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 383 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 384 | # Includes needed by Skia implementation. Not public includes. |
| 385 | INCLUDES = [ |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 386 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 387 | "include/c", |
| 388 | "include/codec", |
| 389 | "include/config", |
| 390 | "include/core", |
Ben Wagner | cc62b5d | 2018-09-20 16:26:31 -0400 | [diff] [blame] | 391 | "include/docs", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 392 | "include/effects", |
Matt Sarett | d7093c2 | 2017-05-09 15:28:32 -0400 | [diff] [blame] | 393 | "include/encode", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 394 | "include/gpu", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 395 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 396 | "include/ports", |
| 397 | "include/private", |
| 398 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 399 | "include/utils/mac", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 400 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 401 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 402 | "src/gpu", |
| 403 | "src/image", |
Mike Klein | 135a1b1 | 2017-08-15 13:13:59 -0400 | [diff] [blame] | 404 | "src/images", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 405 | "src/lazy", |
| 406 | "src/opts", |
| 407 | "src/pdf", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 408 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 409 | "src/sfnt", |
Florin Malita | 5edba45 | 2017-05-30 16:39:47 -0400 | [diff] [blame] | 410 | "src/shaders", |
Michael Ludwig | 4f94ef6 | 2018-09-12 15:22:16 -0400 | [diff] [blame] | 411 | "src/shaders/gradients", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 412 | "src/sksl", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 413 | "src/utils", |
Ben Wagner | d0a3b06 | 2016-10-24 14:11:12 -0400 | [diff] [blame] | 414 | "third_party/gif", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 415 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 416 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 417 | ################################################################################ |
| 418 | ## DM_SRCS |
| 419 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 420 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 421 | DM_SRCS_ALL = struct( |
| 422 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 423 | "dm/*.cpp", |
| 424 | "dm/*.h", |
Mike Klein | 60900b5 | 2018-09-21 11:19:45 -0400 | [diff] [blame] | 425 | "experimental/pipe/*.cpp", |
| 426 | "experimental/pipe/*.h", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 427 | "experimental/svg/model/*.cpp", |
| 428 | "experimental/svg/model/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 429 | "gm/*.cpp", |
| 430 | "gm/*.h", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 431 | "src/xml/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 432 | "tests/*.cpp", |
| 433 | "tests/*.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 434 | "tools/ios_utils.h", |
| 435 | "tools/BinaryAsset.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 436 | "tools/BigPathBench.inc", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 437 | "tools/CrashHandler.cpp", |
| 438 | "tools/CrashHandler.h", |
Robert Phillips | e61ba84 | 2018-05-30 08:27:26 -0400 | [diff] [blame] | 439 | "tools/DDLPromiseImageHelper.cpp", |
| 440 | "tools/DDLPromiseImageHelper.h", |
| 441 | "tools/DDLTileHelper.cpp", |
| 442 | "tools/DDLTileHelper.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 443 | "tools/ProcStats.cpp", |
| 444 | "tools/ProcStats.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 445 | "tools/Registry.h", |
| 446 | "tools/ResourceFactory.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 447 | "tools/Resources.cpp", |
| 448 | "tools/Resources.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 449 | "tools/SkJSONCPP.h", |
| 450 | "tools/UrlDataManager.cpp", |
| 451 | "tools/UrlDataManager.h", |
| 452 | "tools/debugger/*.cpp", |
| 453 | "tools/debugger/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 454 | "tools/flags/*.cpp", |
| 455 | "tools/flags/*.h", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 456 | "tools/fonts/SkRandomScalerContext.cpp", |
| 457 | "tools/fonts/SkRandomScalerContext.h", |
| 458 | "tools/fonts/SkTestFontMgr.cpp", |
| 459 | "tools/fonts/SkTestFontMgr.h", |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 460 | "tools/fonts/SkTestSVGTypeface.cpp", |
| 461 | "tools/fonts/SkTestSVGTypeface.h", |
| 462 | "tools/fonts/SkTestTypeface.cpp", |
| 463 | "tools/fonts/SkTestTypeface.h", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 464 | "tools/fonts/sk_tool_utils_font.cpp", |
| 465 | "tools/fonts/test_font_monospace.inc", |
| 466 | "tools/fonts/test_font_sans_serif.inc", |
| 467 | "tools/fonts/test_font_serif.inc", |
| 468 | "tools/fonts/test_font_index.inc", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 469 | "tools/gpu/**/*.cpp", |
| 470 | "tools/gpu/**/*.h", |
mtklein | e1fc452 | 2016-02-09 12:32:52 -0800 | [diff] [blame] | 471 | "tools/random_parse_path.cpp", |
| 472 | "tools/random_parse_path.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 473 | "tools/sk_pixel_iter.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 474 | "tools/sk_tool_utils.cpp", |
| 475 | "tools/sk_tool_utils.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 476 | "tools/timer/*.cpp", |
| 477 | "tools/timer/*.h", |
Brian Salomon | 40d0119 | 2017-07-19 13:05:11 -0400 | [diff] [blame] | 478 | "tools/trace/*.cpp", |
| 479 | "tools/trace/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 480 | ], |
| 481 | exclude = [ |
Mike Klein | db53760 | 2018-06-01 11:01:11 -0400 | [diff] [blame] | 482 | "gm/cgms.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 483 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
Ben Wagner | 37a06c0 | 2018-06-22 21:11:00 +0000 | [diff] [blame] | 484 | "tests/FontMgrFontConfigTest.cpp", # FontConfig-only. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 485 | "tests/skia_test.cpp", # Old main. |
Brian Salomon | f9ec470 | 2017-11-19 14:46:36 -0500 | [diff] [blame] | 486 | "tools/gpu/atlastext/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 487 | "tools/gpu/gl/angle/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 488 | "tools/gpu/gl/egl/*", |
| 489 | "tools/gpu/gl/glx/*", |
| 490 | "tools/gpu/gl/iOS/*", |
| 491 | "tools/gpu/gl/mac/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 492 | "tools/gpu/gl/win/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 493 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 494 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 495 | ], |
| 496 | ) |
| 497 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 498 | ################################################################################ |
| 499 | ## dm_srcs() |
| 500 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 501 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 502 | def dm_srcs(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 503 | """Sources for the dm binary for the specified os.""" |
| 504 | return skia_glob(DM_SRCS_ALL) + skia_select( |
| 505 | os_conditions, |
| 506 | [ |
| 507 | [], |
| 508 | ["tests/FontMgrAndroidParserTest.cpp"], |
| 509 | [], |
| 510 | ], |
| 511 | ) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 512 | |
| 513 | ################################################################################ |
| 514 | ## DM_INCLUDES |
| 515 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 516 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 517 | DM_INCLUDES = [ |
benjaminwagner | b1fe8f6 | 2016-02-01 09:05:08 -0800 | [diff] [blame] | 518 | "dm", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 519 | "gm", |
Mike Klein | 60900b5 | 2018-09-21 11:19:45 -0400 | [diff] [blame] | 520 | "experimental/pipe", |
Mike Reed | 7f302c4 | 2017-02-18 14:12:08 -0500 | [diff] [blame] | 521 | "experimental/svg/model", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 522 | "src/codec", |
Mike Reed | aab8ce4 | 2017-02-18 12:57:09 -0500 | [diff] [blame] | 523 | "src/core", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 524 | "src/effects", |
| 525 | "src/fonts", |
Hal Canary | db68301 | 2016-11-23 08:55:18 -0700 | [diff] [blame] | 526 | "src/images", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 527 | "src/pathops", |
| 528 | "src/pipe/utils", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 529 | "src/ports", |
Florin Malita | 5edba45 | 2017-05-30 16:39:47 -0400 | [diff] [blame] | 530 | "src/shaders", |
| 531 | "src/shaders/gradients", |
Mike Reed | f71828f | 2017-02-18 09:51:33 -0500 | [diff] [blame] | 532 | "src/xml", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 533 | "tests", |
| 534 | "tools", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 535 | "tools/debugger", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 536 | "tools/flags", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 537 | "tools/fonts", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 538 | "tools/gpu", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 539 | "tools/timer", |
Brian Salomon | 40d0119 | 2017-07-19 13:05:11 -0400 | [diff] [blame] | 540 | "tools/trace", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 541 | ] |
| 542 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 543 | ################################################################################ |
| 544 | ## DM_ARGS |
| 545 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 546 | |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 547 | def DM_ARGS(asan): |
Mike Klein | dd650c4 | 2018-11-08 14:26:02 -0500 | [diff] [blame] | 548 | source = ["gm", "image", "lottie"] |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 549 | |
| 550 | # TODO(benjaminwagner): f16, pic-8888, serialize-8888, and tiles_rt-8888 fail. |
| 551 | config = ["565", "8888", "pdf"] |
| 552 | match = ["~Codec_78329453"] |
| 553 | return (["--src"] + source + ["--config"] + config + ["--nonativeFonts"] + |
| 554 | ["--match"] + match) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 555 | |
| 556 | ################################################################################ |
| 557 | ## COPTS |
| 558 | ################################################################################ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 559 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 560 | def base_copts(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 561 | return skia_select( |
| 562 | os_conditions, |
| 563 | [ |
| 564 | # UNIX |
| 565 | [ |
| 566 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
| 567 | # Internal use of deprecated methods. :( |
| 568 | "-Wno-deprecated-declarations", |
| 569 | # TODO(kjlubick) |
| 570 | "-Wno-self-assign", # Spurious warning in tests/PathOpsDVectorTest.cpp? |
| 571 | ], |
| 572 | # ANDROID |
| 573 | [ |
Mike Klein | 9b7e99e | 2018-08-22 16:45:11 -0400 | [diff] [blame] | 574 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 575 | # 'GrResourceCache' declared with greater visibility than the |
| 576 | # type of its field 'GrResourceCache::fPurgeableQueue'... bogus. |
| 577 | "-Wno-error=attributes", |
| 578 | ], |
| 579 | # IOS |
Benjamin Barenblat | fd10d17 | 2018-07-31 16:41:37 -0400 | [diff] [blame] | 580 | [ |
| 581 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
| 582 | ], |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 583 | ], |
| 584 | ) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 585 | |
| 586 | ################################################################################ |
| 587 | ## DEFINES |
| 588 | ################################################################################ |
| 589 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 590 | def base_defines(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 591 | return [ |
| 592 | # Chrome DEFINES. |
| 593 | "SK_USE_FREETYPE_EMBOLDEN", |
| 594 | # Turn on a few Google3-specific build fixes. |
| 595 | "SK_BUILD_FOR_GOOGLE3", |
| 596 | # Required for building dm. |
| 597 | "GR_TEST_UTILS", |
| 598 | # Staging flags for API changes |
| 599 | # Should remove after we update golden images |
| 600 | "SK_WEBP_ENCODER_USE_DEFAULT_METHOD", |
| 601 | # Experiment to diagnose image diffs in Google3 |
Mike Klein | 0ade68c | 2018-10-24 06:52:35 -0400 | [diff] [blame] | 602 | "SK_DISABLE_LOWP_RASTER_PIPELINE", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 603 | # JPEG is in codec_limited |
| 604 | "SK_HAS_JPEG_LIBRARY", |
| 605 | ] + skia_select( |
| 606 | os_conditions, |
| 607 | [ |
| 608 | # UNIX |
| 609 | [ |
| 610 | "PNG_SKIP_SETJMP_CHECK", |
| 611 | "SK_BUILD_FOR_UNIX", |
| 612 | "SK_SAMPLES_FOR_X", |
| 613 | "SK_PDF_USE_SFNTLY", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 614 | "SK_HAS_PNG_LIBRARY", |
| 615 | "SK_HAS_WEBP_LIBRARY", |
| 616 | ], |
| 617 | # ANDROID |
| 618 | [ |
| 619 | "SK_BUILD_FOR_ANDROID", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 620 | "SK_HAS_PNG_LIBRARY", |
| 621 | "SK_HAS_WEBP_LIBRARY", |
| 622 | ], |
| 623 | # IOS |
| 624 | [ |
| 625 | "SK_BUILD_FOR_IOS", |
| 626 | "SK_BUILD_NO_OPTS", |
| 627 | "SKNX_NO_SIMD", |
| 628 | ], |
| 629 | ], |
| 630 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 631 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 632 | ################################################################################ |
| 633 | ## LINKOPTS |
| 634 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 635 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 636 | def base_linkopts(os_conditions): |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 637 | return [ |
| 638 | "-ldl", |
| 639 | ] + skia_select( |
| 640 | os_conditions, |
| 641 | [ |
| 642 | # UNIX |
| 643 | [], |
| 644 | # ANDROID |
| 645 | [ |
| 646 | "-lEGL", |
Ben Wagner | 773151f | 2018-08-17 09:28:53 -0400 | [diff] [blame] | 647 | "-lGLESv2", |
Ben Wagner | b303a42 | 2018-07-31 10:31:06 -0400 | [diff] [blame] | 648 | ], |
| 649 | # IOS |
| 650 | [ |
| 651 | "-framework CoreFoundation", |
| 652 | "-framework CoreGraphics", |
| 653 | "-framework CoreText", |
| 654 | "-framework ImageIO", |
| 655 | "-framework MobileCoreServices", |
| 656 | ], |
| 657 | ], |
| 658 | ) |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 659 | |
| 660 | ################################################################################ |
| 661 | ## skottie_tool |
| 662 | ################################################################################ |
| 663 | |
| 664 | SKOTTIE_TOOL_INCLUDES = [ |
Florin Malita | a831655 | 2018-11-09 16:19:44 -0500 | [diff] [blame] | 665 | "modules/skottie/utils", |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 666 | "tools/flags", |
| 667 | ] |
| 668 | |
| 669 | SKOTTIE_TOOL_SRCS = [ |
| 670 | "modules/skottie/src/SkottieTool.cpp", |
Florin Malita | a831655 | 2018-11-09 16:19:44 -0500 | [diff] [blame] | 671 | "modules/skottie/utils/SkottieUtils.cpp", |
| 672 | "modules/skottie/utils/SkottieUtils.h", |
Florin Malita | dcc9d06 | 2018-11-08 14:25:19 -0500 | [diff] [blame] | 673 | # TODO(benjaminwagner): Add "flags" target. |
| 674 | "tools/flags/SkCommandLineFlags.cpp", |
| 675 | "tools/flags/SkCommandLineFlags.h", |
| 676 | ] |