xref: /aosp_15_r20/external/sandboxed-api/oss-internship-2020/guetzli/BUILD.bazel (revision ec63e07ab9515d95e79c211197c445ef84cefa6a)
1# Copyright 2020 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load(
16    "@com_google_sandboxed_api//sandboxed_api/bazel:sapi.bzl",
17    "sapi_library",
18)
19
20licenses(["notice"])
21
22cc_library(
23    name = "guetzli_wrapper",
24    srcs = ["guetzli_entry_points.cc"],
25    hdrs = ["guetzli_entry_points.h"],
26    deps = [
27        "@com_google_absl//absl/status:statusor",
28        "@com_google_sandboxed_api//sandboxed_api:lenval_core",
29        "@com_google_sandboxed_api//sandboxed_api:vars",
30        "@guetzli//:guetzli_lib",
31        "@png_archive//:png",
32    ],
33)
34
35sapi_library(
36    name = "guetzli_sapi",
37    srcs = ["guetzli_transaction.cc"],
38    hdrs = [
39        "guetzli_sandbox.h",
40        "guetzli_transaction.h",
41    ],
42    functions = [
43        "ProcessJpeg",
44        "ProcessRgb",
45        "WriteDataToFd",
46    ],
47    input_files = ["guetzli_entry_points.h"],
48    lib = ":guetzli_wrapper",
49    lib_name = "Guetzli",
50    namespace = "guetzli::sandbox",
51    visibility = ["//visibility:public"],
52)
53
54cc_binary(
55    name = "guetzli_sandboxed",
56    srcs = ["guetzli_sandboxed.cc"],
57    deps = [":guetzli_sapi"],
58)
59
60cc_test(
61    name = "transaction_tests",
62    size = "large",
63    srcs = ["guetzli_transaction_test.cc"],
64    data = glob(["testdata/*"]),
65    visibility = ["//visibility:public"],
66    deps = [
67        "//:guetzli_sapi",
68        "@com_google_googletest//:gtest_main",
69    ],
70)
71
72cc_test(
73    name = "sapi_lib_tests",
74    size = "large",
75    srcs = ["guetzli_sapi_test.cc"],
76    data = glob(["testdata/*"]),
77    visibility = ["//visibility:public"],
78    deps = [
79        "//:guetzli_sapi",
80        "@com_google_googletest//:gtest_main",
81    ],
82)
83