# Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Bazel RC file for the AGI build.

# Import any user defined rules.
try-import %workspace%/user.bazelrc

# Adjusting defaults to favour developer workflows
build --verbose_failures
test --test_output=errors
query --nohost_deps --noimplicit_deps

# Adding in c++11 compiling, this really should be done in the android toolchains
build --cxxopt="-std=c++11" --host_cxxopt="-std=c++11"

# Android special build configurations
build --fat_apk_cpu armeabi-v7a,arm64-v8a,x86

# Default version defines
build --define AGI_BUILD_NUMBER=0 --define AGI_BUILD_SHA=developer

# Without this, bazel wraps each cc_library with "--whole-archive" flags for the
# linker when building the dynamic library, which leads to over-bloated libs.
build --incompatible_remove_legacy_whole_archive

# Sets the go +build tags to use during compilation.
build --define gotags=analytics,crashreporting

# Disable c-ares for grpc.
build --define grpc_no_ares=true

# Config used by the build servers to dump symbols.
build:symbols --copt="-g"

# Config that will exclude Android from the //:pkg target.
build:nodroid --define NO_ANDROID=1

# Tests requiring a GPU fail in the sandbox.
test --strategy TestRunner=standalone --test_env DISPLAY
