benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 1 | # Description: |
| 2 | # Skia graphics library. |
| 3 | # |
| 4 | # Definitions for Google BUILD file. |
| 5 | |
| 6 | exports_files(["BUILD.public"]) |
| 7 | |
| 8 | # Platform-independent SRCS |
| 9 | SRCS = glob( |
| 10 | [ |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 11 | "include/private/*.h", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 12 | "src/**/*.h", |
| 13 | "src/**/*.cpp", |
| 14 | "src/**/*.c", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 15 | |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 16 | # Third Party |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 17 | "third_party/etc1/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 18 | "third_party/etc1/*.h", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 19 | "third_party/ktx/*.cpp", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 20 | "third_party/ktx/*.h", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 21 | ], |
| 22 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 23 | # Exclude platform-dependent files. |
| 24 | "src/device/xps/*", # Windows-only. Move to ports? |
| 25 | "src/doc/*_XPS.cpp", # Windows-only. Move to ports? |
| 26 | "src/gpu/gl/android/*", |
| 27 | "src/gpu/gl/iOS/*", |
| 28 | "src/gpu/gl/mac/*", |
| 29 | "src/gpu/gl/win/*", |
| 30 | "src/opts/**/*", |
| 31 | "src/ports/**/*", |
| 32 | "src/utils/android/**/*", |
| 33 | "src/utils/mac/**/*", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 34 | "src/utils/SkThreadUtils_win.cpp", # Windows-only. Move to ports? |
| 35 | "src/utils/win/**/*", |
| 36 | "src/views/sdl/*", |
| 37 | "src/views/win/*", |
| 38 | "src/views/unix/*", |
| 39 | |
| 40 | # Exclude multiple definitions. |
| 41 | # TODO(mtklein): Move to opts? |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 42 | "src/doc/SkDocument_PDF_None.cpp", # We use SkDocument_PDF.cpp. |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 43 | "src/fonts/*fontconfig*", |
| 44 | "src/gpu/gl/egl/*", # Conflicts with gpu/gl/glx. |
| 45 | "src/gpu/gl/nacl/*", # Conflicts with gpu/gl/glx. |
| 46 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", # Conflicts with src/gpu/gl/GrGLDefaultInterface_native.cpp |
| 47 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", # Conflicts with src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp |
| 48 | |
| 49 | # Exclude files that don't compile with the current DEFINES. |
| 50 | "src/gpu/gl/angle/*", # Requires SK_ANGLE define. |
| 51 | "src/gpu/gl/command_buffer/*", # unknown type name 'HMODULE' |
| 52 | "src/gpu/gl/mesa/*", # Requires SK_MESA define. |
| 53 | "src/svg/parser/*", # Missing SkSVG.h. |
| 54 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 55 | # Not used. |
| 56 | "src/animator/**/*", |
| 57 | "src/views/**/*", |
| 58 | "src/xml/SkBML_Verbs.h", |
| 59 | "src/xml/SkBML_XMLParser.cpp", |
| 60 | "src/xml/SkXMLPullParser.cpp", |
| 61 | ], |
| 62 | ) |
| 63 | |
| 64 | # Platform-dependent SRCS for google3-default platform. |
| 65 | PLATFORM_SRCS = glob( |
| 66 | [ |
| 67 | "src/opts/**/*.cpp", |
| 68 | "src/opts/**/*.h", |
| 69 | "src/ports/**/*.cpp", |
| 70 | "src/ports/**/*.h", |
| 71 | ], |
| 72 | exclude = [ |
| 73 | "src/opts/*arm*", |
| 74 | "src/opts/*mips*", |
| 75 | "src/opts/*NEON*", |
| 76 | "src/opts/*neon*", |
| 77 | "src/opts/*SSSE3*", |
| 78 | "src/opts/*ssse3*", |
| 79 | "src/opts/*SSE4*", |
| 80 | "src/opts/*sse4*", |
| 81 | "src/opts/SkBlitMask_opts_none.cpp", |
| 82 | "src/opts/SkBitmapProcState_opts_none.cpp", |
| 83 | "src/opts/SkBlitRow_opts_none.cpp", |
| 84 | "src/ports/*android*", |
| 85 | "src/ports/*chromium*", |
| 86 | "src/ports/*CG*", |
| 87 | "src/ports/*fontconfig*", |
| 88 | "src/ports/*FontConfig*", |
| 89 | "src/ports/*mac*", |
| 90 | "src/ports/*mozalloc*", |
| 91 | "src/ports/*nacl*", |
| 92 | "src/ports/*win*", |
| 93 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 94 | "src/ports/SkFontMgr_empty_factory.cpp", |
| 95 | "src/ports/SkImageDecoder_WIC.cpp", |
| 96 | "src/ports/SkImageDecoder_empty.cpp", |
| 97 | "src/ports/SkImageGenerator_none.cpp", |
| 98 | "src/ports/SkTLS_none.cpp", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 99 | ], |
| 100 | ) |
| 101 | |
| 102 | SRCS_SSSE3 = glob( |
| 103 | [ |
| 104 | "src/opts/*SSSE3*.cpp", |
| 105 | "src/opts/*ssse3*.cpp", |
| 106 | ], |
| 107 | ) |
| 108 | |
| 109 | SRCS_SSE4 = glob( |
| 110 | [ |
| 111 | "src/opts/*SSE4*.cpp", |
| 112 | "src/opts/*sse4*.cpp", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 113 | ], |
| 114 | ) |
| 115 | |
| 116 | HDRS = glob( |
| 117 | [ |
| 118 | "include/**/*.h", |
| 119 | ], |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 120 | exclude = [ |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 121 | "include/private/**/*", |
| 122 | |
| 123 | # Not used. |
| 124 | "include/animator/**/*", |
| 125 | "include/views/**/*", |
| 126 | "include/xml/SkBML_WXMLParser.h", |
| 127 | "include/xml/SkBML_XMLParser.h", |
mtklein | d55d13a | 2015-08-18 08:51:49 -0700 | [diff] [blame] | 128 | ], |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 129 | ) |
| 130 | |
| 131 | # Includes needed by Skia implementation. Not public includes. |
| 132 | INCLUDES = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 133 | "include/c", |
| 134 | "include/codec", |
| 135 | "include/config", |
| 136 | "include/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 137 | "include/effects", |
| 138 | "include/gpu", |
| 139 | "include/images", |
| 140 | "include/pathops", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 141 | "include/pipe", |
| 142 | "include/ports", |
| 143 | "include/private", |
| 144 | "include/utils", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 145 | "include/svg", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 146 | "include/xml", |
| 147 | "src/core", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 148 | "src/gpu", |
| 149 | "src/image", |
| 150 | "src/lazy", |
| 151 | "src/opts", |
| 152 | "src/pdf", |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 153 | "src/sfnt", |
| 154 | "src/utils", |
| 155 | "third_party/etc1", |
| 156 | "third_party/ktx", |
| 157 | ] |
| 158 | |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 159 | DM_SRCS = glob( |
| 160 | [ |
| 161 | "dm/*.cpp", |
| 162 | "dm/*.h", |
| 163 | "gm/*.c", |
| 164 | "gm/*.cpp", |
| 165 | "gm/*.h", |
| 166 | "tests/*.cpp", |
| 167 | "tests/*.h", |
| 168 | "tools/CrashHandler.cpp", |
| 169 | "tools/CrashHandler.h", |
| 170 | "tools/LazyDecodeBitmap.cpp", |
| 171 | "tools/LazyDecodeBitmap.h", |
| 172 | "tools/ProcStats.cpp", |
| 173 | "tools/ProcStats.h", |
| 174 | "tools/Resources.cpp", |
| 175 | "tools/Resources.h", |
| 176 | "tools/SkBitmapRegionDecoderInterface.cpp", |
| 177 | "tools/SkBitmapRegionDecoderInterface.h", |
| 178 | "tools/SkBitmapRegionSampler.cpp", |
| 179 | "tools/SkBitmapRegionSampler.h", |
| 180 | "tools/SkBitmapRegionCanvas.cpp", |
| 181 | "tools/SkBitmapRegionCanvas.h", |
| 182 | "tools/flags/*.cpp", |
| 183 | "tools/flags/*.h", |
| 184 | "tools/timer/*.cpp", |
| 185 | "tools/timer/*.h", |
| 186 | "tools/sk_tool_utils.cpp", |
| 187 | "tools/sk_tool_utils_font.cpp", |
| 188 | "tools/sk_tool_utils.h", |
| 189 | ], |
| 190 | exclude = [ |
| 191 | "tests/skia_test.cpp", # Old main. |
| 192 | "tests/SkpSkGrTest.cpp", # Alternate main. |
| 193 | "tests/PathOpsSkpClipTest.cpp", # Alternate main. |
| 194 | "tests/FontMgrAndroidParserTest.cpp", # Android-only. |
| 195 | "dm/DMSrcSinkAndroid.cpp", # Android-only. |
| 196 | "tools/timer/SysTimer_windows.cpp", |
| 197 | "tools/timer/SysTimer_mach.cpp", |
| 198 | ], |
| 199 | ) |
| 200 | |
| 201 | DM_INCLUDES = [ |
| 202 | "gm", |
| 203 | "src/codec", |
| 204 | "src/effects", |
| 205 | "src/fonts", |
| 206 | "src/pathops", |
| 207 | "src/pipe/utils", |
| 208 | "src/utils/debugger", |
| 209 | "tests", |
| 210 | "tools", |
| 211 | "tools/flags", |
| 212 | "tools/timer", |
| 213 | ] |
| 214 | |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 215 | COPTS = [ |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 216 | "-Wno-implicit-fallthrough", # Some intentional fallthrough. |
benjaminwagner | 7d974f5 | 2015-10-19 13:55:55 -0700 | [diff] [blame] | 217 | "-Wno-deprecated-declarations", # Internal use of deprecated methods. :( |
benjaminwagner | 787ca87 | 2015-08-17 12:58:10 -0700 | [diff] [blame] | 218 | ] |
| 219 | |
| 220 | DEFINES = [ |
| 221 | # It'd be nice for fastbuild, dbg -> SK_DEBUG, opt -> SK_RELEASE. |
| 222 | "SK_RELEASE", |
| 223 | # Chrome DEFINES. |
| 224 | "SK_USE_FLOATBITS", |
| 225 | "SK_USE_FREETYPE_EMBOLDEN", |
| 226 | # Turn on a few Google3-specific build fixes. |
| 227 | "GOOGLE3", |
| 228 | "SK_BUILD_FOR_UNIX", |
| 229 | "SK_SAMPLES_FOR_X", |
| 230 | ] |
| 231 | |
| 232 | LINKOPTS = ["-ldl"] |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 233 | |
| 234 | cc_library( |
| 235 | name = "opts_ssse3", |
| 236 | srcs = SRCS_SSSE3, |
| 237 | copts = COPTS + ["-mssse3"], |
| 238 | defines = DEFINES, |
| 239 | includes = INCLUDES, |
| 240 | ) |
| 241 | |
| 242 | cc_library( |
| 243 | name = "opts_sse4", |
| 244 | srcs = SRCS_SSE4, |
| 245 | copts = COPTS + ["-msse4"], |
| 246 | defines = DEFINES, |
| 247 | includes = INCLUDES, |
| 248 | ) |
| 249 | |
| 250 | cc_library( |
| 251 | name = "skia", |
| 252 | srcs = SRCS + PLATFORM_SRCS, |
| 253 | hdrs = HDRS, |
| 254 | copts = COPTS, |
| 255 | defines = DEFINES, |
| 256 | includes = INCLUDES, |
| 257 | linkopts = LINKOPTS, |
| 258 | visibility = [":skia_clients"], |
| 259 | deps = EXTERNAL_DEPS + [ |
| 260 | ":opts_sse4", |
| 261 | ":opts_ssse3", |
| 262 | ], |
| 263 | ) |
| 264 | |
| 265 | cc_test( |
| 266 | name = "dm", |
| 267 | size = "large", |
| 268 | srcs = DM_SRCS, |
| 269 | args = [ |
| 270 | "--nogpu", |
| 271 | "--verbose", |
| 272 | # TODO(mtklein): maybe investigate why these fail? |
benjaminwagner | 4d5de04 | 2015-10-21 13:07:07 -0700 | [diff] [blame] | 273 | "--match ~FontMgr ~Scalar ~Canvas ~Codec_stripes ~Codec_Dimensions ~Codec ~Stream ~skps ~Math", |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 274 | "--resourcePath %s/resources" % BASE_DIR, |
| 275 | "--images %s/resources" % BASE_DIR, |
| 276 | ], |
| 277 | copts = COPTS, |
benjaminwagner | 964eeba | 2015-10-20 13:00:48 -0700 | [diff] [blame] | 278 | data = glob(["resources/**/*"]), |
benjaminwagner | 6f6bef8 | 2015-10-15 08:09:44 -0700 | [diff] [blame] | 279 | defines = DEFINES, |
| 280 | includes = DM_INCLUDES, |
| 281 | deps = DM_EXTERNAL_DEPS + [ |
| 282 | ":skia", |
| 283 | ], |
| 284 | ) |