Support Windows builds and ANGLE integration.
This CL enables the Windows build integration with ANGLE. Several
instances of "build_with_chromium" in the GN are changed to use
build_overrides instead. Also in several places in the GN support
is added for Windows builds.
Also Add guards for WIN32_LEAN_AND_MEAN, and removes an unused
variable that shows up when building with GN on Windows configs.
Bug: angleproject:3876
Bug: b/140251624
Change-Id: I7a470c7605c2b62420dca44e4797c29983ed7c13
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35631
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Jamie Madill <jmadill@chromium.org>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Vulkan/BUILD.gn b/src/Vulkan/BUILD.gn
index a52828b..53729f3 100644
--- a/src/Vulkan/BUILD.gn
+++ b/src/Vulkan/BUILD.gn
@@ -27,6 +27,11 @@
"VK_USE_PLATFORM_FUCHSIA=1",
"VK_EXPORT=__attribute__((visibility(\"default\")))",
]
+ } else if (is_win) {
+ defines = [
+ "VK_USE_PLATFORM_WIN32_KHR=1",
+ "VK_EXPORT=",
+ ]
} else {
defines = [ "VK_EXPORT=" ]
}
@@ -134,19 +139,13 @@
"../System",
"../WSI",
"../Yarn",
+ "$swiftshader_spirv_tools_dir:SPIRV-Tools",
]
include_dirs = [
"..",
"../../include",
- "../../third_party/SPIRV-Headers/include",
+ "$swiftshader_spirv_tools_dir/include",
+ "$spirv_tools_spirv_headers_dir/include",
]
-
- if (build_with_chromium) {
- deps += [ "//third_party/SPIRV-Tools/src:SPIRV-Tools" ]
- include_dirs += [ "//third_party/SPIRV-Tools/src/include" ]
- } else {
- deps += [ "../../third_party/SPIRV-Tools" ]
- include_dirs += [ "../../third_party/SPIRV-Tools/include" ]
- }
}
diff --git a/src/Vulkan/libvk_swiftshader.def b/src/Vulkan/libvk_swiftshader.def
index f0de6a5..32109ab 100644
--- a/src/Vulkan/libvk_swiftshader.def
+++ b/src/Vulkan/libvk_swiftshader.def
@@ -215,4 +215,4 @@
vkGetPhysicalDeviceSurfaceFormatsKHR
vkGetPhysicalDeviceSurfacePresentModesKHR
; VK_KHR_win32_surface
- vkCreateWin32SurfaceKHR
\ No newline at end of file
+ vkCreateWin32SurfaceKHR
diff --git a/src/Vulkan/vk_swiftshader_icd.json b/src/Vulkan/vk_swiftshader_icd.json
index 0a76e0b..47c23ac 100644
--- a/src/Vulkan/vk_swiftshader_icd.json
+++ b/src/Vulkan/vk_swiftshader_icd.json
@@ -1,7 +1,7 @@
{
"file_format_version": "1.0.0",
"ICD": {
- "library_path": "..\\..\\bin\\vulkan\\x64\\Debug\\vk_swiftshader.dll",
+ "library_path": "..\\..\\bin\\vulkan\\x64\\Debug\\libvk_swiftshader.dll",
"api_version": "1.0.5"
}
}
\ No newline at end of file