| # Copyright 2019 The SwiftShader Authors. All Rights Reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//build_overrides/build.gni") |
| import("../swiftshader.gni") |
| |
| # Need a separate config to ensure the warnings are added to the end. |
| config("swiftshader_libvulkan_private_config") { |
| if (is_linux) { |
| defines = [ |
| "VK_USE_PLATFORM_XLIB_KHR", |
| "VK_EXPORT=__attribute__((visibility(\"default\")))", |
| ] |
| } else { |
| defines = [ "VK_EXPORT=" ] |
| } |
| |
| cflags = [ |
| "-Wno-unused-private-field", |
| "-Wno-switch", |
| ] |
| } |
| |
| swiftshader_shared_library("swiftshader_libvulkan") { |
| sources = [ |
| "Version.h", |
| "VkBuffer.cpp", |
| "VkBuffer.hpp", |
| "VkBufferView.cpp", |
| "VkBufferView.hpp", |
| "VkCommandBuffer.cpp", |
| "VkCommandBuffer.hpp", |
| "VkCommandPool.cpp", |
| "VkCommandPool.hpp", |
| "VkConfig.h", |
| "VkDebug.cpp", |
| "VkDebug.hpp", |
| "VkDescriptorPool.cpp", |
| "VkDescriptorPool.hpp", |
| "VkDescriptorSet.hpp", |
| "VkDescriptorSetLayout.cpp", |
| "VkDescriptorSetLayout.hpp", |
| "VkDescriptorUpdateTemplate.cpp", |
| "VkDescriptorUpdateTemplate.hpp", |
| "VkDestroy.h", |
| "VkDevice.cpp", |
| "VkDevice.hpp", |
| "VkDeviceMemory.cpp", |
| "VkDeviceMemory.hpp", |
| "VkEvent.hpp", |
| "VkFence.hpp", |
| "VkFormat.cpp", |
| "VkFormat.h", |
| "VkFramebuffer.cpp", |
| "VkFramebuffer.hpp", |
| "VkGetProcAddress.cpp", |
| "VkGetProcAddress.h", |
| "VkImage.cpp", |
| "VkImage.hpp", |
| "VkImageView.cpp", |
| "VkImageView.hpp", |
| "VkInstance.cpp", |
| "VkInstance.hpp", |
| "VkMemory.cpp", |
| "VkMemory.h", |
| "VkObject.hpp", |
| "VkPhysicalDevice.cpp", |
| "VkPhysicalDevice.hpp", |
| "VkPipeline.cpp", |
| "VkPipeline.hpp", |
| "VkPipelineCache.cpp", |
| "VkPipelineCache.hpp", |
| "VkPipelineLayout.cpp", |
| "VkPipelineLayout.hpp", |
| "VkPromotedExtensions.cpp", |
| "VkQueryPool.cpp", |
| "VkQueryPool.hpp", |
| "VkQueue.cpp", |
| "VkQueue.hpp", |
| "VkRenderPass.cpp", |
| "VkRenderPass.hpp", |
| "VkSampler.cpp", |
| "VkSampler.hpp", |
| "VkSemaphore.hpp", |
| "VkShaderModule.cpp", |
| "VkShaderModule.hpp", |
| "Vulkan.rc", |
| "VulkanPlatform.h", |
| "libVulkan.cpp", |
| "libvk_swiftshader.def", |
| "main.cpp", |
| "resource.h", |
| ] |
| |
| configs = [ ":swiftshader_libvulkan_private_config" ] |
| |
| output_name = "libvulkan" |
| output_dir = "$root_out_dir/swiftshader" |
| |
| if (is_mac) { |
| ldflags = [ |
| "-Wl,-install_name,@rpath/libvk_swiftshader.dylib", |
| "-Wl,-exported_symbols_list," + |
| rebase_path("libvk_swiftshader.exports", root_build_dir), |
| ] |
| } else if (is_linux) { |
| inputs = [ |
| "libvk_swiftshader.lds", |
| ] |
| ldflags = [ "-Wl,--version-script=" + |
| rebase_path("libvk_swiftshader.lds", root_build_dir) ] |
| } |
| |
| deps = [ |
| "../Device", |
| "../Pipeline", |
| "../Reactor:swiftshader_llvm_reactor", |
| "../System", |
| "../WSI", |
| ] |
| |
| include_dirs = [ |
| "..", |
| "../../include", |
| "../../third_party/SPIRV-Headers/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" ] |
| } |
| } |