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