2020-08-13 05:09:40 +08:00
|
|
|
# Copyright 2020 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2020-08-12 06:44:13 +08:00
|
|
|
load(
|
|
|
|
"@com_google_sandboxed_api//sandboxed_api/bazel:sapi.bzl",
|
|
|
|
"sapi_library",
|
|
|
|
)
|
|
|
|
|
2020-09-17 23:36:07 +08:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2020-08-12 06:44:13 +08:00
|
|
|
cc_library(
|
|
|
|
name = "guetzli_wrapper",
|
|
|
|
srcs = ["guetzli_entry_points.cc"],
|
|
|
|
hdrs = ["guetzli_entry_points.h"],
|
|
|
|
deps = [
|
2020-09-25 22:43:06 +08:00
|
|
|
"@com_google_absl//absl/status:statusor",
|
2020-08-12 06:44:13 +08:00
|
|
|
"@com_google_sandboxed_api//sandboxed_api:lenval_core",
|
|
|
|
"@com_google_sandboxed_api//sandboxed_api:vars",
|
2020-09-17 23:36:07 +08:00
|
|
|
"@guetzli//:guetzli_lib",
|
2020-08-18 04:29:07 +08:00
|
|
|
"@png_archive//:png",
|
2020-08-12 06:44:13 +08:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
sapi_library(
|
|
|
|
name = "guetzli_sapi",
|
2020-08-12 06:48:48 +08:00
|
|
|
srcs = ["guetzli_transaction.cc"],
|
2020-09-17 23:36:07 +08:00
|
|
|
hdrs = [
|
|
|
|
"guetzli_sandbox.h",
|
|
|
|
"guetzli_transaction.h",
|
|
|
|
],
|
2020-08-12 06:44:13 +08:00
|
|
|
functions = [
|
2020-08-12 06:48:48 +08:00
|
|
|
"ProcessJpeg",
|
|
|
|
"ProcessRgb",
|
2020-08-18 04:29:07 +08:00
|
|
|
"WriteDataToFd",
|
2020-08-12 06:44:13 +08:00
|
|
|
],
|
|
|
|
input_files = ["guetzli_entry_points.h"],
|
|
|
|
lib = ":guetzli_wrapper",
|
|
|
|
lib_name = "Guetzli",
|
2020-08-18 04:29:07 +08:00
|
|
|
namespace = "guetzli::sandbox",
|
2020-09-17 23:36:07 +08:00
|
|
|
visibility = ["//visibility:public"],
|
2020-08-12 06:44:13 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_binary(
|
2020-09-17 23:36:07 +08:00
|
|
|
name = "guetzli_sandboxed",
|
|
|
|
srcs = ["guetzli_sandboxed.cc"],
|
2020-09-25 22:43:06 +08:00
|
|
|
deps = [":guetzli_sapi"],
|
2020-08-18 04:29:07 +08:00
|
|
|
)
|
2020-09-13 23:20:10 +08:00
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "transaction_tests",
|
2020-09-17 23:36:07 +08:00
|
|
|
size = "large",
|
2020-09-13 23:20:10 +08:00
|
|
|
srcs = ["guetzli_transaction_test.cc"],
|
2020-09-17 23:36:07 +08:00
|
|
|
data = glob(["testdata/*"]),
|
|
|
|
visibility = ["//visibility:public"],
|
2020-09-13 23:20:10 +08:00
|
|
|
deps = [
|
2020-09-17 23:36:07 +08:00
|
|
|
"//:guetzli_sapi",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
2020-09-13 23:20:10 +08:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "sapi_lib_tests",
|
2020-09-17 23:36:07 +08:00
|
|
|
size = "large",
|
2020-09-13 23:20:10 +08:00
|
|
|
srcs = ["guetzli_sapi_test.cc"],
|
2020-09-17 23:36:07 +08:00
|
|
|
data = glob(["testdata/*"]),
|
|
|
|
visibility = ["//visibility:public"],
|
2020-09-13 23:20:10 +08:00
|
|
|
deps = [
|
2020-09-17 23:36:07 +08:00
|
|
|
"//:guetzli_sapi",
|
|
|
|
"@com_google_googletest//:gtest_main",
|
2020-09-13 23:20:10 +08:00
|
|
|
],
|
|
|
|
)
|