xref: /aosp_15_r20/external/skia/tools/fonts/BUILD.bazel (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1load(
2    "//bazel:skia_rules.bzl",
3    "skia_cc_library",
4    "skia_filegroup",
5)
6
7package(
8    default_applicable_licenses = ["//:license"],
9)
10
11licenses(["notice"])
12
13skia_filegroup(
14    name = "test_font_manager_srcs",
15    testonly = True,
16    srcs = [
17        "FontToolUtils.cpp",
18        "FontToolUtils.h",
19        "TestFontMgr.cpp",
20        "TestFontMgr.h",
21        "TestSVGTypeface.cpp",
22        "TestSVGTypeface.h",
23        "TestTypeface.cpp",
24        "TestTypeface.h",
25    ],
26    visibility = [
27        "//tests:__pkg__",
28        "//tools:__subpackages__",
29    ],
30)
31
32skia_filegroup(
33    name = "test_fonts",
34    testonly = True,
35    srcs = [
36        "test_font_index.inc",
37        "test_font_monospace.inc",
38        "test_font_sans_serif.inc",
39        "test_font_serif.inc",
40    ],
41    visibility = [
42        "//tests:__pkg__",
43        "//tools:__subpackages__",
44    ],
45)
46
47skia_filegroup(
48    name = "test_empty_typeface",
49    testonly = True,
50    srcs = ["TestEmptyTypeface.h"],
51    visibility = ["//tests:__pkg__"],
52)
53
54skia_cc_library(
55    name = "font_tool_utils",
56    testonly = True,
57    srcs = [
58        "FontToolUtils.cpp",
59        "TestFontMgr.cpp",
60        "TestFontMgr.h",
61        "TestTypeface.cpp",
62        "TestTypeface.h",
63    ],
64    hdrs = [
65        "FontToolUtils.h",
66    ],
67    features = ["layering_check"],
68    textual_hdrs = [
69        "//tools/fonts:test_fonts",
70    ],
71    visibility = [
72        "//bench:__subpackages__",
73        "//gm:__subpackages__",
74        "//tests:__subpackages__",
75        "//tools:__subpackages__",
76    ],
77    deps = [
78        "//:core",
79        "//src/base",
80        "//src/core:core_priv",
81        "//tools:resources",
82        "//tools:tool_utils",
83        "//tools/flags:cmd_flags",
84    ] + select({
85        "@platforms//os:android": ["@skia//:fontmgr_android_freetype"],
86        "@platforms//os:linux": [
87            "//src/ports:fontations_support",
88            "//src/ports:freetype_support",
89            "@skia//:fontmgr_fontconfig_freetype",
90        ],
91        "@platforms//os:macos": ["@skia//:fontmgr_coretext"],
92        "//conditions:default": ["//src/ports:fontmgr_fontations_empty"],
93    }),
94)
95