blob: e5b2519ddf05413a3c99170b4d5815569786343a [file] [log] [blame]
# 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_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_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 (target_cpu == "x64") {
lib_dirs = [ "/usr/lib/x86_64-linux-gnu" ]
} else {
assert(false, "Unsupported vulkan target: " + target_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/native_window.h",
"tests/vulkan_test.cc",
"tests/vulkan_tests_main.cc",
]
include_dirs = [ "/usr/include" ]
if (target_cpu == "x64") {
lib_dirs = [ "/usr/lib/x86_64-linux-gnu" ]
} else {
assert(false, "Unsupported vulkan target: " + target_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" ]
}
}
}