• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 The SwiftShader Authors. All Rights Reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#    http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import("../swiftshader.gni")
16
17config("WSI_metal_weak_framework") {
18  if (is_mac) {
19    ldflags = [
20      "-weak_framework",
21      "Metal",
22    ]
23  }
24}
25
26swiftshader_source_set("WSI") {
27  sources = [
28    "HeadlessSurfaceKHR.cpp",
29    "HeadlessSurfaceKHR.hpp",
30    "VkSurfaceKHR.cpp",
31    "VkSurfaceKHR.hpp",
32    "VkSwapchainKHR.cpp",
33    "VkSwapchainKHR.hpp",
34  ]
35
36  if (is_linux || is_chromeos) {
37    sources += [
38      "XcbSurfaceKHR.cpp",
39      "XcbSurfaceKHR.hpp",
40      "XlibSurfaceKHR.cpp",
41      "XlibSurfaceKHR.hpp",
42      "libX11.cpp",
43      "libX11.hpp",
44    ]
45  }
46
47  if (is_win) {
48    sources += [
49      "Win32SurfaceKHR.cpp",
50      "Win32SurfaceKHR.hpp",
51    ]
52  }
53
54  if (is_mac) {
55    sources += [
56      "MetalSurface.hpp",
57      "MetalSurface.mm",
58    ]
59    frameworks = [
60      "Cocoa.framework",
61      "QuartzCore.framework",
62    ]
63    public_configs = [ ":WSI_metal_weak_framework" ]
64  }
65
66  include_dirs = [
67    "..",
68    "../../include",
69    "../../third_party/SPIRV-Headers/include",
70  ]
71
72  deps = [
73    "${swiftshader_spirv_tools_dir}:SPIRV-Tools",
74    "../../third_party/marl:Marl_headers",
75    "../System",
76    "../Vulkan:swiftshader_libvulkan_headers",
77  ]
78
79  configs = [ "../Vulkan:swiftshader_libvulkan_private_config" ]
80}
81