Add version info to dxcompiler.dll and clarify that it's built for Dawn
This CL adds the missing version info to the built dxcompiler.dll, and
also overrides the File Description and Product Name fields to specify
that it is built for Dawn. This should help avoid confusion that this
DLL is not an official version from a Microsoft SDK.
Bug: dawn:1981
Change-Id: I3139fea62eece52f0e04e43568e28bccbde57da3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/147241
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/third_party/gn/dxc/BUILD.gn b/third_party/gn/dxc/BUILD.gn
index bc5b0f1..4b4740d 100644
--- a/third_party/gn/dxc/BUILD.gn
+++ b/third_party/gn/dxc/BUILD.gn
@@ -2208,6 +2208,23 @@
]
}
+source_set("windows_version_resource") {
+ defines = [
+ # Include version.inc
+ "INCLUDE_HLSL_VERSION_FILE",
+
+ # TODO(crbug.com/1473311): For now, GN's rc.exe doesn't handle empty string macros
+ # the same way as MS's rc.exe, so we make these single space strings.
+ "RC_INTERNAL_NAME=\" \"",
+ "RC_ORIGINAL_FILENAME=\" \"",
+ ]
+ include_dirs = [
+ # Use our custom "version.inc" that includes DXC's version.inc and overrides fields
+ "build/",
+ ]
+ sources = [ "$dawn_dxc_dir/resources/windows_version_resource.rc" ]
+}
+
loadable_module("dxcompiler") {
if (dawn_has_build) {
configs -= [ "//build/config/compiler:chromium_code" ]
@@ -2256,6 +2273,8 @@
if (is_win) {
sources = [ "$dawn_dxc_dir/tools/clang/tools/dxcompiler/DXCompiler.def" ]
+
+ deps += [ ":windows_version_resource" ]
}
}