-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.bazelrc
32 lines (25 loc) · 1.43 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
common --enable_platform_specific_config
# Determines whether C++ binaries will be linked dynamically, interacting with the linkstatic attribute on build rules.
# off: Links all targets in mostly static mode. If -static is set in linkopts, targets will change to fully static.
build --dynamic_mode=off
# Don't clobber bazel-out/[platform]/bin
build --experimental_platform_in_output_dir
# On Linux (targetting linux and macos) use the zig toolchain from hermetic_cc_toolchain
build:linux --platforms @zig_sdk//libc_aware/platform:linux_amd64_musl
build:linux --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:linux --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:linux --host_action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# On Windows, use the host toolchain
# NB: after https://github.com/uber/hermetic_cc_toolchain/pull/190 is included in a release,
# this flag should no longer be needed.
build:windows --noincompatible_enable_cc_toolchain_resolution
build --incompatible_strict_action_env
build --features=thin_lto
# ThinLTO feature doesn't exist in Zig toolchain, so we must set the flags manually.
# It also doesn't support LTO on darwin targets, so we can't set this globally.
# Instead, we configure copt/linkopt inside the toolchain itself (with a WORKSPACE patch).
#build --copt -flto=thin
# Compilation Flags for zig-cc
build --compilation_mode=opt --strip=always
build:linux --copt -ffunction-sections
build:linux --copt -fdata-sections