OSDN Git Service

MetalSurface: set layer.device to a ref of the system default device.
[android-x86/external-swiftshader.git] / src / WSI / BUILD.gn
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
15 import("../swiftshader.gni")
16
17 config("WSI_metal_weak_framework") {
18   if (is_mac) {
19     ldflags = [
20       "-weak_framework",
21       "Metal",
22     ]
23   }
24 }
25
26 swiftshader_source_set("WSI") {
27   sources = [
28     "VkSurfaceKHR.cpp",
29     "VkSurfaceKHR.hpp",
30     "VkSwapchainKHR.cpp",
31     "VkSwapchainKHR.hpp",
32   ]
33
34   if (is_linux) {
35     sources += [
36       "XcbSurfaceKHR.cpp",
37       "XcbSurfaceKHR.hpp",
38       "XlibSurfaceKHR.cpp",
39       "XlibSurfaceKHR.hpp",
40       "libX11.cpp",
41       "libX11.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.h",
55       "MetalSurface.mm",
56     ]
57     libs = [
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/marl:Marl_headers",
72     "../System",
73     "../Vulkan:swiftshader_libvulkan_headers",
74   ]
75
76   configs = [ "../Vulkan:swiftshader_libvulkan_private_config" ]
77 }