## Startup options
startup  --windows_enable_symlinks  # ignored on non-Windows platforms

## Target platforms
common:linux          --config=linux_env --define TARGET=oss_linux
common:oss_linux      --config=linux_env --define TARGET=oss_linux
common:prod_linux     --config=linux_env --define TARGET=prod_linux
common:prod_linux_dev --config=linux_env --define TARGET=prod_linux --config=dev_channel

common:macos          --config=macos_env --define TARGET=oss_macos
common:oss_macos      --config=macos_env --define TARGET=oss_macos
common:prod_macos     --config=macos_env --define TARGET=prod_macos
common:prod_macos_dev --config=macos_env --define TARGET=prod_macos --config=dev_channel

common:windows          --config=windows_env --define TARGET=oss_windows
common:oss_windows      --config=windows_env --define TARGET=oss_windows
common:prod_windows     --config=windows_env --define TARGET=prod_windows
common:prod_windows_dev --config=windows_env --define TARGET=prod_windows --config=dev_channel

common:android      --config=android_env --define TARGET=oss_android
common:oss_android  --config=android_env --define TARGET=oss_android
common:prod_android --config=android_env --define TARGET=prod_android

## Build channels
build:dev_channel    --define CHANNEL=dev
build:stable_channel --define CHANNEL=stable

## Release build
build:release_build --compilation_mode=opt
build:release_build --copt=-DABSL_MIN_LOG_LEVEL=100

## Clang-cl toolchain for Windows
build:windows_env --extra_toolchains=@local_config_cc//:cc-toolchain-arm64_windows-clang-cl
build:windows_env --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl
build:windows_env --extra_toolchains=@local_config_cc//:cc-toolchain-x64_x86_windows-clang-cl
build:windows_env --host_platform=//:host-windows-clang-cl
build:windows_env --copt "/D_WIN32_WINNT=0x0A00" --host_copt "/D_WIN32_WINNT=0x0A00"

## Compiler options
common:linux_env   --config=compiler_gcc_like
common:android_env --config=compiler_gcc_like
common:macos_env   --config=compiler_gcc_like
common:windows_env --config=compiler_msvc_like

# Make sure we set -std=c++20 that may affect ABI across all the compilation targets.
# https://github.com/abseil/abseil-cpp/blob/master/FAQ.md#what-is-abi-and-why-dont-you-recommend-using-a-pre-compiled-version-of-abseil
build:compiler_gcc_like --cxxopt "-std=c++20" --host_cxxopt "-std=c++20"
build:compiler_gcc_like --copt "-funsigned-char" --host_copt "-funsigned-char"
build:compiler_gcc_like --copt "-Wno-sign-compare" --host_copt "-Wno-sign-compare"
build:compiler_gcc_like --copt "-Wno-char-subscripts" --host_copt "-Wno-char-subscripts"
build:compiler_msvc_like --cxxopt "/std:c++20" --host_cxxopt "/std:c++20"
build:compiler_msvc_like --cxxopt "/Zc:__cplusplus" --host_cxxopt "/Zc:__cplusplus"
build:compiler_msvc_like --copt "/J" --host_copt "/J"
build:compiler_msvc_like --copt "/utf-8" --host_copt "/utf-8"
build:compiler_msvc_like --cxxopt "/J" --host_cxxopt "/J"
build:compiler_msvc_like --cxxopt "/utf-8" --host_cxxopt "/utf-8"

## Linux specific options
build:linux_env --build_tag_filters=-nolinux --copt "-fPIC"
test:linux_env   --test_tag_filters=-nolinux

## macOS specific options
build:macos_env --build_tag_filters=-nomac --objccopt "-fsigned-char"
test:macos_env   --test_tag_filters=-nomac

## Windows specific options
common:windows_env --enable_runfiles
build:windows_env --build_tag_filters=-nowin
test:windows_env   --test_tag_filters=-nowin

# Android specific options
build:android_env --copt "-DOS_ANDROID"
build:android_env --build_tag_filters=-noandroid
test:android_env  --test_tag_filters=-noandroid
