Build fix for MacOS and Fuchsia
There was linux specific code in Vulkan's BUILD.gn file.
Change-Id: I22b8cd0b97bd6acfb545e582c6e1dc784f00b2cb
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32388
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Vulkan/BUILD.gn b/src/Vulkan/BUILD.gn
index 3eff7f7..2090f65 100644
--- a/src/Vulkan/BUILD.gn
+++ b/src/Vulkan/BUILD.gn
@@ -17,10 +17,14 @@
# Need a separate config to ensure the warnings are added to the end.
config("swiftshader_libvulkan_private_config") {
- defines = [
- "VK_USE_PLATFORM_XLIB_KHR",
- "VK_EXPORT=__attribute__((visibility(\"default\")))",
- ]
+ if (is_linux) {
+ defines = [
+ "VK_USE_PLATFORM_XLIB_KHR",
+ "VK_EXPORT=__attribute__((visibility(\"default\")))",
+ ]
+ } else {
+ defines = [ "VK_EXPORT=" ]
+ }
cflags = [
"-Wno-unused-private-field",