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 = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 61 | "include/private/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 62 | "src/**/*.h", |
| 63 | "src/**/*.cpp", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 64 | |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 65 | # Third Party |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 66 | "third_party/etc1/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 67 | "third_party/etc1/*.h", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 68 | "third_party/ktx/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 69 | "third_party/ktx/*.h", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 70 | ], |
| 71 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 72 | # Exclude platform-dependent files. |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 73 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 74 | "src/codec/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 75 | "src/device/xps/*", # Windows-only. Move to ports? |
| 76 | "src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 77 | "src/fonts/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 78 | "src/gpu/gl/android/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 79 | "src/gpu/gl/egl/*", |
benjaminwagner | af3b35e | 2016-03-28 13:27:28 -0700 | [diff] [blame] | 80 | "src/gpu/gl/glfw/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 81 | "src/gpu/gl/glx/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 82 | "src/gpu/gl/iOS/*", |
| 83 | "src/gpu/gl/mac/*", |
| 84 | "src/gpu/gl/win/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 85 | "src/images/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 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. |
| 104 | "src/gpu/gl/angle/*", # Requires SK_ANGLE define. |
| 105 | "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' |
| 106 | "src/gpu/gl/mesa/*", # Requires SK_MESA define. |
| 107 | "src/svg/parser/*", # Missing SkSVG.h. |
| 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. |
| 113 | "src/animator/**/*", |
| 114 | "src/views/**/*", |
| 115 | "src/xml/SkBML_Verbs.h", |
| 116 | "src/xml/SkBML_XMLParser.cpp", |
| 117 | "src/xml/SkXMLPullParser.cpp", |
egdaniel | 32119f1 | 2016-02-22 10:07:54 -0800 | [diff] [blame] | 118 | |
| 119 | # Currently exclude all vulkan specific files |
| 120 | "src/gpu/vk/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 121 | ], |
| 122 | ) |
| 123 | |
| 124 | # Platform-dependent SRCS for google3-default platform. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 125 | BASE_SRCS_UNIX = struct( |
| 126 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 127 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 128 | "src/codec/*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 129 | "src/fonts/SkFontMgr_fontconfig.cpp", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 130 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 131 | "src/images/*", |
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 = [ |
| 138 | "src/opts/*arm*", |
| 139 | "src/opts/*mips*", |
| 140 | "src/opts/*NEON*", |
| 141 | "src/opts/*neon*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 142 | # Included in :opts_ssse3 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 143 | "src/opts/*SSSE3*", |
| 144 | "src/opts/*ssse3*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 145 | # Included in :opts_sse4 library. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 146 | "src/opts/*SSE4*", |
| 147 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 148 | # Included in :opts_avx or :opts_avx2 |
| 149 | "src/opts/*avx*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 150 | "src/opts/SkBitmapProcState_opts_none.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 151 | "src/opts/SkBlitMask_opts_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 152 | "src/opts/SkBlitRow_opts_none.cpp", |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 153 | "src/ports/*CG*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 154 | "src/ports/*WIC*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 155 | "src/ports/*android*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 156 | "src/ports/*chromium*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 157 | "src/ports/*mac*", |
| 158 | "src/ports/*mozalloc*", |
| 159 | "src/ports/*nacl*", |
| 160 | "src/ports/*win*", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 161 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 162 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 163 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 164 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 165 | "src/ports/SkFontMgr_empty_factory.cpp", |
benjaminwagner | 404816e | 2015-12-03 05:04:03 -0800 | [diff] [blame] | 166 | "src/ports/SkFontMgr_fontconfig.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 167 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
msarett | c1d0312 | 2016-03-25 08:58:55 -0700 | [diff] [blame] | 168 | "src/ports/SkImageEncoder_none.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 169 | "src/ports/SkImageGenerator_none.cpp", |
| 170 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 171 | ], |
| 172 | ) |
| 173 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 174 | # Platform-dependent SRCS for google3-default Android. |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 175 | BASE_SRCS_ANDROID = struct( |
| 176 | include = [ |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 177 | "src/android/*", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 178 | "src/codec/*", |
iroth | 5f0de06 | 2016-02-17 12:47:27 -0800 | [diff] [blame] | 179 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
iroth | 76a1225 | 2016-01-07 07:11:39 -0800 | [diff] [blame] | 180 | "src/images/*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 181 | # TODO(benjaminwagner): Figure out how to compile with EGL. |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 182 | "src/opts/**/*.cpp", |
| 183 | "src/opts/**/*.h", |
| 184 | "src/ports/**/*.cpp", |
| 185 | "src/ports/**/*.h", |
| 186 | ], |
| 187 | exclude = [ |
| 188 | "src/opts/*mips*", |
| 189 | "src/opts/*SSE2*", |
| 190 | "src/opts/*SSSE3*", |
| 191 | "src/opts/*ssse3*", |
| 192 | "src/opts/*SSE4*", |
| 193 | "src/opts/*sse4*", |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 194 | "src/opts/*avx*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 195 | "src/opts/*x86*", |
| 196 | "src/opts/SkBitmapProcState_opts_none.cpp", |
| 197 | "src/opts/SkBlitMask_opts_none.cpp", |
| 198 | "src/opts/SkBlitRow_opts_none.cpp", |
msarett | 6b4985c | 2016-03-10 07:15:59 -0800 | [diff] [blame] | 199 | "src/ports/*CG*", |
mtklein | 3f193a9 | 2016-03-10 08:52:05 -0800 | [diff] [blame] | 200 | "src/ports/*FontConfig*", |
msarett | fc0b6d1 | 2016-03-17 13:50:17 -0700 | [diff] [blame] | 201 | "src/ports/*WIC*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 202 | "src/ports/*chromium*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 203 | "src/ports/*fontconfig*", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 204 | "src/ports/*mac*", |
| 205 | "src/ports/*mozalloc*", |
| 206 | "src/ports/*nacl*", |
| 207 | "src/ports/*win*", |
| 208 | "src/ports/SkDebug_stdio.cpp", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 209 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 210 | "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 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", |
msarett | c1d0312 | 2016-03-25 08:58:55 -0700 | [diff] [blame] | 215 | "src/ports/SkImageEncoder_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/*Gif*.cpp", |
| 236 | "src/codec/*Ico*.cpp", |
| 237 | "src/codec/*Jpeg*.cpp", |
| 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*", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 250 | "src/opts/*x86*", |
| 251 | "src/opts/SkBitmapProcState_opts_none.cpp", |
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", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 265 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 266 | "src/ports/SkFontConfigInterface_direct_google3_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 267 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 268 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
benjaminwagner | d9dd581 | 2016-03-21 10:45:01 -0700 | [diff] [blame] | 269 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 270 | "src/ports/SkFontMgr_empty_factory.cpp", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 271 | "src/ports/SkImageGenerator_none.cpp", |
| 272 | "src/ports/SkTLS_none.cpp", |
| 273 | ], |
| 274 | ) |
| 275 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 276 | ################################################################################ |
| 277 | ## SSSE3/SSE4/AVX/AVX2 SRCS |
| 278 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 279 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 280 | SSSE3_SRCS = struct( |
| 281 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 282 | "src/opts/*SSSE3*.cpp", |
| 283 | "src/opts/*ssse3*.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 284 | ], |
| 285 | ) |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 286 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 287 | SSE4_SRCS = struct( |
| 288 | include = [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 289 | "src/opts/*SSE4*.cpp", |
| 290 | "src/opts/*sse4*.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 291 | ], |
| 292 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 293 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 294 | AVX_SRCS = struct( |
| 295 | include = [ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 296 | "src/opts/*_avx.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 297 | ], |
| 298 | ) |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 299 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 300 | AVX2_SRCS = struct( |
| 301 | include = [ |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 302 | "src/opts/*_avx2.cpp", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 303 | ], |
| 304 | ) |
mtklein | f6d8d28 | 2015-12-17 10:18:04 -0800 | [diff] [blame] | 305 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 306 | ################################################################################ |
| 307 | ## BASE_HDRS |
| 308 | ################################################################################ |
| 309 | |
| 310 | BASE_HDRS = struct( |
| 311 | include = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 312 | "include/**/*.h", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 313 | "src/utils/SkWhitelistChecksums.cpp", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 314 | ], |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 315 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 316 | "include/private/**/*", |
| 317 | |
| 318 | # Not used. |
| 319 | "include/animator/**/*", |
| 320 | "include/views/**/*", |
| 321 | "include/xml/SkBML_WXMLParser.h", |
| 322 | "include/xml/SkBML_XMLParser.h", |
benjaminwagner | 89061ed | 2016-01-25 09:29:08 -0800 | [diff] [blame] | 323 | ], |
| 324 | ) |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 325 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 326 | ################################################################################ |
| 327 | ## BASE_DEPS |
| 328 | ################################################################################ |
| 329 | |
| 330 | BASE_DEPS_ALL = [] |
| 331 | |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 332 | BASE_DEPS_UNIX = [ |
iroth | 330043c | 2016-01-12 14:22:24 -0800 | [diff] [blame] | 333 | ":opts_ssse3", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 334 | ":opts_sse4", |
| 335 | ":opts_avx", |
| 336 | ":opts_avx2", |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 337 | ] |
| 338 | |
| 339 | BASE_DEPS_ANDROID = [] |
| 340 | |
| 341 | BASE_DEPS_IOS = [] |
| 342 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 343 | ################################################################################ |
| 344 | ## INCLUDES |
| 345 | ################################################################################ |
benjaminwagner | 39e7aa4 | 2015-11-18 13:26:10 -0800 | [diff] [blame] | 346 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 347 | # Includes needed by Skia implementation. Not public includes. |
| 348 | INCLUDES = [ |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 349 | "include/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 350 | "include/c", |
robertphillips | 188d44c | 2016-02-01 04:54:14 -0800 | [diff] [blame] | 351 | "include/client/android", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 352 | "include/codec", |
| 353 | "include/config", |
| 354 | "include/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 355 | "include/effects", |
| 356 | "include/gpu", |
| 357 | "include/images", |
| 358 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 359 | "include/pipe", |
| 360 | "include/ports", |
| 361 | "include/private", |
| 362 | "include/utils", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 363 | "include/utils/mac", |
| 364 | "include/utils/win", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 365 | "include/svg", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 366 | "include/xml", |
benjaminwagner | fa7e1a0 | 2015-11-13 12:27:08 -0800 | [diff] [blame] | 367 | "src/codec", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 368 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 369 | "src/gpu", |
| 370 | "src/image", |
| 371 | "src/lazy", |
| 372 | "src/opts", |
benjaminwagner | 2211a7b | 2015-12-01 11:12:05 -0800 | [diff] [blame] | 373 | "src/ports", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 374 | "src/pdf", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 375 | "src/sfnt", |
| 376 | "src/utils", |
| 377 | "third_party/etc1", |
| 378 | "third_party/ktx", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 379 | ] |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 380 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 381 | ################################################################################ |
| 382 | ## DM_SRCS |
| 383 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 384 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 385 | DM_SRCS_ALL = struct( |
| 386 | include = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 387 | "dm/*.cpp", |
| 388 | "dm/*.h", |
| 389 | "gm/*.c", |
| 390 | "gm/*.cpp", |
| 391 | "gm/*.h", |
| 392 | "tests/*.cpp", |
| 393 | "tests/*.h", |
| 394 | "tools/CrashHandler.cpp", |
| 395 | "tools/CrashHandler.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 396 | "tools/ProcStats.cpp", |
| 397 | "tools/ProcStats.h", |
| 398 | "tools/Resources.cpp", |
| 399 | "tools/Resources.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 400 | "tools/flags/*.cpp", |
| 401 | "tools/flags/*.h", |
mtklein | e1fc452 | 2016-02-09 12:32:52 -0800 | [diff] [blame] | 402 | "tools/random_parse_path.cpp", |
| 403 | "tools/random_parse_path.h", |
benjaminwagner | 3288514 | 2015-10-24 07:55:31 -0700 | [diff] [blame] | 404 | "tools/sk_tool_utils.cpp", |
| 405 | "tools/sk_tool_utils.h", |
| 406 | "tools/sk_tool_utils_font.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 407 | "tools/timer/*.cpp", |
| 408 | "tools/timer/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 409 | ], |
| 410 | exclude = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 411 | "dm/DMSrcSinkAndroid.cpp", # Android-only. |
| 412 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
| 413 | "tests/PathOpsSkpClipTest.cpp", # Alternate main. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 414 | "tests/skia_test.cpp", # Old main. |
| 415 | "tests/SkpSkGrTest.cpp", # Alternate main. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 416 | "tools/timer/SysTimer_mach.cpp", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 417 | "tools/timer/SysTimer_windows.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 418 | ], |
| 419 | ) |
| 420 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 421 | DM_SRCS_UNIX = struct() |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 422 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 423 | DM_SRCS_ANDROID = struct( |
| 424 | include = [ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 425 | # Depends on Android HWUI library that is not available in google3. |
| 426 | #"dm/DMSrcSinkAndroid.cpp", |
| 427 | "tests/FontMgrAndroidParserTest.cpp", |
| 428 | ], |
| 429 | ) |
| 430 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 431 | DM_SRCS_IOS = struct() |
| 432 | |
| 433 | ################################################################################ |
| 434 | ## DM_INCLUDES |
| 435 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 436 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 437 | DM_INCLUDES = [ |
benjaminwagner | b1fe8f6 | 2016-02-01 09:05:08 -0800 | [diff] [blame] | 438 | "dm", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 439 | "gm", |
| 440 | "src/codec", |
| 441 | "src/effects", |
benjaminwagner | bc9a9b4 | 2016-02-22 13:30:39 -0800 | [diff] [blame] | 442 | "src/effects/gradients", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 443 | "src/fonts", |
| 444 | "src/pathops", |
| 445 | "src/pipe/utils", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 446 | "src/ports", |
ethannicholas | 3cb9542 | 2016-02-09 12:44:06 -0800 | [diff] [blame] | 447 | "tools/debugger", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 448 | "tests", |
| 449 | "tools", |
| 450 | "tools/flags", |
| 451 | "tools/timer", |
| 452 | ] |
| 453 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 454 | ################################################################################ |
| 455 | ## DM_ARGS |
| 456 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 457 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 458 | def DM_ARGS(base_dir): |
| 459 | return [ |
| 460 | "--nogpu", |
| 461 | "--verbose", |
| 462 | # TODO(mtklein): maybe investigate why these fail? |
benjaminwagner | f6bfccd | 2016-02-25 10:28:11 -0800 | [diff] [blame] | 463 | "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~RecordDraw_TextBounds ~PaintBreakText", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 464 | "--resourcePath %s/resources" % base_dir, |
| 465 | "--images %s/resources" % base_dir, |
| 466 | ] |
| 467 | |
| 468 | ################################################################################ |
| 469 | ## COPTS |
| 470 | ################################################################################ |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 471 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 472 | COPTS_UNIX = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 473 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
benjaminwagner | 7d974f5 | 2015-10-19 13:55:55 -0700 | [diff] [blame] | 474 | "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 475 | ] |
| 476 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 477 | COPTS_ANDROID = ["-mfpu=neon"] |
| 478 | |
| 479 | COPTS_IOS = [] |
| 480 | |
| 481 | COPTS_ALL = [] |
| 482 | |
| 483 | ################################################################################ |
| 484 | ## DEFINES |
| 485 | ################################################################################ |
| 486 | |
| 487 | DEFINES_UNIX = [ |
msarett | 70e418b | 2016-02-12 12:35:48 -0800 | [diff] [blame] | 488 | "PNG_SKIP_SETJMP_CHECK", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 489 | "SK_BUILD_FOR_UNIX", |
| 490 | "SK_SAMPLES_FOR_X", |
| 491 | "SK_SFNTLY_SUBSETTER", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 492 | "SK_CODEC_DECODES_GIF", |
| 493 | "SK_CODEC_DECODES_JPEG", |
| 494 | "SK_CODEC_DECODES_PNG", |
benjaminwagner | 186e0b9 | 2016-02-11 16:00:24 -0800 | [diff] [blame] | 495 | "SK_CODEC_DECODES_RAW", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 496 | "SK_CODEC_DECODES_WEBP", |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 497 | ] |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 498 | |
| 499 | DEFINES_ANDROID = [ |
| 500 | "SK_BUILD_FOR_ANDROID", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 501 | "SK_CODEC_DECODES_GIF", |
| 502 | "SK_CODEC_DECODES_JPEG", |
| 503 | "SK_CODEC_DECODES_PNG", |
benjaminwagner | 186e0b9 | 2016-02-11 16:00:24 -0800 | [diff] [blame] | 504 | "SK_CODEC_DECODES_RAW", |
msarett | 39b2d5a | 2016-02-17 08:26:31 -0800 | [diff] [blame] | 505 | "SK_CODEC_DECODES_WEBP", |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 506 | ] |
| 507 | |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 508 | DEFINES_IOS = [ |
| 509 | "SK_BUILD_FOR_IOS", |
| 510 | "SK_IGNORE_ETC1_SUPPORT", |
iroth | d2ccc77 | 2016-01-25 11:24:57 -0800 | [diff] [blame] | 511 | "SKNX_NO_SIMD", |
iroth | 8b99ef4 | 2015-11-02 11:11:21 -0800 | [diff] [blame] | 512 | ] |
| 513 | |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 514 | DEFINES_ALL = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 515 | # Chrome DEFINES. |
| 516 | "SK_USE_FLOATBITS", |
| 517 | "SK_USE_FREETYPE_EMBOLDEN", |
reed | e8f3062 | 2016-03-23 18:59:25 -0700 | [diff] [blame] | 518 | "SK_SUPPORT_LEGACY_NEW_SURFACE_API", |
reed | 7b380d0 | 2016-03-21 13:25:16 -0700 | [diff] [blame] | 519 | "SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR", |
reed | b95f555 | 2016-03-21 08:30:19 -0700 | [diff] [blame] | 520 | "SK_SUPPORT_LEGACY_PATHEFFECT_PTR", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 521 | # Turn on a few Google3-specific build fixes. |
| 522 | "GOOGLE3", |
reed | d053ce9 | 2016-03-22 10:17:23 -0700 | [diff] [blame] | 523 | # Staging flags for API changes |
| 524 | "SK_SUPPORT_LEGACY_COLORFILTER_PTR", |
| 525 | "SK_SUPPORT_LEGACY_CREATESHADER_PTR", |
fmalita | 41c4096 | 2016-03-24 11:05:28 -0700 | [diff] [blame] | 526 | "SK_SUPPORT_LEGACY_PICTURE_PTR", |
reed | cfb6bdf | 2016-03-29 11:32:50 -0700 | [diff] [blame] | 527 | "SK_SUPPORT_LEGACY_XFERMODE_PTR", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 528 | ] |
| 529 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 530 | ################################################################################ |
| 531 | ## LINKOPTS |
| 532 | ################################################################################ |
benjaminwagner | 86ea33e | 2015-10-26 10:46:25 -0700 | [diff] [blame] | 533 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 534 | LINKOPTS_UNIX = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 535 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 536 | LINKOPTS_ANDROID = [ |
| 537 | "-lEGL", |
| 538 | ] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 539 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 540 | LINKOPTS_IOS = [] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 541 | |
benjaminwagner | 56f6d06 | 2016-01-13 10:45:19 -0800 | [diff] [blame] | 542 | LINKOPTS_ALL = [ |
| 543 | "-ldl", |
| 544 | ] |