forked from google/skia
-
Notifications
You must be signed in to change notification settings - Fork 55
/
BUILD.bazel
148 lines (133 loc) · 4.29 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
load("//:defines.bzl", "DEFAULT_DEFINES", "DEFAULT_LOCAL_DEFINES")
load("@skia_user_config//:copts.bzl", "DEFAULT_OBJC_COPTS")
load("//bazel:flags.bzl", "selects")
load("//bazel:skia_rules.bzl", "exports_files_legacy", "skia_cc_library", "skia_objc_library")
licenses(["notice"])
exports_files_legacy()
# All the mm files from the Skia library are rolled up to this objc library since cc_library
# ignores mm files. This private library is then deps'ed into the public and internal versions
# of the SKia library below. The Skia library Objective-C code requires ARC, while non-library code
# does not.
skia_objc_library(
name = "skia_objc",
srcs = [
"//src:objc_srcs",
],
copts = DEFAULT_OBJC_COPTS + ["-fobjc-arc"],
defines = DEFAULT_DEFINES,
deps = [
"//src:deps",
"@skia_user_config//:user_config",
],
)
# This target exposes the Skia public API. It is what external clients should use.
skia_cc_library(
name = "skia_public",
srcs = [
"//include:private_hdrs",
"//include:srcs",
"//src:private_hdrs",
"//src:srcs",
],
hdrs = ["//include:public_hdrs"],
defines = DEFAULT_DEFINES,
local_defines = DEFAULT_LOCAL_DEFINES,
visibility = ["//visibility:public"],
deps = [
"//src:deps",
"@skia_user_config//:user_config",
] + select({
"//src/gpu:metal_ganesh": ["//:skia_objc"],
"//conditions:default": [],
}),
)
# This target exposes headers beyond the public, supported API. It is intended to be
# used by Skia's tests and tooling.
skia_cc_library(
name = "skia_internal",
srcs = [
"//include:srcs",
"//src:srcs",
],
hdrs = [
"//include:private_hdrs",
"//include:public_hdrs",
"//src:private_hdrs",
],
defines = DEFAULT_DEFINES,
local_defines = DEFAULT_LOCAL_DEFINES,
visibility = [
"//dm:__subpackages__",
"//gm:__subpackages__",
"//modules:__subpackages__",
"//tests:__subpackages__",
"//tools:__subpackages__",
],
deps = [
"//src:deps",
"@skia_user_config//:user_config",
] + select({
"//src/gpu:metal_ganesh": ["//:skia_objc"],
"//conditions:default": [],
}),
)
####################################################################
# Experimental public buffet targets below
alias(
name = "core",
actual = "//src:core",
visibility = ["//visibility:public"],
)
alias(
name = "pathops",
actual = "//src:pathops",
visibility = ["//visibility:public"],
)
alias(
name = "default_malloc",
actual = "//src/ports:default_malloc",
visibility = ["//visibility:public"],
)
# Load bearing comment below - gazelle looks here (and not in any other BUILD.bazel files)
# for a special comment indicating the prefix.
# gazelle:prefix go.skia.org/skia
# This is an alias to avoid having to load the golang toolchain code just to
# create the rules in our primary BUILD.bazel file
alias(
name = "gazelle",
actual = "//infra:gazelle",
visibility = ["//visibility:public"],
)
# Convenience condition that is always true. This condition is satisfied if an arbitrarily chosen
# boolean built-in flag (https://bazel.build/docs/user-manual#stamp) is either true or false.
#
# Inspired by
# https://github.com/bazelbuild/bazel-skylib/blob/2f0bb4cec0297bb38f830a72fa8961bee057c3cd/lib/selects.bzl#L227.
selects.config_setting_group(
name = "always_true",
match_any = [
":always_true_0",
":always_true_1",
],
visibility = ["//visibility:public"],
)
config_setting(
name = "always_true_0",
values = {"stamp": "0"},
)
config_setting(
name = "always_true_1",
values = {"stamp": "1"},
)
test_suite(
name = "all_go_tests",
tests = [
# Go tests in this list will be tested in CI. Please add any new Go tests to this suite.
"//bazel/exporter:exporter_test",
"//infra/bots/task_drivers/bazel_test_gm:bazel_test_gm_test",
"//infra/bots/task_drivers/codesize:codesize_test",
"//infra/bots/task_drivers/perf_puppeteer_canvas:perf_puppeteer_canvas_test",
"//infra/bots/task_drivers/perf_puppeteer_render_skps:perf_puppeteer_render_skps_test",
"//infra/bots/task_drivers/perf_puppeteer_skottie_frames:perf_puppeteer_skottie_frames_test",
],
)