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