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