• 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) {
37    sources += [
38      "XcbSurfaceKHR.cpp",
39      "XcbSurfaceKHR.hpp",
40      "libXCB.cpp",
41      "libXCB.hpp",
42    ]
43  }
44
45  if (is_win) {
46    sources += [
47      "Win32SurfaceKHR.cpp",
48      "Win32SurfaceKHR.hpp",
49    ]
50  }
51
52  if (is_mac) {
53    sources += [
54      "MetalSurface.hpp",
55      "MetalSurface.mm",
56    ]
57    frameworks = [
58      "Cocoa.framework",
59      "QuartzCore.framework",
60    ]
61    public_configs = [ ":WSI_metal_weak_framework" ]
62  }
63
64  include_dirs = [
65    "..",
66    "../../include",
67    "../../third_party/SPIRV-Headers/include",
68  ]
69
70  deps = [
71    "../../third_party/SPIRV-Tools:spvtools_headers",
72    "../../third_party/marl:Marl_headers",
73    "../System",
74    "../Vulkan:swiftshader_libvulkan_headers",
75  ]
76
77  configs = [ "../Vulkan:swiftshader_libvulkan_private_config" ]
78}
79