blob: 9762afb86d9b1c3c83eb33a383ea9ddf28bd942c [file] [log] [blame]
Drew Macrae78a58872021-09-07 20:52:19 +00001# Copyright lowRISC contributors.
2# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3# SPDX-License-Identifier: Apache-2.0
4
Drew Macrae7ac1efb2021-09-22 16:08:28 +00005# https://docs.opentitan.org/doc/rm/c_cpp_coding_style/#cxx-version specifies
Drew Macrae78a58872021-09-07 20:52:19 +00006build --cxxopt='-std=c++14'
Drew Macrae7ac1efb2021-09-22 16:08:28 +00007build --conlyopt='-std=c11'
8
Drew Macrae3f2e2312021-12-02 21:56:00 +00009# Bazel embedded enables the following feature which along with -std=c11 and
10# our codebase generates a lot of warnings by setting the -Wpedantic flag
11build --features=-all_warnings
12
Drew Macrae7ac1efb2021-09-22 16:08:28 +000013# Enable toolchain resolution with cc
14build --incompatible_enable_cc_toolchain_resolution
Drew Macrae399af402021-11-01 18:15:09 +000015
Drew Macrae3f2e2312021-12-02 21:56:00 +000016# This lets us generate key/value pairs for the workspace which can be
Drew Macrae399af402021-11-01 18:15:09 +000017# accessed like we do in util/BUILD
18build --workspace_status_command=util/get_workspace_status.sh
Chris Frantzb231f112021-12-02 15:42:10 -080019
20# Generate coverage in lcov format, which can be post-processed by lcov
21# into html-formatted reports.
22coverage --combined_report=lcov --instrument_test_targets --experimental_cc_coverage
Drew Macraed5536ef2021-12-12 19:33:59 -080023
24# Verilator is built for 4 cores and can time out if bazel is running more
25# than 1 test per four cores.
26# Until we get the built-in tag "cpu:4" to work for verilator tests, we can run
27# 1 test per 4 cores to avoid verilator performance falloff and timeouts we'd
28# otherwise see on machines with fewer than 40 cores.
29test --local_test_jobs=HOST_CPUS*0.25