blob: 48a383d9bf341f65b633c1d370d044dac54a22bd [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
import("//build/cpp/prebuilt_shared_library.gni")
import("//build/package.gni")
import("//build/fidl/toolchain.gni")
declare_args() {
vk_loader_debug = "warn,error"
}
package("vulkan_loader") {
deprecated_system_image = true
deps = [
":loader",
]
libraries = [
{
name = "libvulkan.so"
},
]
}
prebuilt_shared_library("loader") {
# The Vulkan loader is named libvulkan
output_name = "vulkan"
category = "partner"
# The Vulkan loader's interface is defined by standard Khronos vulkan headers
# which can be obtained separately from the loader implementation itself.
no_headers = true
configs += [
"../:vulkan_build_config",
"../:include_extra_vulkan_headers",
]
include_dirs = [ "." ]
cflags_c = [
"-Wno-missing-field-initializers",
"-DSYSCONFDIR=\"/config\"",
"-DEXTRASYSCONFDIR=\"/pkg/data\"",
"-DDATADIR=\"/usr/share\"",
]
defines = [ "VK_LOADER_DEBUG=\"$vk_loader_debug\"" ]
sources = [
"cJSON.c",
"debug_report.c",
"dev_ext_trampoline.c",
"dlopen_fuchsia.c",
"extension_manual.c",
"loader.c",
"murmurhash.c",
"phys_dev_ext.c",
"trampoline.c",
"unknown_ext_chain.c",
"wsi.c",
]
deps = [
"//garnet/public/fidl/fuchsia.vulkan.loader:fuchsia.vulkan.loader_c_client",
"//zircon/public/lib/fdio",
# The loaded libraries depend on the framebuffer
# library to provide their WSI implementation a stable zircon display
# API.
# TODO(ZX-2277): Once the display controller API can provide a stable,
# statically linkable display API, switch framebuffer back to a static
# library and remove this dependency.
"//zircon/public/lib/framebuffer",
]
# This is a C only library, but we have to tell the linker driver that
# explicitly or it assumes we want to dynamically link against the C++
# standard library.
ldflags = [ "-nostdlib++" ]
libs = [
"zircon"
]
runtime_deps = [
"//zircon/public/lib/fdio:fdio_sdk",
]
}