# =====================================================================
# Envoy specific Bazel build/test options.
# =====================================================================

# Keep envoy.bazelrc up-to-date by run:
# curl -sSL https://raw.githubusercontent.com/envoyproxy/envoy/master/.bazelrc > envoy.bazelrc
import %workspace%/envoy.bazelrc

# Overrides workspace_status_command
build --workspace_status_command=tools/bazel_get_workspace_status
build:remote --remote_timeout=7200
# ========================================
# Istio specific Bazel build/test options.
# ========================================

# Need for CI image to pickup docker-credential-gcloud, PATH is fixed in rbe-toolchain-* configs.
build:remote-ci --action_env=PATH=/usr/local/google-cloud-sdk/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin

# Enable path normalization by default.
# See: https://github.com/envoyproxy/envoy/pull/6519
build --define path_normalization_by_default=true

# Heap profiler is supported only with gperf tcmalloc, not google tcmalloc.
# See: https://github.com/istio/istio/issues/28233
build --define tcmalloc=gperftools

# Build with embedded V8-based WebAssembly runtime.
build --define wasm=v8

# Build Proxy-WASM plugins as native extensions.
build --copt -DNULL_PLUGIN

# Release builds without debug symbols.
build:release -c opt
build:release --strip=always

# Release builds with debug symbols
build:release-symbol -c opt

# Debug builds
build:debug -c dbg

# Add compile option for all C++ files
build --cxxopt -Wnon-virtual-dtor
build --cxxopt -Wformat
build --cxxopt -Wformat-security

# Link pthread for flatbuffers
build --host_linkopt=-pthread

# TODO(lambdai): Revert below centos proxy build mitigation.
build --action_env=CXXFLAGS=-Wno-unused-variable
build:libc++ --action_env=CXXFLAGS=-stdlib="libc++ -Wno-unused-variable"
build:rbe-toolchain-clang-libc++ --action_env=CXXFLAGS="-stdlib=libc++ -Wno-unused-variable"
