From bf7831486312c888979895c783f5076966a604eb Mon Sep 17 00:00:00 2001 From: Robin Linden Date: Wed, 13 Dec 2023 01:22:52 +0100 Subject: [PATCH] build: Use apple_support to configure the objc toolchain This is required starting with Bazel 7. --- .bazelrc | 3 +++ WORKSPACE | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.bazelrc b/.bazelrc index 590e7d14..f3ffd162 100644 --- a/.bazelrc +++ b/.bazelrc @@ -29,6 +29,9 @@ build:linux --features=layering_check build:linux --cxxopt='-std=c++2b' build:linux --cxxopt='-fno-rtti' +build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain +build:macos --crosstool_top=@local_config_apple_cc//:toolchain +build:macos --host_crosstool_top=@local_config_apple_cc//:toolchain build:macos --features=layering_check build:macos --cxxopt='-std=c++2b' build:macos --cxxopt='-fno-rtti' diff --git a/WORKSPACE b/WORKSPACE index 3cfd52b0..48b8815f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -3,6 +3,13 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Bazel # ========================================================= +# https://github.com/bazelbuild/apple_support +http_archive( + name = "build_bazel_apple_support", + sha256 = "cf4d63f39c7ba9059f70e995bf5fe1019267d3f77379c2028561a5d7645ef67c", + url = "https://github.com/bazelbuild/apple_support/releases/download/1.11.1/apple_support.1.11.1.tar.gz", +) + # https://github.com/bazelbuild/platforms http_archive( name = "platforms", # Apache-2.0 @@ -308,6 +315,11 @@ http_archive( # This needs to go last so that we can override any dependencies these calls may # pull in. +# build_bazel_apple_support +load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") + +apple_support_dependencies() + # rules_python load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")