-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bazelrc
More file actions
73 lines (54 loc) · 1.9 KB
/
Copy path.bazelrc
File metadata and controls
73 lines (54 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
build --cxxopt=-std=c++20
build --cxxopt=-Wall
build --cxxopt=-Wextra
# ========================================
# Performance Optimization Flags
# ========================================
# Basic optimization level
build --cxxopt=-O3
# Link-Time Optimization (LTO) - enables inter-procedural optimizations
build --cxxopt=-flto
build --linkopt=-flto
# CPU-specific optimizations (march=native uses all available CPU features)
build --cxxopt=-march=native
build --cxxopt=-mtune=native
# Fast math optimizations (be careful with floating point precision)
build --cxxopt=-ffast-math
# Inline optimizations
build --cxxopt=-finline-functions
build --cxxopt=-finline-limit=1000
# Loop optimizations
build --cxxopt=-ftree-vectorize
build --cxxopt=-funroll-loops
# Branch prediction optimizations
# build --cxxopt=-fprofile-use-path-prefix # Not supported in GCC 13
build --cxxopt=-fpredictive-commoning
# Devirtualization and IPA optimizations
build --cxxopt=-fdevirtualize-at-ltrans
build --cxxopt=-fipa-pta
# Omit frame pointer for better performance (x86_64)
build --cxxopt=-fomit-frame-pointer
# No exceptions for better performance (if not needed)
# build --cxxopt=-fno-exceptions
# NDEBUG to disable assertions in release builds
build --cxxopt=-DNDEBUG
# Linker optimizations
build --linkopt=-Wl,-O2
build --linkopt=-Wl,--as-needed
# Strip debug symbols for smaller binary
# build --stripopt=always
# ========================================
# Architecture-specific SIMD optimizations
# ========================================
# Uncomment if you want to enable specific SIMD instruction sets
# build --cxxopt=-mavx2
# build --cxxopt=-msse4.2
# build --cxxopt=-mfma
# ========================================
# Use GCC 13 as the compiler (supports C++20 <format>)
build --repo_env=CC=/usr/bin/gcc-13
build --repo_env=CXX=/usr/bin/g++-13
# Enable color output
build --color=yes
# Show detailed test output
test --test_output=all