common --action_env=BAZEL_CXXOPTS=-std=c++20
common --cxxopt='-std=c++20'
common --copt=-fdiagnostics-color=always
common --test_output=errors
common --test_summary=terse

common --enable_platform_specific_config

# compilation_mode options below are `dbg` (debug symbols) `fastbuild`
# (build as quickly as possible), and `opt` (turn on all optimizations)
common -c dbg
common --enable_bzlmod

# prevents changes to PATH from causing a full rebuild
common --incompatible_strict_action_env

# compile with clang on all platforms
build --action_env=CC=clang
build --action_env=CXX=clang++
build --host_action_env=CC=clang
build --host_action_env=CXX=clang++

# Only show warnings for targets defined in HEIR code.
# Warnings for external repos and generated code is (mostly) hidden; see #2616
build --output_filter="^//(benchmark|frontend|lib|tests|tools)/"

# linux-specific options
build:linux --linkopt="-fuse-ld=lld"

# macos specific options
# openmp is not supported in apple clang
build:macos --@openfhe//:enable_openmp=False
build:macos --no@fuzztest//fuzztest:use_riegeli

# MacOS arm64 config
build:macos_arm64 --cpu=darwin_arm64
build:macos_arm64 --macos_minimum_os=11.0
# openmp is not supported in apple clang
build:macos_arm64 --@openfhe//:enable_openmp=False

# run with --config=gcc to force use of gcc
# (and the default linker, usually ld) instead
build:gcc --action_env=CC=gcc
build:gcc --action_env=CXX=g++
build:gcc --host_action_env=CC=gcc
build:gcc --host_action_env=CXX=g++

# run with --config=asan to enable
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -O1
build:asan --copt -g
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address

try-import %workspace%/fuzztest.bazelrc
