-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.bazelrc
39 lines (30 loc) · 1.28 KB
/
.bazelrc
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
# Disable Bzlmod (Bazel Modules)
# We need the last flag to avoid issues with rules_proto_grpc
# See https://github.com/rules-proto-grpc/rules_proto_grpc/issues/390 for info
common --enable_bzlmod=true --enable_workspace=false --noincompatible_disallow_ctx_resolve_tools --define=protobuf_allow_msvc=true
# Enable platform-specific configs
build --enable_platform_specific_config
# These hide symbols from the linker in order to prevent symbols collisions with
# libraries we load dynamically at runtime (LabJack is the primary source of this issue,
# as it relies an incompatible, legacy GRPC version).
build:hide_symbols --copt=-fvisibility=hidden --cxxopt=-fvisibility-inlines-hidden
# ===== Platform-Specific Compiler Settings =====
# macOS (Apple Silicon)
build:macos --cpu=darwin_arm64
build:macos --cxxopt=-std=c++20
build:macos --host_cxxopt=-std=c++20
# Linux
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
build:linux --copt=-Wno-error
# Windows (MSVC)
build:windows --enable_runfiles
build:windows --cxxopt=/std:c++20
build:windows --host_cxxopt=/std:c++20
# ===== Optimization Flags (used with -c opt) =====
build:opt --compilation_mode=opt
build:opt --strip=always
# Platform-agnostic optimization
build:opt --copt=-O3
build:opt --copt=-flto
build:opt --linkopt=-flto