blob: f06d7b807f6725652f3227938def79f1c11d9bce [file] [log] [blame]
/*
* Copyright (C) 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package {
// See: http://go/android-license-faq
default_applicable_licenses: ["hardware_google_gfxstream_license"],
}
genrule {
name: "gfxstream_vk_entrypoints_header",
srcs: [":libmesa_vulkan_xml_gfxstream"],
out: ["gfxstream_vk_entrypoints.h"],
tools: ["vk_entrypoints_gen_gfxstream"],
cmd: "python3 $(location vk_entrypoints_gen_gfxstream) --xml " +
"$(location :libmesa_vulkan_xml_gfxstream) --proto --weak --out-h " +
"$(location gfxstream_vk_entrypoints.h) --out-c " +
"$(genDir)/placeholder.c --prefix gfxstream_vk --beta false",
}
genrule {
name: "gfxstream_vk_entrypoints_impl",
srcs: [":libmesa_vulkan_xml_gfxstream"],
out: ["gfxstream_vk_entrypoints.c"],
tools: ["vk_entrypoints_gen_gfxstream"],
cmd: "python3 $(location vk_entrypoints_gen_gfxstream) --xml " +
"$(location :libmesa_vulkan_xml_gfxstream) --proto --weak --out-h " +
"$(genDir)/gfxstream_vk_entrypoints.h --out-c " +
"$(location gfxstream_vk_entrypoints.c) --prefix gfxstream_vk " +
"--beta false",
}
cc_library_static {
name: "libgfxstream_guest_vulkan_entrypoints",
host_supported: true,
vendor: true,
defaults: [
"mesa_common_defaults_gfxstream",
],
header_libs: [
"mesa_common_headers_gfxstream",
],
static_libs: [
"libmesa_vulkan_util_gfxstream",
],
shared_libs: [
"libcutils",
],
generated_headers: [
"gfxstream_vk_entrypoints_header",
],
generated_sources: [
"gfxstream_vk_entrypoints_impl",
],
ldflags: [
"-Wl,-Bsymbolic",
"-Wl,--gc-sections",
],
export_generated_headers: [
"gfxstream_vk_entrypoints_header",
],
}
cc_library_headers {
name: "vulkan_enc_headers",
export_include_dirs: ["."],
host_supported: true,
vendor_available: true,
}
filegroup {
name: "vulkan_enc_impl",
srcs: [
"AndroidHardwareBuffer.cpp",
"CommandBufferStagingStream.cpp",
"DescriptorSetVirtualization.cpp",
"func_table.cpp",
"goldfish_vk_counting_guest.cpp",
"goldfish_vk_deepcopy_guest.cpp",
"goldfish_vk_extension_structs_guest.cpp",
"goldfish_vk_marshaling_guest.cpp",
"goldfish_vk_reserved_marshaling_guest.cpp",
"goldfish_vk_transform_guest.cpp",
"HostVisibleMemoryVirtualization.cpp",
"Resources.cpp",
"ResourceTracker.cpp",
"Validation.cpp",
"VkEncoder.cpp",
"VulkanHandleMapping.cpp",
"VulkanStreamGuest.cpp",
"gfxstream_vk_private.cpp",
],
}
cc_defaults {
name: "libgfxstream_guest_vulkan_encoder_defaults",
host_supported: true,
vendor: true,
defaults: [
"libgfxstream_guest_cc_defaults",
],
header_libs: [
"libgfxstream_vulkan_headers",
"libOpenglSystemCommonHeaders",
"libgfxstream_guest_iostream",
"libnativewindow_headers",
"mesa_common_headers_gfxstream",
],
generated_headers: [
"vk_cmd_queue_header_gfxstream",
"vk_physical_device_features_header_gfxstream",
"vk_physical_device_properties_header_gfxstream",
"u_format_pack_header_gfxstream",
],
shared_libs: [
"libcutils",
"liblog",
"libOpenglCodecCommon",
],
static_libs: [
"libarect",
"libdrm",
"libgfxstream_androidemu_static",
"libGoldfishAddressSpace",
"libmesa_vulkan_util_gfxstream",
"libmesa_vulkan_runtime_gfxstream",
"libgfxstream_guest_android",
"libgfxstream_guest_vulkan_entrypoints",
"libmesa_util_gfxstream",
"libmesa_util_format_gfxstream",
"libmesa_util_c11_gfxstream",
],
cflags: [
"-DLOG_TAG=\"goldfish_vulkan\"",
"-DVK_ANDROID_native_buffer",
"-DVK_EXT_device_memory_report",
"-DVK_GOOGLE_gfxstream",
"-DVK_NO_PROTOTYPES",
"-DVK_USE_PLATFORM_ANDROID_KHR",
"-fstrict-aliasing",
"-Werror",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
"-DHAVE_PTHREAD=1",
"-DHAVE_TIMESPEC_GET",
"-DHAVE_STRUCT_TIMESPEC",
],
srcs: [
":vulkan_enc_impl",
],
export_include_dirs: [
".",
],
ldflags: [
// Mesa always adds Bsymbolic when available (see 'ld_args_bsymbolic' in Meson build). Duplicate that
// behavior here. '--gc-sections' has stronger justification: this lets drivers drop
// shared code unused by that specific driver (particularly relevant for Vulkan drivers).
"-Wl,-Bsymbolic",
"-Wl,--gc-sections",
],
target: {
android: {
shared_libs: [
"libnativewindow",
],
header_libs: [
"hwvulkan_headers",
],
},
},
}
cc_library_static {
name: "libvulkan_enc",
defaults: [
"libgfxstream_guest_vulkan_encoder_defaults",
],
static_libs: [
"libplatform",
],
}
cc_library_static {
name: "libgfxstream_guest_vulkan_encoder_with_host",
defaults: [
"libgfxstream_guest_vulkan_encoder_defaults",
],
static_libs: [
"libgfxstream_platform_rutabaga",
],
export_static_lib_headers: [
"libgfxstream_platform_rutabaga",
],
target: {
host: {
compile_multilib: "64",
},
android: {
compile_multilib: "64",
},
},
}