common --enable_platform_specific_config

common --check_direct_dependencies=off

common --repo_env=BAZEL_CONLYOPTS=-DCONLY_ENV=1
common --repo_env=BAZEL_COPTS=-DCOPTS_ENV=1
common --repo_env=BAZEL_CXXOPTS="-std=c++17:-DCXXOPTS_ENV=1"
# Cross-platform linker flag
common --repo_env=BAZEL_LINKOPTS=-Wl,-v

common:path-stripping --experimental_output_paths=strip
common --modify_execution_info=CppCompile=+supports-path-mapping,CppModuleMap=+supports-path-mapping,CppArchive=+supports-path-mapping

# Verify parse_headers works as the toolchain changes
build --process_headers_in_dependencies

build --per_file_copt=external/protobuf.*@-w
build --host_per_file_copt=external/protobuf.*@-w

build --test_output=errors

# Be strict about toolchain changes introducing warnings, but don't cause downstream projects to fail
build:macos --copt=-Werror=unused-command-line-argument --host_copt=-Werror=unused-command-line-argument

try-import %workspace%/user.bazelrc
