OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("features.gni") | 5 import("//build/config/ui.gni") |
6 import("//build/buildflag_header.gni") | |
7 import("//testing/test.gni") | 6 import("//testing/test.gni") |
8 | 7 |
9 # Generate a buildflag header for compile-time checking of Vulkan support. | 8 config("vulkan_config") { |
10 buildflag_header("features") { | 9 defines = [ "ENABLE_VULKAN" ] |
11 header = "features.h" | |
12 flags = [ "ENABLE_VULKAN=$enable_vulkan" ] | |
13 } | 10 } |
| 11 |
14 if (enable_vulkan) { | 12 if (enable_vulkan) { |
15 vulkan_lib_dir = getenv("VULKAN_SDK") + "/lib" | 13 vulkan_lib_dir = getenv("VULKAN_SDK") + "/lib" |
16 component("vulkan") { | 14 component("vulkan") { |
17 output_name = "vulkan_wrapper" | 15 output_name = "vulkan_wrapper" |
18 | 16 |
19 if (is_linux) { | 17 if (is_linux) { |
20 assert(use_x11, "Vulkan only support x11 at this point.") | 18 assert(use_x11, "Vulkan only support x11 at this point.") |
21 sources = [ | 19 sources = [ |
22 "vulkan_command_buffer.cc", | 20 "vulkan_command_buffer.cc", |
23 "vulkan_command_buffer.h", | 21 "vulkan_command_buffer.h", |
(...skipping 21 matching lines...) Expand all Loading... |
45 "vulkan_shader_module.h", | 43 "vulkan_shader_module.h", |
46 "vulkan_surface.cc", | 44 "vulkan_surface.cc", |
47 "vulkan_surface.h", | 45 "vulkan_surface.h", |
48 "vulkan_swap_chain.cc", | 46 "vulkan_swap_chain.cc", |
49 "vulkan_swap_chain.h", | 47 "vulkan_swap_chain.h", |
50 ] | 48 ] |
51 | 49 |
52 configs += [ "//build/config:precompiled_headers" ] | 50 configs += [ "//build/config:precompiled_headers" ] |
53 defines = [ "VULKAN_IMPLEMENTATION" ] | 51 defines = [ "VULKAN_IMPLEMENTATION" ] |
54 | 52 |
55 all_dependent_configs = [ "//third_party/vulkan:vulkan_headers" ] | 53 all_dependent_configs = [ |
| 54 ":vulkan_config", |
| 55 "//third_party/vulkan:vulkan_headers", |
| 56 ] |
56 libs = [ "vulkan" ] | 57 libs = [ "vulkan" ] |
57 | 58 |
58 if (current_cpu == "x64") { | 59 if (current_cpu == "x64") { |
59 lib_dirs = [ | 60 lib_dirs = [ |
60 "/usr/lib/x86_64-linux-gnu", | 61 "/usr/lib/x86_64-linux-gnu", |
61 vulkan_lib_dir, | 62 vulkan_lib_dir, |
62 ] | 63 ] |
63 } else { | 64 } else { |
64 assert(false, "Unsupported vulkan target: " + current_cpu) | 65 assert(false, "Unsupported vulkan target: " + current_cpu) |
65 } | 66 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 "//testing/gtest", | 106 "//testing/gtest", |
106 ] | 107 ] |
107 | 108 |
108 if (use_x11) { | 109 if (use_x11) { |
109 sources += [ "tests/native_window_x11.cc" ] | 110 sources += [ "tests/native_window_x11.cc" ] |
110 deps += [ "//ui/gfx/x" ] | 111 deps += [ "//ui/gfx/x" ] |
111 configs += [ "//build/config/linux:x11" ] | 112 configs += [ "//build/config/linux:x11" ] |
112 } | 113 } |
113 } | 114 } |
114 } | 115 } |
OLD | NEW |