# Windows/Envoy specific Bazel build/test options.

build --action_env=PATH
build --action_env=TMPDIR

build --experimental_local_memory_estimate

build --define signal_trace=disabled
build --define hot_restart=disabled
build --define tcmalloc=disabled
build --define manual_stamp=manual_stamp

build --workspace_status_command="bash bazel/get_workspace_status"
build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11
build --javabase=@bazel_tools//tools/jdk:remote_jdk11
build --enable_platform_specific_config

# Experimental: We already have absl in the build, define absl=1
# to tell googletest to use absl for backtrace (this appears to be
# broken on msvc-cl dbg builds)
build --define absl=1

# Should not be required after upstream fix, see issue;
# https://github.com/bazelbuild/rules_foreign_cc/issues/301
build --copt="-DCARES_STATICLIB"
build --copt="-DNGHTTP2_STATICLIB"
build --copt="-DCURL_STATICLIB"

# Required to work around quiche build defect
# Unguarded gcc pragmas are not recognized by MSVC
build:msvc-cl --copt="/wd4068"
# Allows 'nodiscard' function return values to be discarded
build:msvc-cl --copt="/wd4834"
# Allows inline functions to be undefined
build:msvc-cl --copt="/wd4506"
build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING"

# Required to work around clang build defects
# Conflicting definitions of _WIN32_WINNT
# Overriding __TIME__ etc is problematic
build:clang-cl --copt="-Wno-macro-redefined"
build:clang-cl --copt="-Wno-builtin-macro-redefined"
build:clang-cl --action_env=USE_CLANG_CL=1

build --experimental_enable_runfiles
build --features=compiler_param_file
build --features=fully_static_link
build --features=static_link_msvcrt
build --dynamic_mode=off

