• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 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
15# Workspace definition used when Bzlmod is enabled
16workspace(name = "com_google_sandboxed_api")
17
18load("@bazel_skylib//lib:versions.bzl", "versions")
19load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
20load("//sandboxed_api/bazel:sapi_deps.bzl", "sapi_non_module_deps")
21
22versions.check(minimum_bazel_version = "7.1.1")
23
24sapi_non_module_deps()
25
26load(
27    "//sandboxed_api/bazel:llvm_config.bzl",
28    "llvm_disable_optional_support_deps",
29)
30
31llvm_disable_optional_support_deps()
32
33# zlib, only needed for examples
34http_archive(
35    name = "net_zlib",
36    build_file = "//sandboxed_api:bazel/external/zlib.BUILD",
37    patch_args = ["-p1"],
38    # This is a patch that removes the "OF" macro that is used in zlib function
39    # definitions. It is necessary, because libclang, the library used by the
40    # interface generator to parse C/C++ files contains a bug that manifests
41    # itself with macros like this.
42    # We are investigating better ways to avoid this issue. For most "normal"
43    # C and C++ headers, parsing just works.
44    patches = ["//sandboxed_api:bazel/external/zlib.patch"],
45    sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",  # 2020-04-23
46    strip_prefix = "zlib-1.2.11",
47    urls = [
48        "https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz",
49        "https://www.zlib.net/zlib-1.2.11.tar.gz",
50    ],
51)
52