Disable use_libcxx_modules for the transitive rdeps of common_config. The dxc_module template defines common_config in `public_configs`. This means that anything that transitively depends on :common_config cannot use libcxx_modules. It is currently configured to compile the libraries correctly, but cannot compile the executable targets that depend on them correctly. Bug: 425537956 Change-Id: If2d1ad66a100c02af6be0f785b051f0bfe1497d2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/258434 Commit-Queue: James Price <jrprice@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: James Price <jrprice@google.com>
diff --git a/third_party/gn/dxc/BUILD.gn b/third_party/gn/dxc/BUILD.gn index c35731c..f503eeb 100644 --- a/third_party/gn/dxc/BUILD.gn +++ b/third_party/gn/dxc/BUILD.gn
@@ -463,6 +463,13 @@ ## Common config shared by all targets ####################################################################### +# `:common_config` sets exceptions and RTTI and that is incompatible with +# libc++ clang modules. +# Unfortunately, we cannot set use_libcxx_modules = false in a config target, +# so it can't propogate to transitive dependencies - we have to do this +# manually. +use_libcxx_modules = false + config("common_config") { warning_flags = [] if (is_clang) { @@ -589,9 +596,7 @@ configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] - # `:common_config` sets exceptions and RTTI and that is incompatible with - # libc++ clang modules. - use_libcxx_modules = false + use_libcxx_modules = use_libcxx_modules } if (is_win) { # DXC is built with multibyte character set, so it expects Win32 functions to map the ANSI ones, not the UNICODE ones. @@ -739,6 +744,10 @@ source_set("TableGen") { public_deps = [ ":Support" ] + if (dawn_has_build) { + use_libcxx_modules = use_libcxx_modules + } + sources = [ "$dawn_dxc_dir/lib/TableGen/Error.cpp", "$dawn_dxc_dir/lib/TableGen/Main.cpp", @@ -754,6 +763,10 @@ executable("llvm-tblgen") { deps = [ ":TableGen" ] + if (dawn_has_build) { + use_libcxx_modules = use_libcxx_modules + } + sources = [ "$dawn_dxc_dir/utils/TableGen/AsmMatcherEmitter.cpp", "$dawn_dxc_dir/utils/TableGen/AsmWriterEmitter.cpp", @@ -789,6 +802,10 @@ executable("clang-tblgen") { deps = [ ":TableGen" ] + if (dawn_has_build) { + use_libcxx_modules = use_libcxx_modules + } + sources = [ "$dawn_dxc_dir/tools/clang/utils/TableGen/ClangASTNodesEmitter.cpp", "$dawn_dxc_dir/tools/clang/utils/TableGen/ClangAttrEmitter.cpp", @@ -2392,6 +2409,8 @@ if (dawn_has_build) { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] + + use_libcxx_modules = use_libcxx_modules } if (is_win) {