1*8fb009dcSAndroid Build Coastguard Worker# Copyright (c) 2024, Google Inc. 2*8fb009dcSAndroid Build Coastguard Worker# 3*8fb009dcSAndroid Build Coastguard Worker# Permission to use, copy, modify, and/or distribute this software for any 4*8fb009dcSAndroid Build Coastguard Worker# purpose with or without fee is hereby granted, provided that the above 5*8fb009dcSAndroid Build Coastguard Worker# copyright notice and this permission notice appear in all copies. 6*8fb009dcSAndroid Build Coastguard Worker# 7*8fb009dcSAndroid Build Coastguard Worker# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8*8fb009dcSAndroid Build Coastguard Worker# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9*8fb009dcSAndroid Build Coastguard Worker# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10*8fb009dcSAndroid Build Coastguard Worker# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11*8fb009dcSAndroid Build Coastguard Worker# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12*8fb009dcSAndroid Build Coastguard Worker# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13*8fb009dcSAndroid Build Coastguard Worker# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14*8fb009dcSAndroid Build Coastguard Worker 15*8fb009dcSAndroid Build Coastguard Worker# This is a bazelrc file, documented in https://bazel.build/run/bazelrc and 16*8fb009dcSAndroid Build Coastguard Worker# specifies default flags when BoringSSL is the root project. It has no effect 17*8fb009dcSAndroid Build Coastguard Worker# on downstream projects, which define their own toolchains and configs. 18*8fb009dcSAndroid Build Coastguard Worker 19*8fb009dcSAndroid Build Coastguard Worker# See https://bazel.build/run/bazelrc#enable_platform_specific_config. 20*8fb009dcSAndroid Build Coastguard Worker# This expands to --config=osname which, in turn, expands to the options 21*8fb009dcSAndroid Build Coastguard Worker# specified below. 22*8fb009dcSAndroid Build Coastguard Workerbuild --enable_platform_specific_config 23*8fb009dcSAndroid Build Coastguard Worker 24*8fb009dcSAndroid Build Coastguard Worker# Enable additional checks. 25*8fb009dcSAndroid Build Coastguard Workerbuild --features=layering_check 26*8fb009dcSAndroid Build Coastguard Workerbuild --features=parse_headers 27*8fb009dcSAndroid Build Coastguard Worker 28*8fb009dcSAndroid Build Coastguard Worker# Bazel has no abstractions for setting C++ versions and expects the root 29*8fb009dcSAndroid Build Coastguard Worker# project to use the compiler-specific options for their toolchains. (Bazel only 30*8fb009dcSAndroid Build Coastguard Worker# wants the root to set the C++ version for the sake of projects like Abseil 31*8fb009dcSAndroid Build Coastguard Worker# whose ABI depends on the C++ version.) 32*8fb009dcSAndroid Build Coastguard Workerbuild:linux --cxxopt=-std=c++17 33*8fb009dcSAndroid Build Coastguard Workerbuild:macos --cxxopt=-std=c++17 34*8fb009dcSAndroid Build Coastguard Workerbuild:windows --cxxopt=/std:c++17 35*8fb009dcSAndroid Build Coastguard Worker 36*8fb009dcSAndroid Build Coastguard Worker# Without setting a minimum macOS version, std::optional does not work. 37*8fb009dcSAndroid Build Coastguard Workerbuild:macos --cxxopt=-mmacosx-version-min=10.15 38*8fb009dcSAndroid Build Coastguard Worker 39*8fb009dcSAndroid Build Coastguard Worker# Without /Zc:__cplusplus, MSVC does not define the right value for 40*8fb009dcSAndroid Build Coastguard Worker# __cplusplus. See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ 41*8fb009dcSAndroid Build Coastguard Workerbuild:windows --cxxopt=/Zc:__cplusplus 42*8fb009dcSAndroid Build Coastguard Worker 43*8fb009dcSAndroid Build Coastguard Worker# https://bazel.build/configure/best-practices#bazelrc-file 44*8fb009dcSAndroid Build Coastguard Workertry-import %workspace%/user.bazelrc 45