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 | ################################################################################ |
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 | b7e8011 | 2018-01-24 18:18:12 -0500 | [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(): |
| 65 | return native.glob(["include/**/*.h"], |
| 66 | exclude=[ |
| 67 | "include/private/**/*", |
| 68 | "include/views/**/*", # Not used. |
| 69 | ]) |
| 70 | |
| 71 | ################################################################################ |
| 72 | ## skia_opts_srcs() |
| 73 | ################################################################################ |
| 74 | # Intel |
| 75 | SKIA_OPTS_SSE2 = "SSE2" |
| 76 | |
| 77 | SKIA_OPTS_SSSE3 = "SSSE3" |
| 78 | |
| 79 | SKIA_OPTS_SSE41 = "SSE41" |
| 80 | |
| 81 | SKIA_OPTS_SSE42 = "SSE42" |
| 82 | |
| 83 | SKIA_OPTS_AVX = "AVX" |
| 84 | |
Mike Klein | 33d077d | 2018-02-27 13:43:53 -0500 | [diff] [blame] | 85 | SKIA_OPTS_HSW = "HSW" |
| 86 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 87 | # Arm |
| 88 | SKIA_OPTS_NEON = "NEON" |
| 89 | |
| 90 | SKIA_OPTS_CRC32 = "CRC32" # arm64 |
| 91 | |
| 92 | def opts_srcs(opts): |
| 93 | if opts == SKIA_OPTS_SSE2: |
| 94 | return native.glob([ |
| 95 | "src/opts/*_SSE2.cpp", |
| 96 | "src/opts/*_sse2.cpp", # No matches currently. |
| 97 | ]) |
| 98 | elif opts == SKIA_OPTS_SSSE3: |
| 99 | return native.glob([ |
| 100 | "src/opts/*_SSSE3.cpp", |
| 101 | "src/opts/*_ssse3.cpp", |
| 102 | ]) |
| 103 | elif opts == SKIA_OPTS_SSE41: |
| 104 | return native.glob([ |
| 105 | "src/opts/*_sse41.cpp", |
| 106 | ]) |
| 107 | elif opts == SKIA_OPTS_SSE42: |
| 108 | return native.glob([ |
| 109 | "src/opts/*_sse42.cpp", |
| 110 | ]) |
| 111 | elif opts == SKIA_OPTS_AVX: |
| 112 | return native.glob([ |
| 113 | "src/opts/*_avx.cpp", |
| 114 | ]) |
Mike Klein | 33d077d | 2018-02-27 13:43:53 -0500 | [diff] [blame] | 115 | elif opts == SKIA_OPTS_HSW: |
| 116 | return native.glob([ |
| 117 | "src/opts/*_hsw.cpp", |
| 118 | ]) |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 119 | elif opts == SKIA_OPTS_NEON: |
| 120 | return native.glob([ |
| 121 | "src/opts/*_neon.cpp", |
| 122 | ]) |
| 123 | elif opts == SKIA_OPTS_CRC32: |
| 124 | return native.glob([ |
| 125 | "src/opts/*_crc32.cpp", |
| 126 | ]) |
| 127 | else: |
| 128 | fail("skia_opts_srcs parameter 'opts' must be one of SKIA_OPTS_*.") |
| 129 | |
| 130 | def opts_cflags(opts): |
| 131 | if opts == SKIA_OPTS_SSE2: |
| 132 | return ["-msse2"] |
| 133 | elif opts == SKIA_OPTS_SSSE3: |
| 134 | return ["-mssse3"] |
| 135 | elif opts == SKIA_OPTS_SSE41: |
| 136 | return ["-msse4.1"] |
| 137 | elif opts == SKIA_OPTS_SSE42: |
| 138 | return ["-msse4.2"] |
| 139 | elif opts == SKIA_OPTS_AVX: |
| 140 | return ["-mavx"] |
Mike Klein | 33d077d | 2018-02-27 13:43:53 -0500 | [diff] [blame] | 141 | elif opts == SKIA_OPTS_HSW: |
| 142 | return ["-mavx2", "-mf16c", "-mfma"] |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 143 | elif opts == SKIA_OPTS_NEON: |
| 144 | return ["-mfpu=neon"] |
| 145 | elif opts == SKIA_OPTS_CRC32: |
Mike Klein | c29bb57 | 2017-10-24 11:40:41 -0400 | [diff] [blame] | 146 | # NDK r11's Clang (3.8) doesn't pass along this -march setting correctly to an external |
| 147 | # assembler, so we do it manually with -Wa. This is just a bug, fixed in later Clangs. |
| 148 | return ["-march=armv8-a+crc", "-Wa,-march=armv8-a+crc"] |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 149 | else: |
| 150 | return [] |
| 151 | |
| 152 | SKIA_CPU_ARM = "ARM" |
| 153 | |
| 154 | SKIA_CPU_ARM64 = "ARM64" |
| 155 | |
| 156 | SKIA_CPU_X86 = "X86" |
| 157 | |
| 158 | SKIA_CPU_OTHER = "OTHER" |
| 159 | |
| 160 | def opts_rest_srcs(cpu): |
| 161 | srcs = [] |
| 162 | if cpu == SKIA_CPU_ARM or cpu == SKIA_CPU_ARM64: |
| 163 | srcs += native.glob([ |
| 164 | "src/opts/*_arm.cpp", |
| 165 | "src/opts/SkBitmapProcState_opts_none.cpp", |
| 166 | ]) |
| 167 | if cpu == SKIA_CPU_ARM64: |
| 168 | # NEON doesn't need special flags to compile on ARM64. |
| 169 | srcs += native.glob([ |
| 170 | "src/opts/*_neon.cpp", |
| 171 | ]) |
| 172 | elif cpu == SKIA_CPU_X86: |
| 173 | srcs += native.glob([ |
| 174 | "src/opts/*_x86.cpp", |
| 175 | ]) |
| 176 | elif cpu == SKIA_CPU_OTHER: |
| 177 | srcs += native.glob([ |
| 178 | "src/opts/*_none.cpp", |
| 179 | ]) |
| 180 | else: |
| 181 | fail("opts_rest_srcs parameter 'cpu' must be one of " + |
| 182 | "SKIA_CPU_{ARM,ARM64,X86,OTHER}.") |
| 183 | return srcs |
| 184 | |
| 185 | def skia_opts_deps(cpu): |
| 186 | res = [":opts_rest"] |
| 187 | |
| 188 | if cpu == SKIA_CPU_ARM: |
| 189 | res += [":opts_neon"] |
| 190 | |
| 191 | if cpu == SKIA_CPU_ARM64: |
| 192 | res += [":opts_crc32"] |
Mike Klein | c29bb57 | 2017-10-24 11:40:41 -0400 | [diff] [blame] | 193 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 194 | if cpu == SKIA_CPU_X86: |
| 195 | res += [ |
| 196 | ":opts_sse2", |
| 197 | ":opts_ssse3", |
| 198 | ":opts_sse41", |
| 199 | ":opts_sse42", |
| 200 | ":opts_avx", |
Mike Klein | 33d077d | 2018-02-27 13:43:53 -0500 | [diff] [blame] | 201 | ":opts_hsw", |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 202 | ] |
| 203 | |
| 204 | return res |
| 205 | |
| 206 | ################################################################################ |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 207 | ## BASE_SRCS |
| 208 | ################################################################################ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 209 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 210 | # All platform-independent SRCS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 211 | BASE_SRCS_ALL = struct( |
| 212 | include = [ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 213 | "include/private/**/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 214 | "src/**/*.h", |
| 215 | "src/**/*.cpp", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 216 | "src/**/*.inc", |
Mike Klein | 0a64e32 | 2017-03-29 17:32:50 -0400 | [diff] [blame] | 217 | "src/jumper/SkJumper_generated.S", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 218 | |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 219 | # Third Party |
Ben Wagner | d0a3b06 | 2016-10-24 14:11:12 -0400 | [diff] [blame] | 220 | "third_party/gif/*.cpp", |
| 221 | "third_party/gif/*.h", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 222 | ], |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 223 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 224 | # Exclude platform-dependent files. |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 225 | "src/codec/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 226 | "src/device/xps/*", # Windows-only. Move to ports? |
| 227 | "src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
| 228 | "src/gpu/gl/android/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 229 | "src/gpu/gl/egl/*", |
benjaminwagner | af3b35e | 2016-03-28 13:27:28 -0700 | [diff] [blame] | 230 | "src/gpu/gl/glfw/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 231 | "src/gpu/gl/glx/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 232 | "src/gpu/gl/iOS/*", |
| 233 | "src/gpu/gl/mac/*", |
| 234 | "src/gpu/gl/win/*", |
| 235 | "src/opts/**/*", |
| 236 | "src/ports/**/*", |
| 237 | "src/utils/android/**/*", |
| 238 | "src/utils/mac/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 239 | "src/utils/win/**/*", |
| 240 | "src/views/sdl/*", |
| 241 | "src/views/win/*", |
| 242 | "src/views/unix/*", |
| 243 | |
| 244 | # Exclude multiple definitions. |
| 245 | # TODO(mtklein): Move to opts? |
benjaminwagner | ca26a18 | 2016-03-14 15:21:12 -0700 | [diff] [blame] | 246 | "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp. |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 247 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 248 | |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 249 | # Exclude files that don't compile everywhere. |
| 250 | "src/svg/**/*", # Depends on xml, SkJpegCodec, and SkPngCodec. |
| 251 | "src/xml/**/*", # Avoid dragging in expat when not needed. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 252 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 253 | # Conflicting dependencies among Lua versions. See cl/107087297. |
| 254 | "src/utils/SkLua*", |
| 255 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 256 | # Not used. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 257 | "src/views/**/*", |
egdaniel | 32119f1 | 2016-02-22 10:07:54 -0800 | [diff] [blame] | 258 | |
| 259 | # Currently exclude all vulkan specific files |
| 260 | "src/gpu/vk/*", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 261 | |
| 262 | # Defines main. |
| 263 | "src/sksl/SkSLMain.cpp", |
Ethan Nicholas | 8d7f4ae | 2017-09-07 11:07:42 -0400 | [diff] [blame] | 264 | |
| 265 | # Only used to regenerate the lexer |
| 266 | "src/sksl/lex/*", |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 267 | |
| 268 | # Atlas text |
| 269 | "src/atlastext/*", |
Mike Klein | 83ee463 | 2018-03-27 13:22:50 -0400 | [diff] [blame] | 270 | |
| 271 | # Not time for skcms in Google3 yet. |
| 272 | "src/core/SkColorSpaceXform_skcms.cpp", |
Mike Klein | b056e7f | 2018-06-20 09:44:59 -0400 | [diff] [blame] | 273 | |
| 274 | # Compute backend not yet even hooked into Skia. |
| 275 | "src/compute/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 276 | ], |
| 277 | ) |
| 278 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 279 | def codec_srcs(limited): |
| 280 | """Sources for the codecs. Excludes Ico, Webp, Png, and Raw if limited.""" |
| 281 | exclude = [] |
| 282 | if limited: |
| 283 | exclude += [ |
| 284 | "src/codec/*Ico*.cpp", |
| 285 | "src/codec/*Webp*.cpp", |
| 286 | "src/codec/*Png*", |
| 287 | "src/codec/*Raw*.cpp", |
| 288 | ] |
| 289 | return native.glob(["src/codec/*.cpp"], exclude = exclude) |
| 290 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 291 | # Platform-dependent SRCS for google3-default platform. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 292 | BASE_SRCS_UNIX = struct( |
| 293 | include = [ |
Brian Salomon | b3ce76e | 2017-12-11 15:21:39 -0500 | [diff] [blame] | 294 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 295 | "src/ports/**/*.cpp", |
| 296 | "src/ports/**/*.h", |
| 297 | ], |
| 298 | exclude = [ |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 299 | "src/ports/*CG*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 300 | "src/ports/*WIC*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 301 | "src/ports/*android*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 302 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 303 | "src/ports/*mac*", |
| 304 | "src/ports/*mozalloc*", |
| 305 | "src/ports/*nacl*", |
| 306 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 307 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 308 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 309 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 310 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 404816e | 2015-12-03 05:04:03 -0800 | [diff] [blame] | 311 | "src/ports/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 312 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 313 | "src/ports/SkGlobalInitialization_none.cpp", |
Mike Klein | 53418da | 2018-06-20 09:34:05 -0400 | [diff] [blame] | 314 | "src/ports/SkGlobalInitialization_none_imagefilters.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 315 | "src/ports/SkImageGenerator_none.cpp", |
| 316 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 317 | ], |
| 318 | ) |
| 319 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 320 | # Platform-dependent SRCS for google3-default Android. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 321 | BASE_SRCS_ANDROID = struct( |
| 322 | include = [ |
Brian Salomon | b3ce76e | 2017-12-11 15:21:39 -0500 | [diff] [blame] | 323 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 324 | # TODO(benjaminwagner): Figure out how to compile with EGL. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 325 | "src/ports/**/*.cpp", |
| 326 | "src/ports/**/*.h", |
| 327 | ], |
| 328 | exclude = [ |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 329 | "src/ports/*CG*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 330 | "src/ports/*FontConfig*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 331 | "src/ports/*WIC*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 332 | "src/ports/*chromium*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 333 | "src/ports/*fontconfig*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 334 | "src/ports/*mac*", |
| 335 | "src/ports/*mozalloc*", |
| 336 | "src/ports/*nacl*", |
| 337 | "src/ports/*win*", |
| 338 | "src/ports/SkDebug_stdio.cpp", |
| 339 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 340 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 341 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 342 | "src/ports/SkFontMgr_empty_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 343 | "src/ports/SkGlobalInitialization_none.cpp", |
Mike Klein | 53418da | 2018-06-20 09:34:05 -0400 | [diff] [blame] | 344 | "src/ports/SkGlobalInitialization_none_imagefilters.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 345 | "src/ports/SkImageGenerator_none.cpp", |
| 346 | "src/ports/SkTLS_none.cpp", |
| 347 | ], |
| 348 | ) |
| 349 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 350 | # Platform-dependent SRCS for google3-default iOS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 351 | BASE_SRCS_IOS = struct( |
| 352 | include = [ |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 353 | "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 354 | "src/ports/**/*.cpp", |
| 355 | "src/ports/**/*.h", |
iroth | ab669de | 2016-02-16 19:17:01 -0800 | [diff] [blame] | 356 | "src/utils/mac/*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 357 | ], |
| 358 | exclude = [ |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 359 | "src/ports/*FontConfig*", |
| 360 | "src/ports/*FreeType*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 361 | "src/ports/*WIC*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 362 | "src/ports/*android*", |
| 363 | "src/ports/*chromium*", |
| 364 | "src/ports/*fontconfig*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 365 | "src/ports/*mozalloc*", |
| 366 | "src/ports/*nacl*", |
| 367 | "src/ports/*win*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 368 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 369 | "src/ports/SkFontMgr_custom_directory.cpp", |
| 370 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 371 | "src/ports/SkFontMgr_custom_empty.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 372 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 373 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 374 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 375 | "src/ports/SkFontMgr_empty_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 376 | "src/ports/SkGlobalInitialization_none.cpp", |
Mike Klein | 53418da | 2018-06-20 09:34:05 -0400 | [diff] [blame] | 377 | "src/ports/SkGlobalInitialization_none_imagefilters.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 378 | "src/ports/SkImageGenerator_none.cpp", |
| 379 | "src/ports/SkTLS_none.cpp", |
| 380 | ], |
| 381 | ) |
| 382 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 383 | ################################################################################ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 384 | ## skia_srcs() |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 385 | ################################################################################ |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 386 | def skia_srcs(os_conditions): |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 387 | """Sources to be compiled into the skia library.""" |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 388 | return skia_glob(BASE_SRCS_ALL) + skia_select( |
| 389 | os_conditions, |
| 390 | [ |
| 391 | skia_glob(BASE_SRCS_UNIX), |
| 392 | skia_glob(BASE_SRCS_ANDROID), |
| 393 | skia_glob(BASE_SRCS_IOS), |
| 394 | ], |
| 395 | ) |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 396 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 397 | ################################################################################ |
| 398 | ## INCLUDES |
| 399 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 400 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 401 | # Includes needed by Skia implementation. Not public includes. |
| 402 | INCLUDES = [ |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 403 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 404 | "include/c", |
| 405 | "include/codec", |
| 406 | "include/config", |
| 407 | "include/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 408 | "include/effects", |
Matt Sarett | d7093c2 | 2017-05-09 15:28:32 -0400 | [diff] [blame] | 409 | "include/encode", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 410 | "include/gpu", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 411 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 412 | "include/ports", |
| 413 | "include/private", |
| 414 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 415 | "include/utils/mac", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 416 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 417 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 418 | "src/gpu", |
| 419 | "src/image", |
Mike Klein | 135a1b1 | 2017-08-15 13:13:59 -0400 | [diff] [blame] | 420 | "src/images", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 421 | "src/lazy", |
| 422 | "src/opts", |
| 423 | "src/pdf", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 424 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 425 | "src/sfnt", |
Florin Malita | 5edba45 | 2017-05-30 16:39:47 -0400 | [diff] [blame] | 426 | "src/shaders", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 427 | "src/sksl", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 428 | "src/utils", |
Ben Wagner | d0a3b06 | 2016-10-24 14:11:12 -0400 | [diff] [blame] | 429 | "third_party/gif", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 430 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 431 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 432 | ################################################################################ |
| 433 | ## DM_SRCS |
| 434 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 435 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 436 | DM_SRCS_ALL = struct( |
| 437 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 438 | "dm/*.cpp", |
| 439 | "dm/*.h", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 440 | "experimental/svg/model/*.cpp", |
| 441 | "experimental/svg/model/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 442 | "gm/*.cpp", |
| 443 | "gm/*.h", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 444 | "src/xml/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 445 | "tests/*.cpp", |
| 446 | "tests/*.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 447 | "tools/ios_utils.h", |
| 448 | "tools/BinaryAsset.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 449 | "tools/BigPathBench.inc", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 450 | "tools/CrashHandler.cpp", |
| 451 | "tools/CrashHandler.h", |
Robert Phillips | e61ba84 | 2018-05-30 08:27:26 -0400 | [diff] [blame] | 452 | "tools/DDLPromiseImageHelper.cpp", |
| 453 | "tools/DDLPromiseImageHelper.h", |
| 454 | "tools/DDLTileHelper.cpp", |
| 455 | "tools/DDLTileHelper.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 456 | "tools/ProcStats.cpp", |
| 457 | "tools/ProcStats.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 458 | "tools/Registry.h", |
| 459 | "tools/ResourceFactory.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 460 | "tools/Resources.cpp", |
| 461 | "tools/Resources.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 462 | "tools/SkJSONCPP.h", |
| 463 | "tools/UrlDataManager.cpp", |
| 464 | "tools/UrlDataManager.h", |
| 465 | "tools/debugger/*.cpp", |
| 466 | "tools/debugger/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 467 | "tools/flags/*.cpp", |
| 468 | "tools/flags/*.h", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 469 | "tools/fonts/SkRandomScalerContext.cpp", |
| 470 | "tools/fonts/SkRandomScalerContext.h", |
| 471 | "tools/fonts/SkTestFontMgr.cpp", |
| 472 | "tools/fonts/SkTestFontMgr.h", |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 473 | "tools/fonts/SkTestSVGTypeface.cpp", |
| 474 | "tools/fonts/SkTestSVGTypeface.h", |
| 475 | "tools/fonts/SkTestTypeface.cpp", |
| 476 | "tools/fonts/SkTestTypeface.h", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 477 | "tools/fonts/sk_tool_utils_font.cpp", |
| 478 | "tools/fonts/test_font_monospace.inc", |
| 479 | "tools/fonts/test_font_sans_serif.inc", |
| 480 | "tools/fonts/test_font_serif.inc", |
| 481 | "tools/fonts/test_font_index.inc", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 482 | "tools/gpu/**/*.cpp", |
| 483 | "tools/gpu/**/*.h", |
brianosman | 6d3119c | 2016-04-19 19:41:54 -0700 | [diff] [blame] | 484 | "tools/picture_utils.cpp", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 485 | "tools/picture_utils.h", |
mtklein | e1fc452 | 2016-02-09 12:32:52 -0800 | [diff] [blame] | 486 | "tools/random_parse_path.cpp", |
| 487 | "tools/random_parse_path.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 488 | "tools/sk_pixel_iter.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 489 | "tools/sk_tool_utils.cpp", |
| 490 | "tools/sk_tool_utils.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 491 | "tools/timer/*.cpp", |
| 492 | "tools/timer/*.h", |
Brian Salomon | 40d0119 | 2017-07-19 13:05:11 -0400 | [diff] [blame] | 493 | "tools/trace/*.cpp", |
| 494 | "tools/trace/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 495 | ], |
| 496 | exclude = [ |
Mike Klein | db53760 | 2018-06-01 11:01:11 -0400 | [diff] [blame] | 497 | "gm/cgms.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 498 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
Ben Wagner | 37a06c0 | 2018-06-22 21:11:00 +0000 | [diff] [blame] | 499 | "tests/FontMgrFontConfigTest.cpp", # FontConfig-only. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 500 | "tests/skia_test.cpp", # Old main. |
Brian Salomon | f9ec470 | 2017-11-19 14:46:36 -0500 | [diff] [blame] | 501 | "tools/gpu/atlastext/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 502 | "tools/gpu/gl/angle/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 503 | "tools/gpu/gl/egl/*", |
| 504 | "tools/gpu/gl/glx/*", |
| 505 | "tools/gpu/gl/iOS/*", |
| 506 | "tools/gpu/gl/mac/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 507 | "tools/gpu/gl/win/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 508 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 509 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 510 | ], |
| 511 | ) |
| 512 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 513 | ################################################################################ |
| 514 | ## dm_srcs() |
| 515 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 516 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 517 | def dm_srcs(os_conditions): |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 518 | """Sources for the dm binary for the specified os.""" |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 519 | return skia_glob(DM_SRCS_ALL) + skia_select( |
| 520 | os_conditions, |
| 521 | [ |
| 522 | [], |
| 523 | ["tests/FontMgrAndroidParserTest.cpp"], |
| 524 | [], |
| 525 | ], |
| 526 | ) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 527 | |
| 528 | ################################################################################ |
| 529 | ## DM_INCLUDES |
| 530 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 531 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 532 | DM_INCLUDES = [ |
benjaminwagner | b1fe8f6 | 2016-02-01 09:05:08 -0800 | [diff] [blame] | 533 | "dm", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 534 | "gm", |
Mike Reed | 7f302c4 | 2017-02-18 14:12:08 -0500 | [diff] [blame] | 535 | "experimental/svg/model", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 536 | "src/codec", |
Mike Reed | aab8ce4 | 2017-02-18 12:57:09 -0500 | [diff] [blame] | 537 | "src/core", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 538 | "src/effects", |
| 539 | "src/fonts", |
Hal Canary | db68301 | 2016-11-23 08:55:18 -0700 | [diff] [blame] | 540 | "src/images", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 541 | "src/pathops", |
| 542 | "src/pipe/utils", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 543 | "src/ports", |
Florin Malita | 5edba45 | 2017-05-30 16:39:47 -0400 | [diff] [blame] | 544 | "src/shaders", |
| 545 | "src/shaders/gradients", |
Mike Reed | f71828f | 2017-02-18 09:51:33 -0500 | [diff] [blame] | 546 | "src/xml", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 547 | "tests", |
| 548 | "tools", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 549 | "tools/debugger", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 550 | "tools/flags", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 551 | "tools/fonts", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 552 | "tools/gpu", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 553 | "tools/timer", |
Brian Salomon | 40d0119 | 2017-07-19 13:05:11 -0400 | [diff] [blame] | 554 | "tools/trace", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 555 | ] |
| 556 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 557 | ################################################################################ |
| 558 | ## DM_ARGS |
| 559 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 560 | |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 561 | def DM_ARGS(asan): |
benjaminwagner | 83906ae | 2016-05-01 15:02:25 -0700 | [diff] [blame] | 562 | source = ["tests", "gm", "image"] |
Ben Wagner | e2cbd04 | 2017-08-11 09:39:04 -0400 | [diff] [blame] | 563 | # TODO(benjaminwagner): f16, pic-8888, serialize-8888, and tiles_rt-8888 fail. |
Brian Osman | 229f4d9 | 2018-06-08 09:19:08 -0400 | [diff] [blame] | 564 | config = ["565", "8888", "pdf"] |
Ben Wagner | 9396bc3 | 2018-06-26 15:22:07 -0400 | [diff] [blame^] | 565 | match = ["~Codec_78329453"] |
| 566 | return (["--src"] + source + ["--config"] + config + ["--nonativeFonts"] + |
| 567 | ["--match"] + match) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 568 | |
| 569 | ################################################################################ |
| 570 | ## COPTS |
| 571 | ################################################################################ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 572 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 573 | def base_copts(os_conditions): |
| 574 | return skia_select( |
| 575 | os_conditions, |
| 576 | [ |
| 577 | # UNIX |
| 578 | [ |
| 579 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
| 580 | # Internal use of deprecated methods. :( |
| 581 | "-Wno-deprecated-declarations", |
Mike Klein | 1b6eb99 | 2018-04-16 15:28:37 -0400 | [diff] [blame] | 582 | # TODO(kjlubick) |
| 583 | "-Wno-self-assign", # Spurious warning in tests/PathOpsDVectorTest.cpp? |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 584 | ], |
| 585 | # ANDROID |
| 586 | [ |
| 587 | # 'GrResourceCache' declared with greater visibility than the |
| 588 | # type of its field 'GrResourceCache::fPurgeableQueue'... bogus. |
| 589 | "-Wno-error=attributes", |
| 590 | ], |
| 591 | # IOS |
| 592 | [], |
| 593 | ], |
| 594 | ) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 595 | |
| 596 | ################################################################################ |
| 597 | ## DEFINES |
| 598 | ################################################################################ |
| 599 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 600 | def base_defines(os_conditions): |
| 601 | return [ |
| 602 | # Chrome DEFINES. |
| 603 | "SK_USE_FREETYPE_EMBOLDEN", |
| 604 | # Turn on a few Google3-specific build fixes. |
Mike Klein | 6613cc5 | 2017-12-19 09:09:33 -0500 | [diff] [blame] | 605 | "SK_BUILD_FOR_GOOGLE3", |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 606 | # Required for building dm. |
| 607 | "GR_TEST_UTILS", |
| 608 | # Staging flags for API changes |
| 609 | # Should remove after we update golden images |
| 610 | "SK_WEBP_ENCODER_USE_DEFAULT_METHOD", |
| 611 | # Experiment to diagnose image diffs in Google3 |
| 612 | "SK_JUMPER_DISABLE_8BIT", |
| 613 | # JPEG is in codec_limited |
| 614 | "SK_HAS_JPEG_LIBRARY", |
| 615 | ] + skia_select( |
| 616 | os_conditions, |
| 617 | [ |
| 618 | # UNIX |
| 619 | [ |
| 620 | "PNG_SKIP_SETJMP_CHECK", |
| 621 | "SK_BUILD_FOR_UNIX", |
| 622 | "SK_SAMPLES_FOR_X", |
| 623 | "SK_PDF_USE_SFNTLY", |
| 624 | "SK_CODEC_DECODES_RAW", |
| 625 | "SK_HAS_PNG_LIBRARY", |
| 626 | "SK_HAS_WEBP_LIBRARY", |
| 627 | ], |
| 628 | # ANDROID |
| 629 | [ |
| 630 | "SK_BUILD_FOR_ANDROID", |
| 631 | "SK_CODEC_DECODES_RAW", |
| 632 | "SK_HAS_PNG_LIBRARY", |
| 633 | "SK_HAS_WEBP_LIBRARY", |
| 634 | ], |
| 635 | # IOS |
| 636 | [ |
| 637 | "SK_BUILD_FOR_IOS", |
| 638 | "SK_BUILD_NO_OPTS", |
| 639 | "SKNX_NO_SIMD", |
| 640 | ], |
| 641 | ], |
| 642 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 643 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 644 | ################################################################################ |
| 645 | ## LINKOPTS |
| 646 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 647 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 648 | def base_linkopts(os_conditions): |
| 649 | return [ |
| 650 | "-ldl", |
| 651 | ] + skia_select( |
| 652 | os_conditions, |
| 653 | [ |
| 654 | # UNIX |
| 655 | [], |
| 656 | # ANDROID |
| 657 | [ |
| 658 | "-lEGL", |
| 659 | ], |
| 660 | # IOS |
| 661 | [ |
| 662 | "-framework CoreFoundation", |
| 663 | "-framework CoreGraphics", |
| 664 | "-framework CoreText", |
| 665 | "-framework ImageIO", |
| 666 | "-framework MobileCoreServices", |
| 667 | ], |
| 668 | ] |
| 669 | ) |