blob: 0c85c4e24aa0a404bc1ca04329b27b1e450b94ba [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/sdk_shared_library.gni")
import("//build/package.gni")
declare_args() {
vk_loader_debug = "warn,error"
}
package("vulkan_loader") {
deprecated_system_image = true
deps = [
":loader",
]
libraries = [
{
name = "libvulkan.so"
},
]
}
sdk_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_utils.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",
]
# TODO(MA-488) - while libtrace-engine.so is needed by vulkan icd
# the app has to provide it, so we add the dep here.
deps += [ "//zircon/public/lib/trace-engine" ]
# 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",
]
# TODO(MA-488): remove this too
runtime_deps += [ "//zircon/public/lib/trace-engine:trace-engine_sdk" ]
}