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 | ################################################################################ |
| 55 | ## BASE_SRCS |
| 56 | ################################################################################ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 57 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 58 | # All platform-independent SRCS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 59 | BASE_SRCS_ALL = struct( |
| 60 | include = [ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 61 | "include/private/**/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 62 | "src/**/*.h", |
| 63 | "src/**/*.cpp", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 64 | "src/**/*.inc", |
Mike Klein | 0a64e32 | 2017-03-29 17:32:50 -0400 | [diff] [blame] | 65 | "src/jumper/SkJumper_generated.S", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 66 | |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 67 | # Third Party |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 68 | "third_party/etc1/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 69 | "third_party/etc1/*.h", |
Ben Wagner | d0a3b06 | 2016-10-24 14:11:12 -0400 | [diff] [blame] | 70 | "third_party/gif/*.cpp", |
| 71 | "third_party/gif/*.h", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 72 | ], |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 73 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 74 | # Exclude platform-dependent files. |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 75 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 76 | "src/codec/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 77 | "src/device/xps/*", # Windows-only. Move to ports? |
| 78 | "src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
| 79 | "src/gpu/gl/android/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 80 | "src/gpu/gl/egl/*", |
benjaminwagner | af3b35e | 2016-03-28 13:27:28 -0700 | [diff] [blame] | 81 | "src/gpu/gl/glfw/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 82 | "src/gpu/gl/glx/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 83 | "src/gpu/gl/iOS/*", |
| 84 | "src/gpu/gl/mac/*", |
| 85 | "src/gpu/gl/win/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 86 | "src/images/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 87 | "src/opts/**/*", |
| 88 | "src/ports/**/*", |
| 89 | "src/utils/android/**/*", |
| 90 | "src/utils/mac/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 91 | "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? |
| 92 | "src/utils/win/**/*", |
| 93 | "src/views/sdl/*", |
| 94 | "src/views/win/*", |
| 95 | "src/views/unix/*", |
| 96 | |
| 97 | # Exclude multiple definitions. |
| 98 | # TODO(mtklein): Move to opts? |
benjaminwagner | ca26a18 | 2016-03-14 15:21:12 -0700 | [diff] [blame] | 99 | "src/pdf/SkDocument_PDF_None.cpp", # We use src/pdf/SkPDFDocument.cpp. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 100 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
| 101 | "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 102 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 103 | |
| 104 | # Exclude files that don't compile with the current DEFINES. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 105 | "src/gpu/gl/mesa/*", # Requires SK_MESA define. |
benjaminwagner | 921e48b | 2016-07-15 11:27:27 -0700 | [diff] [blame] | 106 | "src/svg/**/*", # Depends on XML. |
| 107 | "src/xml/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 108 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 109 | # Conflicting dependencies among Lua versions. See cl/107087297. |
| 110 | "src/utils/SkLua*", |
| 111 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 112 | # Not used. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 113 | "src/views/**/*", |
egdaniel | 32119f1 | 2016-02-22 10:07:54 -0800 | [diff] [blame] | 114 | |
| 115 | # Currently exclude all vulkan specific files |
| 116 | "src/gpu/vk/*", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 117 | |
| 118 | # Defines main. |
| 119 | "src/sksl/SkSLMain.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 120 | ], |
| 121 | ) |
| 122 | |
| 123 | # Platform-dependent SRCS for google3-default platform. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 124 | BASE_SRCS_UNIX = struct( |
| 125 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 126 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 127 | "src/codec/*", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 128 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 129 | "src/images/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 130 | "src/opts/**/*.cpp", |
| 131 | "src/opts/**/*.h", |
| 132 | "src/ports/**/*.cpp", |
| 133 | "src/ports/**/*.h", |
| 134 | ], |
| 135 | exclude = [ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 136 | "src/opts/opts_check_x86.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 137 | "src/opts/*arm*", |
| 138 | "src/opts/*mips*", |
| 139 | "src/opts/*NEON*", |
| 140 | "src/opts/*neon*", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 141 | # Included in :opts_sse2 library. |
| 142 | "src/opts/*SSE2*", |
| 143 | "src/opts/*sse2*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 144 | # Included in :opts_ssse3 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 145 | "src/opts/*SSSE3*", |
| 146 | "src/opts/*ssse3*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 147 | # Included in :opts_sse4 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 148 | "src/opts/*SSE4*", |
| 149 | "src/opts/*sse4*", |
Mike Klein | 7147505 | 2016-09-30 11:34:54 -0400 | [diff] [blame] | 150 | # Included in :opts_avx or :opts_hsw |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 151 | "src/opts/*avx*", |
Mike Klein | 7147505 | 2016-09-30 11:34:54 -0400 | [diff] [blame] | 152 | "src/opts/*hsw*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 153 | "src/opts/SkBitmapProcState_opts_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 154 | "src/opts/SkBlitMask_opts_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 155 | "src/opts/SkBlitRow_opts_none.cpp", |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 156 | "src/ports/*CG*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 157 | "src/ports/*WIC*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 158 | "src/ports/*android*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 159 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 160 | "src/ports/*mac*", |
| 161 | "src/ports/*mozalloc*", |
| 162 | "src/ports/*nacl*", |
| 163 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 164 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 165 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 166 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 167 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 404816e | 2015-12-03 05:04:03 -0800 | [diff] [blame] | 168 | "src/ports/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 169 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 170 | "src/ports/SkGlobalInitialization_none.cpp", |
msarett | c1d0312 | 2016-03-25 08:58:55 -0700 | [diff] [blame] | 171 | "src/ports/SkImageEncoder_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 172 | "src/ports/SkImageGenerator_none.cpp", |
| 173 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 174 | ], |
| 175 | ) |
| 176 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 177 | # Platform-dependent SRCS for google3-default Android. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 178 | BASE_SRCS_ANDROID = struct( |
| 179 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 180 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 181 | "src/codec/*", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 182 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 183 | "src/images/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 184 | # TODO(benjaminwagner): Figure out how to compile with EGL. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 185 | "src/opts/**/*.cpp", |
| 186 | "src/opts/**/*.h", |
| 187 | "src/ports/**/*.cpp", |
| 188 | "src/ports/**/*.h", |
| 189 | ], |
| 190 | exclude = [ |
| 191 | "src/opts/*mips*", |
| 192 | "src/opts/*SSE2*", |
| 193 | "src/opts/*SSSE3*", |
| 194 | "src/opts/*ssse3*", |
| 195 | "src/opts/*SSE4*", |
| 196 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 197 | "src/opts/*avx*", |
Mike Klein | fb2c633 | 2017-01-26 14:40:53 -0500 | [diff] [blame] | 198 | "src/opts/*hsw*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 199 | "src/opts/*x86*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 200 | "src/opts/SkBlitMask_opts_none.cpp", |
| 201 | "src/opts/SkBlitRow_opts_none.cpp", |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 202 | "src/ports/*CG*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 203 | "src/ports/*FontConfig*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 204 | "src/ports/*WIC*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 205 | "src/ports/*chromium*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 206 | "src/ports/*fontconfig*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 207 | "src/ports/*mac*", |
| 208 | "src/ports/*mozalloc*", |
| 209 | "src/ports/*nacl*", |
| 210 | "src/ports/*win*", |
| 211 | "src/ports/SkDebug_stdio.cpp", |
| 212 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 213 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 214 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 215 | "src/ports/SkFontMgr_empty_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 216 | "src/ports/SkGlobalInitialization_none.cpp", |
msarett | c1d0312 | 2016-03-25 08:58:55 -0700 | [diff] [blame] | 217 | "src/ports/SkImageEncoder_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 218 | "src/ports/SkImageGenerator_none.cpp", |
| 219 | "src/ports/SkTLS_none.cpp", |
| 220 | ], |
| 221 | ) |
| 222 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 223 | # Platform-dependent SRCS for google3-default iOS. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 224 | BASE_SRCS_IOS = struct( |
| 225 | include = [ |
msarett | 2775cf5 | 2016-02-17 14:14:25 -0800 | [diff] [blame] | 226 | "src/android/*", |
| 227 | "src/codec/*", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 228 | "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
| 229 | "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 230 | "src/opts/**/*.cpp", |
| 231 | "src/opts/**/*.h", |
| 232 | "src/ports/**/*.cpp", |
| 233 | "src/ports/**/*.h", |
iroth | ab669de | 2016-02-16 19:17:01 -0800 | [diff] [blame] | 234 | "src/utils/mac/*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 235 | ], |
| 236 | exclude = [ |
msarett | 2775cf5 | 2016-02-17 14:14:25 -0800 | [diff] [blame] | 237 | "src/codec/*Ico*.cpp", |
msarett | 2775cf5 | 2016-02-17 14:14:25 -0800 | [diff] [blame] | 238 | "src/codec/*Webp*.cpp", |
| 239 | "src/codec/*Png*", |
| 240 | "src/codec/*Raw*.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 241 | "src/opts/*mips*", |
| 242 | "src/opts/*NEON*", |
| 243 | "src/opts/*neon*", |
| 244 | "src/opts/*SSE2*", |
| 245 | "src/opts/*SSSE3*", |
| 246 | "src/opts/*ssse3*", |
| 247 | "src/opts/*SSE4*", |
| 248 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 249 | "src/opts/*avx*", |
Mike Klein | fb2c633 | 2017-01-26 14:40:53 -0500 | [diff] [blame] | 250 | "src/opts/*hsw*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 251 | "src/opts/*x86*", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 252 | "src/opts/SkBlitMask_opts_arm*.cpp", |
| 253 | "src/opts/SkBlitRow_opts_arm*.cpp", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 254 | "src/ports/*CG*", |
| 255 | "src/ports/*FontConfig*", |
| 256 | "src/ports/*FreeType*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 257 | "src/ports/*WIC*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 258 | "src/ports/*android*", |
| 259 | "src/ports/*chromium*", |
| 260 | "src/ports/*fontconfig*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 261 | "src/ports/*mozalloc*", |
| 262 | "src/ports/*nacl*", |
| 263 | "src/ports/*win*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 264 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 265 | "src/ports/SkFontMgr_custom_directory.cpp", |
| 266 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 267 | "src/ports/SkFontMgr_custom_empty.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 268 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 269 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 270 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 271 | "src/ports/SkFontMgr_empty_factory.cpp", |
Mike Klein | 4b698cb | 2017-02-09 15:28:53 -0500 | [diff] [blame] | 272 | "src/ports/SkGlobalInitialization_none.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 273 | "src/ports/SkImageGenerator_none.cpp", |
| 274 | "src/ports/SkTLS_none.cpp", |
| 275 | ], |
| 276 | ) |
| 277 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 278 | ################################################################################ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 279 | ## skia_{all,public}_hdrs() |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 280 | ################################################################################ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 281 | def skia_all_hdrs(): |
| 282 | return native.glob(["src/**/*.h", "include/**/*.h"]) |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 283 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 284 | def skia_public_hdrs(): |
| 285 | return native.glob(["include/**/*.h"], |
| 286 | exclude=[ |
| 287 | "include/private/**/*.h", |
| 288 | "include/views/**/*", # Not used. |
| 289 | ]) |
| 290 | |
| 291 | ################################################################################ |
| 292 | ## skia_opts_srcs() |
| 293 | ################################################################################ |
| 294 | # Intel |
| 295 | SKIA_OPTS_SSE2 = "SSE2" |
| 296 | |
| 297 | SKIA_OPTS_SSSE3 = "SSSE3" |
| 298 | |
| 299 | SKIA_OPTS_SSE4 = "SSE4" |
| 300 | |
| 301 | SKIA_OPTS_AVX = "AVX" |
| 302 | |
| 303 | SKIA_OPTS_HSW = "HSW" |
| 304 | |
| 305 | # Arm |
| 306 | SKIA_OPTS_ARMV7 = "ARMV7" |
| 307 | |
| 308 | SKIA_OPTS_NEON = "NEON" |
| 309 | |
| 310 | SKIA_OPTS_ARM64 = "ARM64" |
| 311 | |
| 312 | SKIA_OPTS_CRC32 = "CRC32" # arm64 |
| 313 | |
| 314 | # Other |
| 315 | SKIA_OPTS_NONE = "NONE" # not x86, arm, or arm64 |
| 316 | |
| 317 | def skia_opts_srcs(opts): |
| 318 | if opts == SKIA_OPTS_SSE2: |
| 319 | return native.glob([ |
| 320 | "src/opts/*SSE2*.cpp", |
| 321 | "src/opts/*sse2*.cpp", |
| 322 | ]) |
| 323 | elif opts == SKIA_OPTS_SSSE3: |
| 324 | return native.glob([ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 325 | "src/opts/*SSSE3*.cpp", |
| 326 | "src/opts/*ssse3*.cpp", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 327 | ]) |
| 328 | elif opts == SKIA_OPTS_SSE4: |
| 329 | return native.glob([ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 330 | "src/opts/*SSE4*.cpp", |
| 331 | "src/opts/*sse4*.cpp", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 332 | ]) |
| 333 | elif opts == SKIA_OPTS_AVX: |
| 334 | return native.glob([ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 335 | "src/opts/*_avx.cpp", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 336 | ]) |
| 337 | elif opts == SKIA_OPTS_HSW: |
| 338 | return native.glob([ |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 339 | "src/opts/*_hsw.cpp", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 340 | ]) |
| 341 | elif opts == SKIA_OPTS_ARMV7: |
| 342 | return native.glob([ |
| 343 | "src/opts/*_arm.cpp", |
| 344 | ]) |
| 345 | elif opts == SKIA_OPTS_NEON: |
| 346 | return native.glob([ |
| 347 | "src/opts/*_neon.cpp", |
| 348 | ]) |
| 349 | elif opts == SKIA_OPTS_CRC32: |
| 350 | return native.glob([ |
| 351 | "src/opts/*_crc32.cpp", |
| 352 | ]) |
| 353 | elif opts == SKIA_OPTS_NONE: |
| 354 | return native.glob([ |
| 355 | "src/opts/*_none.cpp", |
| 356 | ]) |
| 357 | else: |
| 358 | fail("skia_opts_srcs parameter 'opts' must be one of SKIA_OPTS_*.") |
| 359 | |
| 360 | def skia_opts_cflags(opts): |
| 361 | if opts == SKIA_OPTS_SSE2: |
| 362 | return ["-msse2"] |
| 363 | elif opts == SKIA_OPTS_SSSE3: |
| 364 | return ["-mssse3"] |
| 365 | elif opts == SKIA_OPTS_SSE4: |
| 366 | return ["-msse4"] |
| 367 | elif opts == SKIA_OPTS_AVX: |
| 368 | return ["-mavx"] |
| 369 | elif opts == SKIA_OPTS_HSW: |
| 370 | return ["-mavx2", "-mbmi", "-mbmi2", "-mf16c", "-mfma"] |
| 371 | elif opts == SKIA_OPTS_CRC32: |
| 372 | return ["-march=armv8-a+crc"] |
| 373 | else: |
| 374 | return [] |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 375 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 376 | ################################################################################ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 377 | ## skia_srcs() |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 378 | ################################################################################ |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 379 | SKIA_OS_UNIX = "UNIX" |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 380 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 381 | SKIA_OS_ANDROID = "ANDROID" |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 382 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 383 | SKIA_OS_IOS = "IOS" |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 384 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 385 | SKIA_CPU_UNSPECIFIED = "UNSPECIFIED" |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 386 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 387 | SKIA_CPU_PPC = "PPC" |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 388 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 389 | def skia_srcs(os=SKIA_OS_UNIX, cpu=SKIA_CPU_UNSPECIFIED): |
| 390 | """Sources to be compiled into the skia library.""" |
| 391 | srcs = skia_glob(BASE_SRCS_ALL) |
| 392 | if os == SKIA_OS_IOS: |
| 393 | if cpu != SKIA_CPU_UNSPECIFIED: |
| 394 | fail("Do not specify IOS and a cpu.") |
| 395 | srcs = srcs + skia_glob(BASE_SRCS_IOS) |
| 396 | elif os == SKIA_OS_ANDROID: |
| 397 | if cpu != SKIA_CPU_UNSPECIFIED: |
| 398 | fail("Do not specify ANDROID and a cpu.") |
| 399 | srcs = srcs + skia_glob(BASE_SRCS_ANDROID) |
| 400 | elif os == SKIA_OS_UNIX: |
| 401 | if cpu == SKIA_CPU_UNSPECIFIED: |
| 402 | srcs = srcs + ["src/opts/opts_check_x86.cpp"] + skia_glob(BASE_SRCS_UNIX) |
| 403 | elif cpu == SKIA_CPU_PPC: |
| 404 | srcs = srcs + skia_glob(BASE_SRCS_UNIX) |
| 405 | else: |
| 406 | fail("cpu must be one of SKIA_CPU_*") |
| 407 | else: |
| 408 | fail("skia_srcs parameter 'os' must be one of SKIA_OS_{UNIX,ANDROID,IOS}.") |
| 409 | return srcs |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 410 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 411 | ################################################################################ |
| 412 | ## INCLUDES |
| 413 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 414 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 415 | # Includes needed by Skia implementation. Not public includes. |
| 416 | INCLUDES = [ |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 417 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 418 | "include/c", |
robertphillips | 188d44c | 2016-02-01 04:54:14 -0800 | [diff] [blame] | 419 | "include/client/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 420 | "include/codec", |
| 421 | "include/config", |
| 422 | "include/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 423 | "include/effects", |
| 424 | "include/gpu", |
| 425 | "include/images", |
| 426 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 427 | "include/pipe", |
| 428 | "include/ports", |
| 429 | "include/private", |
| 430 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 431 | "include/utils/mac", |
| 432 | "include/utils/win", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 433 | "include/svg", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 434 | "include/xml", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 435 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 436 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 437 | "src/gpu", |
| 438 | "src/image", |
| 439 | "src/lazy", |
| 440 | "src/opts", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 441 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 442 | "src/pdf", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 443 | "src/sfnt", |
benjaminwagner | c896251 | 2016-09-30 12:06:27 -0700 | [diff] [blame] | 444 | "src/sksl", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 445 | "src/utils", |
| 446 | "third_party/etc1", |
Ben Wagner | d0a3b06 | 2016-10-24 14:11:12 -0400 | [diff] [blame] | 447 | "third_party/gif", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 448 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 449 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 450 | ################################################################################ |
| 451 | ## DM_SRCS |
| 452 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 453 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 454 | DM_SRCS_ALL = struct( |
| 455 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 456 | "dm/*.cpp", |
| 457 | "dm/*.h", |
| 458 | "gm/*.c", |
| 459 | "gm/*.cpp", |
| 460 | "gm/*.h", |
| 461 | "tests/*.cpp", |
| 462 | "tests/*.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 463 | "tools/BigPathBench.inc", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 464 | "tools/CrashHandler.cpp", |
| 465 | "tools/CrashHandler.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 466 | "tools/ProcStats.cpp", |
| 467 | "tools/ProcStats.h", |
| 468 | "tools/Resources.cpp", |
| 469 | "tools/Resources.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 470 | "tools/SkJSONCPP.h", |
| 471 | "tools/UrlDataManager.cpp", |
| 472 | "tools/UrlDataManager.h", |
| 473 | "tools/debugger/*.cpp", |
| 474 | "tools/debugger/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 475 | "tools/flags/*.cpp", |
| 476 | "tools/flags/*.h", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 477 | "tools/gpu/**/*.cpp", |
| 478 | "tools/gpu/**/*.h", |
brianosman | 6d3119c | 2016-04-19 19:41:54 -0700 | [diff] [blame] | 479 | "tools/picture_utils.cpp", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 480 | "tools/picture_utils.h", |
mtklein | e1fc452 | 2016-02-09 12:32:52 -0800 | [diff] [blame] | 481 | "tools/random_parse_path.cpp", |
| 482 | "tools/random_parse_path.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 483 | "tools/sk_tool_utils.cpp", |
| 484 | "tools/sk_tool_utils.h", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 485 | "tools/sk_tool_utils_flags.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 486 | "tools/sk_tool_utils_font.cpp", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 487 | "tools/test_font_monospace.inc", |
| 488 | "tools/test_font_sans_serif.inc", |
| 489 | "tools/test_font_serif.inc", |
| 490 | "tools/test_font_index.inc", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 491 | "tools/timer/*.cpp", |
| 492 | "tools/timer/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 493 | ], |
| 494 | exclude = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 495 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 496 | "tests/skia_test.cpp", # Old main. |
| 497 | "tests/SkpSkGrTest.cpp", # Alternate main. |
benjaminwagner | 921e48b | 2016-07-15 11:27:27 -0700 | [diff] [blame] | 498 | "tests/SVGDeviceTest.cpp", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 499 | "tools/gpu/gl/angle/*", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 500 | "tools/gpu/gl/egl/*", |
| 501 | "tools/gpu/gl/glx/*", |
| 502 | "tools/gpu/gl/iOS/*", |
| 503 | "tools/gpu/gl/mac/*", |
| 504 | "tools/gpu/gl/mesa/*", |
| 505 | "tools/gpu/gl/win/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 506 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 507 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 508 | ], |
| 509 | ) |
| 510 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 511 | ################################################################################ |
| 512 | ## dm_srcs() |
| 513 | ################################################################################ |
| 514 | # SKIA_OS_* definitions can be found above. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 515 | |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 516 | def dm_srcs(os): |
| 517 | """Sources for the dm binary for the specified os.""" |
| 518 | srcs = skia_glob(DM_SRCS_ALL) |
| 519 | # TODO(benjaminwagner): None of the CreatePlatformGLContext_*.cpp files exist. |
| 520 | # TODO(jwg): Remove the globs if possible, they only select single files. |
| 521 | if os == SKIA_OS_IOS: |
| 522 | srcs = srcs + native.glob(["tools/gpu/iOS/CreatePlatformGLContext_iOS.cpp"]) |
| 523 | elif os == SKIA_OS_ANDROID: |
| 524 | srcs = srcs + native.glob([ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 525 | "tests/FontMgrAndroidParserTest.cpp", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 526 | # TODO(benjaminwagner): Figure out how to compile with EGL. |
| 527 | "tools/gpu/gl/CreatePlatformGLContext_none.cpp", |
Ben Wagner | dea7428 | 2017-03-16 19:15:09 -0400 | [diff] [blame] | 528 | ]) |
| 529 | elif os == SKIA_OS_UNIX: |
| 530 | srcs = srcs + native.glob(["tools/gpu/gl/CreatePlatformGLContext_none.cpp"]) |
| 531 | else: |
| 532 | fail("dm_srcs parameter 'os' must be one of SKIA_OS_{UNIX,ANDROID,IOS}.") |
| 533 | return srcs |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 534 | |
| 535 | ################################################################################ |
| 536 | ## DM_INCLUDES |
| 537 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 538 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 539 | DM_INCLUDES = [ |
benjaminwagner | b1fe8f6 | 2016-02-01 09:05:08 -0800 | [diff] [blame] | 540 | "dm", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 541 | "gm", |
Mike Reed | 7f302c4 | 2017-02-18 14:12:08 -0500 | [diff] [blame] | 542 | "experimental/svg/model", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 543 | "src/codec", |
Mike Reed | aab8ce4 | 2017-02-18 12:57:09 -0500 | [diff] [blame] | 544 | "src/core", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 545 | "src/effects", |
benjaminwagner | bc9a9b4 | 2016-02-22 13:30:39 -0800 | [diff] [blame] | 546 | "src/effects/gradients", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 547 | "src/fonts", |
Hal Canary | db68301 | 2016-11-23 08:55:18 -0700 | [diff] [blame] | 548 | "src/images", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 549 | "src/pathops", |
| 550 | "src/pipe/utils", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 551 | "src/ports", |
Mike Reed | f71828f | 2017-02-18 09:51:33 -0500 | [diff] [blame] | 552 | "src/xml", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 553 | "tests", |
| 554 | "tools", |
benjaminwagner | 99fb670 | 2016-07-28 15:12:21 -0700 | [diff] [blame] | 555 | "tools/debugger", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 556 | "tools/flags", |
benjaminwagner | 38d68bc | 2016-04-01 05:00:51 -0700 | [diff] [blame] | 557 | "tools/gpu", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 558 | "tools/timer", |
| 559 | ] |
| 560 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 561 | ################################################################################ |
| 562 | ## DM_ARGS |
| 563 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 564 | |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 565 | def DM_ARGS(asan): |
benjaminwagner | 83906ae | 2016-05-01 15:02:25 -0700 | [diff] [blame] | 566 | source = ["tests", "gm", "image"] |
| 567 | # TODO(benjaminwagner): f16 and serialize-8888 fail. |
| 568 | config = ["565", "8888", "pdf", "srgb", "tiles_rt", "pic"] |
| 569 | # TODO(mtklein): maybe investigate why these fail? |
| 570 | match = [ |
| 571 | "~Canvas", |
| 572 | "~Codec", |
| 573 | "~Codec_Dimensions", |
| 574 | "~Codec_stripes", |
| 575 | "~FontMgr", |
| 576 | "~PaintBreakText", |
| 577 | "~RecordDraw_TextBounds", |
| 578 | "~Scalar", |
| 579 | "~skps", |
| 580 | "~Stream", |
| 581 | ] |
| 582 | if asan: |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 583 | # The ASAN we use with Bazel has some strict checks, so omit tests that |
| 584 | # trigger them. |
benjaminwagner | 83906ae | 2016-05-01 15:02:25 -0700 | [diff] [blame] | 585 | match += [ |
| 586 | "~clippedcubic2", |
| 587 | "~conicpaths", |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 588 | "~^gradients", |
benjaminwagner | 83906ae | 2016-05-01 15:02:25 -0700 | [diff] [blame] | 589 | "~Math", |
| 590 | "~Matrix", |
Ben Wagner | 55b7253 | 2017-01-29 21:50:51 -0500 | [diff] [blame] | 591 | "~PathBigCubic", |
benjaminwagner | 83906ae | 2016-05-01 15:02:25 -0700 | [diff] [blame] | 592 | "~PathOpsCubic", |
benjaminwagner | b518862 | 2016-06-29 10:26:44 -0700 | [diff] [blame] | 593 | "~PathOpsFailOp", |
caryclark | 523e76d | 2016-07-19 12:27:32 -0700 | [diff] [blame] | 594 | "~PathOpsOpCubicsThreaded", |
benjaminwagner | 83906ae | 2016-05-01 15:02:25 -0700 | [diff] [blame] | 595 | "~PathOpsOpLoopsThreaded", |
| 596 | "~PathOpsSimplify", |
| 597 | "~PathOpsTightBoundsQuads", |
| 598 | "~Point", |
benjaminwagner | 1d35231 | 2016-07-25 06:32:13 -0700 | [diff] [blame] | 599 | "~sk_linear_to_srgb", |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 600 | "~small_color_stop", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 601 | ] |
Ben Wagner | 59f9edb | 2016-11-28 15:30:37 -0500 | [diff] [blame] | 602 | return ["--src"] + source + ["--config"] + config + ["--match"] + match |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 603 | |
| 604 | ################################################################################ |
| 605 | ## COPTS |
| 606 | ################################################################################ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 607 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 608 | COPTS_UNIX = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 609 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
benjaminwagner | 7d974f5 | 2015-10-19 13:55:55 -0700 | [diff] [blame] | 610 | "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 611 | ] |
| 612 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 613 | COPTS_ANDROID = ["-mfpu=neon"] |
| 614 | |
| 615 | COPTS_IOS = [] |
| 616 | |
| 617 | COPTS_ALL = [] |
| 618 | |
| 619 | ################################################################################ |
| 620 | ## DEFINES |
| 621 | ################################################################################ |
| 622 | |
| 623 | DEFINES_UNIX = [ |
scroggo | 7732c0c | 2016-06-22 07:25:16 -0700 | [diff] [blame] | 624 | "PNG_SKIP_SETJMP_CHECK", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 625 | "SK_BUILD_FOR_UNIX", |
| 626 | "SK_SAMPLES_FOR_X", |
halcanary | 650e20d | 2016-08-25 09:07:02 -0700 | [diff] [blame] | 627 | "SK_PDF_USE_SFNTLY", |
benjaminwagner | 186e0b9 | 2016-02-11 16:00:24 -0800 | [diff] [blame] | 628 | "SK_CODEC_DECODES_RAW", |
msarett | ad3a5c6 | 2016-05-06 07:21:26 -0700 | [diff] [blame] | 629 | "SK_HAS_JPEG_LIBRARY", |
scroggo | e6939c1 | 2016-06-21 14:13:40 -0700 | [diff] [blame] | 630 | "SK_HAS_PNG_LIBRARY", |
scroggo | 7732c0c | 2016-06-22 07:25:16 -0700 | [diff] [blame] | 631 | "SK_HAS_WEBP_LIBRARY", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 632 | ] |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 633 | |
| 634 | DEFINES_ANDROID = [ |
| 635 | "SK_BUILD_FOR_ANDROID", |
benjaminwagner | 186e0b9 | 2016-02-11 16:00:24 -0800 | [diff] [blame] | 636 | "SK_CODEC_DECODES_RAW", |
msarett | ad3a5c6 | 2016-05-06 07:21:26 -0700 | [diff] [blame] | 637 | "SK_HAS_JPEG_LIBRARY", |
scroggo | e6939c1 | 2016-06-21 14:13:40 -0700 | [diff] [blame] | 638 | "SK_HAS_PNG_LIBRARY", |
scroggo | 7732c0c | 2016-06-22 07:25:16 -0700 | [diff] [blame] | 639 | "SK_HAS_WEBP_LIBRARY", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 640 | ] |
| 641 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 642 | DEFINES_IOS = [ |
| 643 | "SK_BUILD_FOR_IOS", |
sdefresne | e3fa811 | 2016-06-01 07:08:56 -0700 | [diff] [blame] | 644 | "SK_BUILD_NO_OPTS", |
Matt Sarett | 2d4fc27 | 2017-02-10 09:42:54 -0500 | [diff] [blame] | 645 | "SK_HAS_JPEG_LIBRARY", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 646 | "SKNX_NO_SIMD", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 647 | ] |
| 648 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 649 | DEFINES_ALL = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 650 | # Chrome DEFINES. |
| 651 | "SK_USE_FLOATBITS", |
| 652 | "SK_USE_FREETYPE_EMBOLDEN", |
| 653 | # Turn on a few Google3-specific build fixes. |
| 654 | "GOOGLE3", |
reed | d053ce9 | 2016-03-22 10:17:23 -0700 | [diff] [blame] | 655 | # Staging flags for API changes |
Yuqian Li | 8622b72 | 2016-11-14 15:42:58 -0500 | [diff] [blame] | 656 | # Temporarily Disable analytic AA for Google3 |
| 657 | "SK_NO_ANALYTIC_AA", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 658 | ] |
| 659 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 660 | ################################################################################ |
| 661 | ## LINKOPTS |
| 662 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 663 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 664 | LINKOPTS_UNIX = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 665 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 666 | LINKOPTS_ANDROID = [ |
| 667 | "-lEGL", |
| 668 | ] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 669 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 670 | LINKOPTS_IOS = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 671 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 672 | LINKOPTS_ALL = [ |
| 673 | "-ldl", |
| 674 | ] |