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