forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.gn
108 lines (95 loc) · 2.75 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/ui.gni")
import("//testing/test.gni")
config("vulkan_config") {
defines = [ "ENABLE_VULKAN" ]
}
if (enable_vulkan) {
component("vulkan") {
output_name = "vulkan_wrapper"
if (is_linux) {
assert(use_x11, "Vulkan only support x11 at this point.")
sources = [
"vulkan_command_buffer.cc",
"vulkan_command_buffer.h",
"vulkan_command_pool.cc",
"vulkan_command_pool.h",
"vulkan_descriptor_layout.cc",
"vulkan_descriptor_layout.h",
"vulkan_descriptor_pool.cc",
"vulkan_descriptor_pool.h",
"vulkan_descriptor_set.cc",
"vulkan_descriptor_set.h",
"vulkan_device_queue.cc",
"vulkan_device_queue.h",
"vulkan_export.h",
"vulkan_image_view.cc",
"vulkan_image_view.h",
"vulkan_implementation.cc",
"vulkan_implementation.h",
"vulkan_platform.h",
"vulkan_render_pass.cc",
"vulkan_render_pass.h",
"vulkan_sampler.cc",
"vulkan_sampler.h",
"vulkan_shader_module.cc",
"vulkan_shader_module.h",
"vulkan_surface.cc",
"vulkan_surface.h",
"vulkan_swap_chain.cc",
"vulkan_swap_chain.h",
]
configs += [ "//build/config:precompiled_headers" ]
defines = [ "VULKAN_IMPLEMENTATION" ]
all_dependent_configs = [
":vulkan_config",
"//third_party/vulkan:vulkan_headers",
]
libs = [ "vulkan" ]
if (current_cpu == "x64") {
lib_dirs = [ "/usr/lib/x86_64-linux-gnu" ]
} else {
assert(false, "Unsupported vulkan target: " + current_cpu)
}
deps = [
"//base",
"//third_party/shaderc:libshaderc",
"//ui/base",
"//ui/gfx",
]
if (use_x11) {
deps += [ "//ui/gfx/x" ]
configs += [ "//build/config/linux:x11" ]
}
}
}
test("vulkan_tests") {
sources = [
"tests/basic_vulkan_test.cc",
"tests/basic_vulkan_test.h",
"tests/native_window.h",
"tests/shader_module_unittest.cc",
"tests/vulkan_test.cc",
"tests/vulkan_tests_main.cc",
]
include_dirs = [ "/usr/include" ]
if (current_cpu == "x64") {
lib_dirs = [ "/usr/lib/x86_64-linux-gnu" ]
} else {
assert(false, "Unsupported vulkan target: " + current_cpu)
}
deps = [
":vulkan",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
if (use_x11) {
sources += [ "tests/native_window_x11.cc" ]
deps += [ "//ui/gfx/x" ]
configs += [ "//build/config/linux:x11" ]
}
}
}