Skip to content

Commit 6adf830

Browse files
authored
bazel: Make clang config common (#42016)
non-build actions, eg query _can_ require a compiler toolchain Signed-off-by: Ryan Northey <[email protected]>
1 parent ad4ddf2 commit 6adf830

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.bazelrc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ build:sanitizer --linkopt -ldl
9494
test:sanitizer --build_tests_only
9595

9696
# Common flags for Clang (shared between all clang variants)
97-
build:clang-common --action_env=BAZEL_COMPILER=clang
98-
build:clang-common --linkopt=-fuse-ld=lld
99-
build:clang-common --action_env=CC=clang --host_action_env=CC=clang
100-
build:clang-common --action_env=CXX=clang++ --host_action_env=CXX=clang++
101-
build:clang-common --incompatible_enable_cc_toolchain_resolution=false
97+
common:clang-common --action_env=BAZEL_COMPILER=clang
98+
common:clang-common --linkopt=-fuse-ld=lld
99+
common:clang-common --action_env=CC=clang --host_action_env=CC=clang
100+
common:clang-common --action_env=CXX=clang++ --host_action_env=CXX=clang++
101+
common:clang-common --incompatible_enable_cc_toolchain_resolution=false
102102

103103
# Clang with libc++ (default)
104-
build:clang --config=clang-common
105-
build:clang --config=libc++
104+
common:clang --config=clang-common
105+
common:clang --config=libc++
106106

107107
build:arm64-clang --config=clang
108108

@@ -222,13 +222,13 @@ build:msan --test_env=MSAN_SYMBOLIZER_PATH
222222
build:msan --copt -O1
223223
build:msan --copt -fno-optimize-sibling-calls
224224

225-
build:libc++ --action_env=CXXFLAGS=-stdlib=libc++
226-
build:libc++ --action_env=LDFLAGS=-stdlib=libc++
227-
build:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++
228-
build:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a
229-
build:libc++ --action_env=BAZEL_LINKOPTS=-lm:-pthread
230-
build:libc++ --define force_libcpp=enabled
231-
build:libc++ --@envoy//bazel:libc++=true
225+
common:libc++ --action_env=CXXFLAGS=-stdlib=libc++
226+
common:libc++ --action_env=LDFLAGS=-stdlib=libc++
227+
common:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++
228+
common:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a
229+
common:libc++ --action_env=BAZEL_LINKOPTS=-lm:-pthread
230+
common:libc++ --define force_libcpp=enabled
231+
common:libc++ --@envoy//bazel:libc++=true
232232

233233

234234

0 commit comments

Comments
 (0)