xref: /aosp_15_r20/external/skia/BUILD.bazel (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1load("@rules_license//rules:license.bzl", "license")
2load("//bazel:gen_compile_flags_txt_linux_amd64.bzl", "gen_compile_flags_txt_linux_amd64")
3
4package(
5    default_applicable_licenses = ["//:license"],
6)
7
8# https://opensource.google/documentation/reference/thirdparty/new_license_rules
9# https://github.com/bazelbuild/rules_license/blob/bcffeb0c481d178cbee69bdc7e23ef22d3a087b1/rules/license.bzl
10license(
11    name = "license",
12    license_kinds = ["@rules_license//licenses/generic:notice"],
13    license_text = "LICENSE",
14)
15
16licenses(["notice"])
17
18alias(
19    name = "core",
20    actual = "//src/core:core",
21    visibility = ["//visibility:public"],
22)
23
24alias(
25    name = "pathops",
26    actual = "//src/pathops:pathops",
27    visibility = ["//visibility:public"],
28)
29
30###
31
32alias(
33    name = "ganesh_gl",
34    actual = "//src/gpu/ganesh/gl:ganesh_gl",
35    visibility = ["//visibility:public"],
36)
37
38alias(
39    name = "ganesh_egl_factory",
40    actual = "//src/gpu/ganesh/gl/egl:egl_factory",
41    visibility = ["//visibility:public"],
42)
43
44alias(
45    name = "ganesh_gl_epoxy_factory",
46    actual = "//src/gpu/ganesh/gl/epoxy:epoxy_factory",
47    visibility = ["//visibility:public"],
48)
49
50alias(
51    name = "ganesh_glx_factory",
52    actual = "//src/gpu/ganesh/gl/glx:glx_factory",
53    visibility = ["//visibility:public"],
54)
55
56alias(
57    name = "ganesh_gl_ios_factory",
58    actual = "//src/gpu/ganesh/gl/ios:ios_factory",
59    visibility = ["//visibility:public"],
60)
61
62alias(
63    name = "ganesh_gl_mac_factory",
64    actual = "//src/gpu/ganesh/gl/mac:mac_factory",
65    visibility = ["//visibility:public"],
66)
67
68alias(
69    name = "ganesh_webgl_factory",
70    actual = "//src/gpu/ganesh/gl/webgl:webgl_factory",
71    visibility = ["//visibility:public"],
72)
73
74alias(
75    name = "ganesh_gl_win_factory",
76    actual = "//src/gpu/ganesh/gl/win:win_factory",
77    visibility = ["//visibility:public"],
78)
79
80alias(
81    name = "ganesh_metal",
82    actual = "//src/gpu/ganesh/mtl:ganesh_metal",
83    visibility = ["//visibility:public"],
84)
85
86alias(
87    name = "ganesh_vulkan",
88    actual = "//src/gpu/ganesh/vk:ganesh_vulkan",
89    visibility = ["//visibility:public"],
90)
91
92###
93
94alias(
95    name = "graphite_native_metal",
96    actual = "//src/gpu/graphite/mtl:graphite_native_metal",
97    visibility = ["//visibility:public"],
98)
99
100alias(
101    name = "graphite_native_vulkan",
102    actual = "//src/gpu/graphite/vk:graphite_native_vulkan",
103    visibility = ["//visibility:public"],
104)
105
106###
107
108alias(
109    name = "bmp_decode_codec",
110    actual = "//src/codec:bmp_decode",
111    visibility = ["//visibility:public"],
112)
113
114alias(
115    name = "gif_decode_codec",
116    actual = "//src/codec:gif_decode",
117    visibility = ["//visibility:public"],
118)
119
120alias(
121    name = "ico_decode_codec",
122    actual = "//src/codec:ico_decode",
123    visibility = ["//visibility:public"],
124)
125
126alias(
127    name = "jpeg_encode_codec",
128    actual = "//src/encode:jpeg_encode",
129    visibility = ["//visibility:public"],
130)
131
132alias(
133    name = "jpeg_decode_codec",
134    actual = "//src/codec:jpeg_decode",
135    visibility = ["//visibility:public"],
136)
137
138alias(
139    name = "jpegxl_decode_codec",
140    actual = "//src/codec:jpegxl_decode",
141    visibility = ["//visibility:public"],
142)
143
144alias(
145    name = "png_decode_codec",
146    actual = "//src/codec:png_decode",
147    visibility = ["//visibility:public"],
148)
149
150alias(
151    name = "png_encode_codec",
152    actual = "//src/encode:png_encode",
153    visibility = ["//visibility:public"],
154)
155
156alias(
157    name = "wbmp_decode_codec",
158    actual = "//src/codec:wbmp_decode",
159    visibility = ["//visibility:public"],
160)
161
162alias(
163    name = "webp_decode_codec",
164    actual = "//src/codec:webp_decode",
165    visibility = ["//visibility:public"],
166)
167
168alias(
169    name = "webp_encode_codec",
170    actual = "//src/encode:webp_encode",
171    visibility = ["//visibility:public"],
172)
173
174###
175
176alias(
177    name = "fontmgr_empty_freetype",
178    actual = "//src/ports:fontmgr_empty_freetype",
179    visibility = ["//visibility:public"],
180)
181
182alias(
183    name = "fontmgr_coretext",
184    actual = "//src/ports:fontmgr_coretext",
185    visibility = ["//visibility:public"],
186)
187
188alias(
189    name = "fontmgr_data_freetype",
190    actual = "//src/ports:fontmgr_data_freetype",
191    visibility = ["//visibility:public"],
192)
193
194alias(
195    name = "fontmgr_directory_freetype",
196    actual = "//src/ports:fontmgr_directory_freetype",
197    visibility = ["//visibility:public"],
198)
199
200alias(
201    name = "freetype_support",
202    actual = "//src/ports:freetype_support",
203    visibility = ["//visibility:public"],
204)
205
206alias(
207    name = "fontmgr_fontconfig_freetype",
208    actual = "//src/ports:fontmgr_fontconfig_freetype",
209    visibility = ["//visibility:public"],
210)
211
212alias(
213    name = "fontmgr_fontconfig_fontations",
214    actual = "//src/ports:fontmgr_fontconfig_fontations",
215    visibility = ["//visibility:public"],
216)
217
218alias(
219    name = "fontmgr_android_freetype",
220    actual = "//src/ports:fontmgr_android_freetype",
221    visibility = ["//visibility:public"],
222)
223
224alias(
225    name = "fontmgr_empty_fontations",
226    actual = "//src/ports:fontmgr_fontations_empty",
227    visibility = ["//visibility:public"],
228)
229
230###
231
232alias(
233    name = "pdf_writer",
234    actual = "//src/pdf:pdf",
235    visibility = ["//visibility:public"],
236)
237
238###
239
240alias(
241    name = "skparagraph_harfbuzz_skunicode",
242    actual = "//modules/skparagraph:skparagraph_harfbuzz_skunicode",
243    visibility = ["//visibility:public"],
244)
245
246###
247
248alias(
249    name = "skshaper_core",
250    actual = "//modules/skshaper:skshaper_core_and_utils",
251    visibility = ["//visibility:public"],
252)
253
254alias(
255    name = "skshaper_coretext",
256    actual = "//modules/skshaper:skshaper_coretext",
257    visibility = ["//visibility:public"],
258)
259
260alias(
261    name = "skshaper_harfbuzz",
262    actual = "//modules/skshaper:skshaper_harfbuzz",
263    visibility = ["//visibility:public"],
264)
265
266alias(
267    name = "skshaper_unicode",
268    actual = "//modules/skshaper:skshaper_unicode",
269    visibility = ["//visibility:public"],
270)
271
272###
273
274alias(
275    name = "skresources",
276    actual = "//modules/skresources:skresources",
277    visibility = ["//visibility:public"],
278)
279
280###
281
282# Allows Skia to take an SVG in as an input
283alias(
284    name = "svg_renderer",
285    actual = "//modules/svg:svg_renderer",
286    visibility = ["//visibility:public"],
287)
288
289# Allows Skia to draw to an SVG
290alias(
291    name = "svg_writer",
292    actual = "//src/svg:svg",
293    visibility = ["//visibility:public"],
294)
295
296###
297
298alias(
299    name = "skunicode_core",
300    actual = "//modules/skunicode:skunicode_core",
301    visibility = ["//visibility:public"],
302)
303
304alias(
305    name = "skunicode_icu",
306    actual = "//modules/skunicode:skunicode_icu",
307    visibility = ["//visibility:public"],
308)
309
310# Load bearing comment below - gazelle looks here (and not in any other BUILD.bazel files)
311# for a special comment indicating the prefix.
312# gazelle:prefix go.skia.org/skia
313
314# This is an alias to avoid having to load the golang toolchain code just to
315# create the rules in our primary BUILD.bazel file
316alias(
317    name = "gazelle",
318    actual = "//infra:gazelle",
319    visibility = ["//visibility:public"],
320)
321
322test_suite(
323    name = "all_go_tests",
324    tests = [
325        # Go tests in this list will be tested in CI. Please add any new Go tests to this suite.
326        "//bazel/device_specific_configs:device_specific_configs_test",
327        "//bazel/exporter:exporter_test",
328        "//infra/bots/task_drivers/bazel_test_benchmark:bazel_test_benchmark_test",
329        "//infra/bots/task_drivers/bazel_test_gm:bazel_test_gm_test",
330        "//infra/bots/task_drivers/bazel_test_precompiled:bazel_test_precompiled_test",
331        "//infra/bots/task_drivers/codesize:codesize_test",
332        "//infra/bots/task_drivers/common:common_test",
333        "//infra/bots/task_drivers/perf_puppeteer_canvas:perf_puppeteer_canvas_test",
334        "//infra/bots/task_drivers/perf_puppeteer_render_skps:perf_puppeteer_render_skps_test",
335        "//infra/bots/task_drivers/perf_puppeteer_skottie_frames:perf_puppeteer_skottie_frames_test",
336        "//tools/testrunners/common/android/adb_test_runner:adb_test_runner_test",
337    ],
338)
339
340# Generates a compile_flags.txt file for use with clangd against the Bazel-downloaded Linux AMD64
341# clang hermetic toolchain.
342#
343# This command prints to standard output a compile_flags.txt file that can be used with clangd to
344# enable autocompletion on editors that support it. See:
345# https://clangd.llvm.org/design/compile-commands.
346#
347# Note that this is implemented on a best effort basis. The produced compile_flags.txt file will
348# contain the subset of flags used by most targets, but some targets might require additional
349# flags. If that's the case, please manually add them to your compile_flags.txt file.
350#
351# Sample usage:
352#
353#     $ bazel run //:gen_compile_flags_txt_linux_amd64 > compile_flags.txt
354#
355# Invoke with --config=<some config> to generate flags with the defines and includes required for
356# your build. For example, if you build your binary as follows:
357#
358#     $ bazel build //path/to:binary --config=gl_ganesh
359#
360# Then your compile_flags.txt file should be generated with:
361#
362#     $ bazel run //:gen_compile_flags_txt_linux_amd64 --config=gl_ganesh > compile_flags.txt
363#
364# This was tested with Visual Studio Code and the clangd extension:
365# https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd.
366gen_compile_flags_txt_linux_amd64(
367    name = "gen_compile_flags_txt_linux_amd64",
368)
369
370######
371# go #
372######
373
374# Sample usage: "bazel run //:go -- generate ./...".
375alias(
376    name = "go",
377    actual = "@go_sdk//:bin/go",
378    visibility = ["//visibility:public"],
379)
380
381#########
382# gofmt #
383#########
384
385# Sample usage: "bazel run //:gofmt -- -s -w .".
386alias(
387    name = "gofmt",
388    actual = "@go_sdk//:bin/gofmt",
389    visibility = ["//visibility:public"],
390)
391
392############
393# Errcheck #
394############
395
396# Sample usage: "bazel run //:errcheck -- go.skia.org/skia/...".
397alias(
398    name = "errcheck",
399    actual = "//infra:errcheck",
400    visibility = ["//visibility:public"],
401)
402
403##############
404# buildifier #
405##############
406
407# Sample usage: "bazel run //:buildifier".
408alias(
409    name = "buildifier",
410    actual = "//bazel:buildifier",
411)
412