# Public read-only cache
common:public_cache --remote_cache="https://storage.googleapis.com/enzyme-presubmit-bazel-cache/" --remote_upload_local_results=false
common:jll_cache --remote_cache="https://storage.googleapis.com/jll-gcp-cache/" --remote_upload_local_results=false

# Cache pushes are limited to Enzyme's CI system.
common:public_cache_push --config=public_cache --remote_upload_local_results=true --google_default_credentials
common:jll_cache_push --config=jll_cache --remote_upload_local_results=true --google_default_credentials

common --noenable_bzlmod

# TODO: Migrate for https://github.com/bazelbuild/bazel/issues/7260
common --noincompatible_enable_cc_toolchain_resolution

common --announce_rc

common --repo_env=USE_PYWRAP_RULES=True
common --copt=-DGRPC_BAZEL_BUILD
common --host_copt=-DGRPC_BAZEL_BUILD
common --action_env=GRPC_BAZEL_RUNTIME=1
common --repo_env=PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=upb
common --action_env=PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=upb

common --experimental_repo_remote_exec
common --cxxopt=-Wno-deprecated-declarations --host_cxxopt=-Wno-deprecated-declarations
common --cxxopt=-Wno-sign-compare --host_cxxopt=-Wno-sign-compare
common --cxxopt=-Wno-array-bounds --host_cxxopt=-Wno-array-bounds
common --cxxopt=-Wno-comment --host_cxxopt=-Wno-comment
common --cxxopt=-Wno-invalid-constexpr --host_cxxopt=-Wno-invalid-constexpr
common --cxxopt=-Wno-mismatched-new-delete --host_cxxopt=-Wno-mismatched-new-delete
common --cxxopt=-Wno-unused-but-set-parameter --host_cxxopt=-Wno-unused-but-set-parameter
common --cxxopt=-Wno-unused-but-set-variable --host_cxxopt=-Wno-unused-but-set-variable
common --cxxopt=-Wno-misleading-indentation --host_cxxopt=-Wno-misleading-indentation
common --cxxopt=-Wno-return-type --host_cxxopt=-Wno-return-type
common --cxxopt=-Wno-unused-function --host_cxxopt=-Wno-unused-function
common --cxxopt=-Wno-parentheses --host_cxxopt=-Wno-parentheses
common --cxxopt=-Wno-unused-local-typedefs --host_cxxopt=-Wno-unused-local-typedefs
common --cxxopt=-Wno-reorder --host_cxxopt=-Wno-reorder
common --cxxopt=-Wno-missing-braces --host_cxxopt=-Wno-missing-braces
common --cxxopt=-Wno-range-loop-construct --host_cxxopt=-Wno-range-loop-construct

# for gcc
# common --cxxopt=-Wno-class-memaccess --host_cxxopt=-Wno-class-memaccess
# common --cxxopt=-Wno-maybe-uninitialized --host_cxxopt=-Wno-maybe-uninitialized
# common --cxxopt=-Wno-stringop-overread --host_cxxopt=-Wno-stringop-overread

common --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
common:macos --cxxopt=-faligned-allocation --host_cxxopt=-faligned-allocation

common --color=yes

# common --copt=-fbracket-depth=1024 --host_copt=-fbracket-depth=1024
common --define=grpc_no_ares=true
common --define=tsl_link_protobuf=true
common --define open_source_build=true
common
common --define framework_shared_object=true
common --define tsl_protobuf_header_only=true
common --define=allow_oversize_protos=true


# Some targets have the same py source file, but use different
# configurations via `requires-` tags. This results in an action
# conflict when precompiling. Disable to avoid that problem.
# See https://github.com/bazel-contrib/rules_python/issues/2445
build --@rules_python//python/config_settings:precompile=force_disabled

build -c opt
