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", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 273 | ], |
| 274 | ) |
| 275 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 276 | def codec_srcs(limited): |
| 277 | """Sources for the codecs. Excludes Ico, Webp, Png, and Raw if limited.""" |
| 278 | exclude = [] |
| 279 | if limited: |
| 280 | exclude += [ |
| 281 | "src/codec/*Ico*.cpp", |
| 282 | "src/codec/*Webp*.cpp", |
| 283 | "src/codec/*Png*", |
| 284 | "src/codec/*Raw*.cpp", |
| 285 | ] |
| 286 | return native.glob(["src/codec/*.cpp"], exclude = exclude) |
| 287 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 288 | # Platform-dependent SRCS for google3-default platform. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 289 | BASE_SRCS_UNIX = struct( |
| 290 | include = [ |
Brian Salomon | b3ce76e | 2017-12-11 15:21:39 -0500 | [diff] [blame] | 291 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 292 | "src/ports/**/*.cpp", |
| 293 | "src/ports/**/*.h", |
| 294 | ], |
| 295 | exclude = [ |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 296 | "src/ports/*CG*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 297 | "src/ports/*WIC*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 298 | "src/ports/*android*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 299 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 300 | "src/ports/*mac*", |
| 301 | "src/ports/*mozalloc*", |
| 302 | "src/ports/*nacl*", |
| 303 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 304 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 305 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 306 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 307 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 404816e | 2015-12-03 05:04:03 -0800 | [diff] [blame] | 308 | "src/ports/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 309 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 310 | "src/ports/SkGlobalInitialization_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 311 | "src/ports/SkImageGenerator_none.cpp", |
| 312 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 313 | ], |
| 314 | ) |
| 315 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 316 | # Platform-dependent SRCS for google3-default Android. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 317 | BASE_SRCS_ANDROID = struct( |
| 318 | include = [ |
Brian Salomon | b3ce76e | 2017-12-11 15:21:39 -0500 | [diff] [blame] | 319 | "src/gpu/gl/GrGLMakeNativeInterface_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 320 | # TODO(benjaminwagner): Figure out how to compile with EGL. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 321 | "src/ports/**/*.cpp", |
| 322 | "src/ports/**/*.h", |
| 323 | ], |
| 324 | exclude = [ |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 325 | "src/ports/*CG*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 326 | "src/ports/*FontConfig*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 327 | "src/ports/*WIC*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 328 | "src/ports/*chromium*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 329 | "src/ports/*fontconfig*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 330 | "src/ports/*mac*", |
| 331 | "src/ports/*mozalloc*", |
| 332 | "src/ports/*nacl*", |
| 333 | "src/ports/*win*", |
| 334 | "src/ports/SkDebug_stdio.cpp", |
| 335 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 336 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 337 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 338 | "src/ports/SkFontMgr_empty_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 339 | "src/ports/SkGlobalInitialization_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 340 | "src/ports/SkImageGenerator_none.cpp", |
| 341 | "src/ports/SkTLS_none.cpp", |
| 342 | ], |
| 343 | ) |
| 344 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 345 | # Platform-dependent SRCS for google3-default iOS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 346 | BASE_SRCS_IOS = struct( |
| 347 | include = [ |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 348 | "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 349 | "src/ports/**/*.cpp", |
| 350 | "src/ports/**/*.h", |
iroth | ab669de | 2016-02-16 19:17:01 -0800 | [diff] [blame] | 351 | "src/utils/mac/*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 352 | ], |
| 353 | exclude = [ |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 354 | "src/ports/*FontConfig*", |
| 355 | "src/ports/*FreeType*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 356 | "src/ports/*WIC*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 357 | "src/ports/*android*", |
| 358 | "src/ports/*chromium*", |
| 359 | "src/ports/*fontconfig*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 360 | "src/ports/*mozalloc*", |
| 361 | "src/ports/*nacl*", |
| 362 | "src/ports/*win*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 363 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 364 | "src/ports/SkFontMgr_custom_directory.cpp", |
| 365 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 366 | "src/ports/SkFontMgr_custom_empty.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 367 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 368 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 369 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 370 | "src/ports/SkFontMgr_empty_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 371 | "src/ports/SkGlobalInitialization_none.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 372 | "src/ports/SkImageGenerator_none.cpp", |
| 373 | "src/ports/SkTLS_none.cpp", |
| 374 | ], |
| 375 | ) |
| 376 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 377 | ################################################################################ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 378 | ## skia_srcs() |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 379 | ################################################################################ |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 380 | def skia_srcs(os_conditions): |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 381 | """Sources to be compiled into the skia library.""" |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 382 | return skia_glob(BASE_SRCS_ALL) + skia_select( |
| 383 | os_conditions, |
| 384 | [ |
| 385 | skia_glob(BASE_SRCS_UNIX), |
| 386 | skia_glob(BASE_SRCS_ANDROID), |
| 387 | skia_glob(BASE_SRCS_IOS), |
| 388 | ], |
| 389 | ) |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 390 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 391 | ################################################################################ |
| 392 | ## INCLUDES |
| 393 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 394 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 395 | # Includes needed by Skia implementation. Not public includes. |
| 396 | INCLUDES = [ |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 397 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 398 | "include/c", |
| 399 | "include/codec", |
| 400 | "include/config", |
| 401 | "include/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 402 | "include/effects", |
Matt Sarett | d7093c2 | 2017-05-09 15:28:32 -0400 | [diff] [blame] | 403 | "include/encode", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 404 | "include/gpu", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 405 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 406 | "include/ports", |
| 407 | "include/private", |
| 408 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 409 | "include/utils/mac", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 410 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 411 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 412 | "src/gpu", |
| 413 | "src/image", |
Mike Klein | 135a1b1 | 2017-08-15 13:13:59 -0400 | [diff] [blame] | 414 | "src/images", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 415 | "src/lazy", |
| 416 | "src/opts", |
| 417 | "src/pdf", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 418 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 419 | "src/sfnt", |
Florin Malita | 5edba45 | 2017-05-30 16:39:47 -0400 | [diff] [blame] | 420 | "src/shaders", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 421 | "src/sksl", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 422 | "src/utils", |
Ben Wagner | d0a3b06 | 2016-10-24 14:11:12 -0400 | [diff] [blame] | 423 | "third_party/gif", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 424 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 425 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 426 | ################################################################################ |
| 427 | ## DM_SRCS |
| 428 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 429 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 430 | DM_SRCS_ALL = struct( |
| 431 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 432 | "dm/*.cpp", |
| 433 | "dm/*.h", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 434 | "experimental/svg/model/*.cpp", |
| 435 | "experimental/svg/model/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 436 | "gm/*.c", |
| 437 | "gm/*.cpp", |
| 438 | "gm/*.h", |
Ben Wagner | 4ccf49c | 2018-03-26 15:46:40 -0400 | [diff] [blame] | 439 | "src/xml/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 440 | "tests/*.cpp", |
| 441 | "tests/*.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 442 | "tools/ios_utils.h", |
| 443 | "tools/BinaryAsset.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 444 | "tools/BigPathBench.inc", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 445 | "tools/CrashHandler.cpp", |
| 446 | "tools/CrashHandler.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 447 | "tools/ProcStats.cpp", |
| 448 | "tools/ProcStats.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 449 | "tools/Registry.h", |
| 450 | "tools/ResourceFactory.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 451 | "tools/Resources.cpp", |
| 452 | "tools/Resources.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 453 | "tools/SkJSONCPP.h", |
| 454 | "tools/UrlDataManager.cpp", |
| 455 | "tools/UrlDataManager.h", |
| 456 | "tools/debugger/*.cpp", |
| 457 | "tools/debugger/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 458 | "tools/flags/*.cpp", |
| 459 | "tools/flags/*.h", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 460 | "tools/fonts/SkRandomScalerContext.cpp", |
| 461 | "tools/fonts/SkRandomScalerContext.h", |
| 462 | "tools/fonts/SkTestFontMgr.cpp", |
| 463 | "tools/fonts/SkTestFontMgr.h", |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 464 | "tools/fonts/SkTestSVGTypeface.cpp", |
| 465 | "tools/fonts/SkTestSVGTypeface.h", |
| 466 | "tools/fonts/SkTestTypeface.cpp", |
| 467 | "tools/fonts/SkTestTypeface.h", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 468 | "tools/fonts/sk_tool_utils_font.cpp", |
| 469 | "tools/fonts/test_font_monospace.inc", |
| 470 | "tools/fonts/test_font_sans_serif.inc", |
| 471 | "tools/fonts/test_font_serif.inc", |
| 472 | "tools/fonts/test_font_index.inc", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 473 | "tools/gpu/**/*.cpp", |
| 474 | "tools/gpu/**/*.h", |
brianosman | 6d3119c | 2016-04-19 19:41:54 -0700 | [diff] [blame] | 475 | "tools/picture_utils.cpp", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 476 | "tools/picture_utils.h", |
mtklein | e1fc452 | 2016-02-09 12:32:52 -0800 | [diff] [blame] | 477 | "tools/random_parse_path.cpp", |
| 478 | "tools/random_parse_path.h", |
Ben Wagner | fb4487b | 2018-03-26 17:48:09 -0400 | [diff] [blame] | 479 | "tools/sk_pixel_iter.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 480 | "tools/sk_tool_utils.cpp", |
| 481 | "tools/sk_tool_utils.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 482 | "tools/timer/*.cpp", |
| 483 | "tools/timer/*.h", |
Brian Salomon | 40d0119 | 2017-07-19 13:05:11 -0400 | [diff] [blame] | 484 | "tools/trace/*.cpp", |
| 485 | "tools/trace/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 486 | ], |
| 487 | exclude = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 488 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 489 | "tests/skia_test.cpp", # Old main. |
Brian Salomon | f9ec470 | 2017-11-19 14:46:36 -0500 | [diff] [blame] | 490 | "tools/gpu/atlastext/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 491 | "tools/gpu/gl/angle/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 492 | "tools/gpu/gl/egl/*", |
| 493 | "tools/gpu/gl/glx/*", |
| 494 | "tools/gpu/gl/iOS/*", |
| 495 | "tools/gpu/gl/mac/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 496 | "tools/gpu/gl/win/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 497 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 498 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 499 | ], |
| 500 | ) |
| 501 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 502 | ################################################################################ |
| 503 | ## dm_srcs() |
| 504 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 505 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 506 | def dm_srcs(os_conditions): |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 507 | """Sources for the dm binary for the specified os.""" |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 508 | return skia_glob(DM_SRCS_ALL) + skia_select( |
| 509 | os_conditions, |
| 510 | [ |
| 511 | [], |
| 512 | ["tests/FontMgrAndroidParserTest.cpp"], |
| 513 | [], |
| 514 | ], |
| 515 | ) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 516 | |
| 517 | ################################################################################ |
| 518 | ## DM_INCLUDES |
| 519 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 520 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 521 | DM_INCLUDES = [ |
benjaminwagner | b1fe8f6 | 2016-02-01 09:05:08 -0800 | [diff] [blame] | 522 | "dm", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 523 | "gm", |
Mike Reed | 7f302c4 | 2017-02-18 14:12:08 -0500 | [diff] [blame] | 524 | "experimental/svg/model", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 525 | "src/codec", |
Mike Reed | aab8ce4 | 2017-02-18 12:57:09 -0500 | [diff] [blame] | 526 | "src/core", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 527 | "src/effects", |
| 528 | "src/fonts", |
Hal Canary | db68301 | 2016-11-23 08:55:18 -0700 | [diff] [blame] | 529 | "src/images", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 530 | "src/pathops", |
| 531 | "src/pipe/utils", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 532 | "src/ports", |
Florin Malita | 5edba45 | 2017-05-30 16:39:47 -0400 | [diff] [blame] | 533 | "src/shaders", |
| 534 | "src/shaders/gradients", |
Mike Reed | f71828f | 2017-02-18 09:51:33 -0500 | [diff] [blame] | 535 | "src/xml", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 536 | "tests", |
| 537 | "tools", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 538 | "tools/debugger", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 539 | "tools/flags", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 540 | "tools/fonts", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 541 | "tools/gpu", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 542 | "tools/timer", |
Brian Salomon | 40d0119 | 2017-07-19 13:05:11 -0400 | [diff] [blame] | 543 | "tools/trace", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 544 | ] |
| 545 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 546 | ################################################################################ |
| 547 | ## DM_ARGS |
| 548 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 549 | |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 550 | def DM_ARGS(asan): |
benjaminwagner | 83906ae | 2016-05-01 15:02:25 -0700 | [diff] [blame] | 551 | source = ["tests", "gm", "image"] |
Ben Wagner | e2cbd04 | 2017-08-11 09:39:04 -0400 | [diff] [blame] | 552 | # TODO(benjaminwagner): f16, pic-8888, serialize-8888, and tiles_rt-8888 fail. |
| 553 | config = ["565", "8888", "pdf", "srgb"] |
Ben Wagner | aa567ab | 2018-03-07 10:36:27 -0500 | [diff] [blame] | 554 | return ["--src"] + source + ["--config"] + config + ["--nonativeFonts"] |
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): |
| 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", |
Mike Klein | 1b6eb99 | 2018-04-16 15:28:37 -0400 | [diff] [blame] | 569 | # TODO(kjlubick) |
| 570 | "-Wno-self-assign", # Spurious warning in tests/PathOpsDVectorTest.cpp? |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 571 | ], |
| 572 | # ANDROID |
| 573 | [ |
| 574 | # 'GrResourceCache' declared with greater visibility than the |
| 575 | # type of its field 'GrResourceCache::fPurgeableQueue'... bogus. |
| 576 | "-Wno-error=attributes", |
| 577 | ], |
| 578 | # IOS |
| 579 | [], |
| 580 | ], |
| 581 | ) |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 582 | |
| 583 | ################################################################################ |
| 584 | ## DEFINES |
| 585 | ################################################################################ |
| 586 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 587 | def base_defines(os_conditions): |
| 588 | return [ |
| 589 | # Chrome DEFINES. |
| 590 | "SK_USE_FREETYPE_EMBOLDEN", |
| 591 | # Turn on a few Google3-specific build fixes. |
Mike Klein | 6613cc5 | 2017-12-19 09:09:33 -0500 | [diff] [blame] | 592 | "SK_BUILD_FOR_GOOGLE3", |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 593 | # Required for building dm. |
| 594 | "GR_TEST_UTILS", |
| 595 | # Staging flags for API changes |
| 596 | # Should remove after we update golden images |
| 597 | "SK_WEBP_ENCODER_USE_DEFAULT_METHOD", |
| 598 | # Experiment to diagnose image diffs in Google3 |
| 599 | "SK_JUMPER_DISABLE_8BIT", |
| 600 | # JPEG is in codec_limited |
| 601 | "SK_HAS_JPEG_LIBRARY", |
| 602 | ] + skia_select( |
| 603 | os_conditions, |
| 604 | [ |
| 605 | # UNIX |
| 606 | [ |
| 607 | "PNG_SKIP_SETJMP_CHECK", |
| 608 | "SK_BUILD_FOR_UNIX", |
| 609 | "SK_SAMPLES_FOR_X", |
| 610 | "SK_PDF_USE_SFNTLY", |
| 611 | "SK_CODEC_DECODES_RAW", |
| 612 | "SK_HAS_PNG_LIBRARY", |
| 613 | "SK_HAS_WEBP_LIBRARY", |
| 614 | ], |
| 615 | # ANDROID |
| 616 | [ |
| 617 | "SK_BUILD_FOR_ANDROID", |
| 618 | "SK_CODEC_DECODES_RAW", |
| 619 | "SK_HAS_PNG_LIBRARY", |
| 620 | "SK_HAS_WEBP_LIBRARY", |
| 621 | ], |
| 622 | # IOS |
| 623 | [ |
| 624 | "SK_BUILD_FOR_IOS", |
| 625 | "SK_BUILD_NO_OPTS", |
| 626 | "SKNX_NO_SIMD", |
| 627 | ], |
| 628 | ], |
| 629 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 630 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 631 | ################################################################################ |
| 632 | ## LINKOPTS |
| 633 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 634 | |
Ben Wagner | 9eca72b | 2017-10-17 10:57:34 -0400 | [diff] [blame] | 635 | def base_linkopts(os_conditions): |
| 636 | return [ |
| 637 | "-ldl", |
| 638 | ] + skia_select( |
| 639 | os_conditions, |
| 640 | [ |
| 641 | # UNIX |
| 642 | [], |
| 643 | # ANDROID |
| 644 | [ |
| 645 | "-lEGL", |
| 646 | ], |
| 647 | # IOS |
| 648 | [ |
| 649 | "-framework CoreFoundation", |
| 650 | "-framework CoreGraphics", |
| 651 | "-framework CoreText", |
| 652 | "-framework ImageIO", |
| 653 | "-framework MobileCoreServices", |
| 654 | ], |
| 655 | ] |
| 656 | ) |