# Part of the Crubit project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# use `MODULE.bazel`
build --enable_bzlmod

# generic_clang from @llvm-raw//utils/bazel, but c++20 to match Google
build:generic_clang --repo_env=CC=clang
build:generic_clang --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 --repo_env=BAZEL_CXXOPTS=-std=c++20
build:generic_clang --copt=-Wall --host_copt=-Wall # not -Werror due to spurious warnings differences in Clang <16
build:generic_clang --cxxopt=-Wno-range-loop-analysis --host_cxxopt=-Wno-range-loop-analysis
build:generic_clang --copt=-Wno-deprecated --host_copt=-Wno-deprecated
build:generic_clang --copt=-Wno-missing-braces --host_copt=-Wno-missing-braces

# enable linking against prebuilt LLVM with no RTTI
build:generic_clang --copt=-fno-rtti --host_copt=-fno-rtti

build --config=generic_clang
build --@rules_rust//rust/toolchain/channel=nightly
