@@ -259,15 +259,6 @@ def cc_toolchain_config(
259
259
"-std=" + cxx_standard ,
260
260
"-stdlib=libc++" ,
261
261
]
262
- if major_llvm_version >= 14 :
263
- # With C++20, Clang defaults to using C++ rather than Clang modules,
264
- # which breaks Bazel's `use_module_maps` feature, which is used by
265
- # `layering_check`. Since Bazel doesn't support C++ modules yet, it
266
- # is safe to disable them globally until the toolchain shipped by
267
- # Bazel sets this flag on `use_module_maps`.
268
- # https://github.com/llvm/llvm-project/commit/0556138624edf48621dd49a463dbe12e7101f17d
269
- cxx_flags .append ("-Xclang" )
270
- cxx_flags .append ("-fno-cxx-modules" )
271
262
if use_lld :
272
263
# For single-platform builds, we can statically link the bundled
273
264
# libraries.
@@ -343,6 +334,16 @@ def cc_toolchain_config(
343
334
else :
344
335
fail ("Unknown value passed for stdlib: {stdlib}" .format (stdlib = stdlib ))
345
336
337
+ if major_llvm_version >= 14 :
338
+ # With C++20, Clang defaults to using C++ rather than Clang modules,
339
+ # which breaks Bazel's `use_module_maps` feature, which is used by
340
+ # `layering_check`. Since Bazel doesn't support C++ modules yet, it
341
+ # is safe to disable them globally until the toolchain shipped by
342
+ # Bazel sets this flag on `use_module_maps`.
343
+ # https://github.com/llvm/llvm-project/commit/0556138624edf48621dd49a463dbe12e7101f17d
344
+ cxx_flags .append ("-Xclang" )
345
+ cxx_flags .append ("-fno-cxx-modules" )
346
+
346
347
opt_link_flags = ["-Wl,--gc-sections" ] if target_os == "linux" else []
347
348
348
349
# Coverage flags:
0 commit comments