Drew Macrae | 78a5887 | 2021-09-07 20:52:19 +0000 | [diff] [blame] | 1 | # 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 Macrae | 7ac1efb | 2021-09-22 16:08:28 +0000 | [diff] [blame] | 5 | # https://docs.opentitan.org/doc/rm/c_cpp_coding_style/#cxx-version specifies |
Drew Macrae | 78a5887 | 2021-09-07 20:52:19 +0000 | [diff] [blame] | 6 | build --cxxopt='-std=c++14' |
Drew Macrae | 7ac1efb | 2021-09-22 16:08:28 +0000 | [diff] [blame] | 7 | build --conlyopt='-std=c11' |
| 8 | |
Drew Macrae | 3f2e231 | 2021-12-02 21:56:00 +0000 | [diff] [blame] | 9 | # 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 |
| 11 | build --features=-all_warnings |
| 12 | |
Drew Macrae | 7ac1efb | 2021-09-22 16:08:28 +0000 | [diff] [blame] | 13 | # Enable toolchain resolution with cc |
| 14 | build --incompatible_enable_cc_toolchain_resolution |
Drew Macrae | 399af40 | 2021-11-01 18:15:09 +0000 | [diff] [blame] | 15 | |
Drew Macrae | 3f2e231 | 2021-12-02 21:56:00 +0000 | [diff] [blame] | 16 | # This lets us generate key/value pairs for the workspace which can be |
Drew Macrae | 399af40 | 2021-11-01 18:15:09 +0000 | [diff] [blame] | 17 | # accessed like we do in util/BUILD |
| 18 | build --workspace_status_command=util/get_workspace_status.sh |
Chris Frantz | b231f11 | 2021-12-02 15:42:10 -0800 | [diff] [blame] | 19 | |
| 20 | # Generate coverage in lcov format, which can be post-processed by lcov |
| 21 | # into html-formatted reports. |
| 22 | coverage --combined_report=lcov --instrument_test_targets --experimental_cc_coverage |
Drew Macrae | d5536ef | 2021-12-12 19:33:59 -0800 | [diff] [blame] | 23 | |
| 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. |
| 29 | test --local_test_jobs=HOST_CPUS*0.25 |