gfxstream: use absolute path for some code
Some code may be auto-generated, some may not be. Eventually we want to move autogenerated code into specialized directories, so it be generated but not necessarily checked in [for certain cases]. Also, nuke codegen for CMakeLists.txt: we have multiple other build systems now (Blueprint, meson), and it doesn't make sense codegen one anymore. Reviewed-by: Aaron Ruby <aruby@blackberry.com> Acked-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
committed by
Marge Bot
parent
bfacad0e96
commit
1e49af4f71
@@ -193,19 +193,6 @@ autogeneratedHeaderTemplate = """
|
||||
// python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o $CEREAL_OUTPUT_DIR
|
||||
//
|
||||
"""
|
||||
|
||||
autogeneratedMkTemplate = """
|
||||
# Autogenerated makefile
|
||||
# %s
|
||||
# Please do not modify directly;
|
||||
# re-run gfxstream-protocols/scripts/generate-vulkan-sources.sh,
|
||||
# or directly from Python by defining:
|
||||
# VULKAN_REGISTRY_XML_DIR : Directory containing vk.xml
|
||||
# VULKAN_REGISTRY_SCRIPTS_DIR : Directory containing genvk.py
|
||||
# CEREAL_OUTPUT_DIR: Where to put the generated sources.
|
||||
# python3 $VULKAN_REGISTRY_SCRIPTS_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o $CEREAL_OUTPUT_DIR
|
||||
"""
|
||||
|
||||
namespaceBegin ="""
|
||||
namespace gfxstream {
|
||||
namespace vk {\n
|
||||
@@ -266,41 +253,13 @@ class CerealGenerator(OutputGenerator):
|
||||
self.featureSupported = False
|
||||
self.supportedModules = None
|
||||
|
||||
self.guestBaseLibDirPrefix = \
|
||||
envGetOrDefault("VK_CEREAL_GUEST_BASELIB_PREFIX", "aemu/base")
|
||||
self.baseLibDirPrefix = \
|
||||
envGetOrDefault("VK_CEREAL_BASELIB_PREFIX", "aemu/base")
|
||||
self.baseLibLinkName = \
|
||||
envGetOrDefault("VK_CEREAL_BASELIB_LINKNAME", "android-emu-base")
|
||||
self.vulkanHeaderTargetName = envGetOrDefault("VK_CEREAL_VK_HEADER_TARGET", "")
|
||||
self.utilsHeader = envGetOrDefault("VK_CEREAL_UTILS_LINKNAME", "")
|
||||
self.utilsHeaderDirPrefix = envGetOrDefault("VK_CEREAL_UTILS_PREFIX", "utils")
|
||||
self.guestBaseLibDirPrefix = "aemu/base"
|
||||
self.baseLibDirPrefix = "aemu/base"
|
||||
self.utilsHeaderDirPrefix = "utils"
|
||||
|
||||
# THe host always needs all possible guest struct definitions, while the guest only needs
|
||||
# platform sepcific headers.
|
||||
self.hostCommonExtraVulkanHeaders = '#include "vk_android_native_buffer_gfxstream.h"'
|
||||
self.host_cmake_generator = lambda cppFiles: f"""{autogeneratedMkTemplate % banner_command(sys.argv)}
|
||||
add_library(OpenglRender_vulkan_cereal {cppFiles})
|
||||
target_compile_definitions(OpenglRender_vulkan_cereal PRIVATE -DVK_GOOGLE_gfxstream)
|
||||
if (WIN32)
|
||||
target_compile_definitions(OpenglRender_vulkan_cereal PRIVATE -DVK_USE_PLATFORM_WIN32_KHR)
|
||||
endif()
|
||||
target_link_libraries(
|
||||
OpenglRender_vulkan_cereal
|
||||
PUBLIC
|
||||
{self.baseLibLinkName}
|
||||
{self.vulkanHeaderTargetName}
|
||||
PRIVATE
|
||||
{self.utilsHeader})
|
||||
|
||||
target_include_directories(OpenglRender_vulkan_cereal
|
||||
PUBLIC
|
||||
.
|
||||
PRIVATE
|
||||
..
|
||||
../..
|
||||
../../../include)
|
||||
"""
|
||||
|
||||
encoderInclude = f"""
|
||||
#include "{self.guestBaseLibDirPrefix}/AndroidHealthMonitor.h"
|
||||
@@ -496,7 +455,7 @@ using DlSymFunc = void* (void*, const char*);
|
||||
#include <memory>
|
||||
#include "{self.utilsHeaderDirPrefix}/GfxApiLogger.h"
|
||||
#include "{self.baseLibDirPrefix}/HealthMonitor.h"
|
||||
#include "common/goldfish_vk_private_defs.h"
|
||||
#include "goldfish_vk_private_defs.h"
|
||||
"""
|
||||
decoderSnapshotImplIncludes = f"""
|
||||
#include "VulkanHandleMapping.h"
|
||||
@@ -522,7 +481,7 @@ class BumpPool;
|
||||
decoderImplIncludes = f"""
|
||||
#include "common/goldfish_vk_marshaling.h"
|
||||
#include "common/goldfish_vk_reserved_marshaling.h"
|
||||
#include "common/goldfish_vk_private_defs.h"
|
||||
#include "goldfish_vk_private_defs.h"
|
||||
#include "common/goldfish_vk_transform.h"
|
||||
|
||||
#include "{self.baseLibDirPrefix}/BumpPool.h"
|
||||
@@ -674,22 +633,6 @@ class BumpPool;
|
||||
self.addWrapper(cereal.VulkanAndroidNativeBufferStructureType,
|
||||
"vk_android_native_buffer_structure_type")
|
||||
|
||||
self.guestAndroidMkCppFiles = ""
|
||||
self.hostCMakeCppFiles = ""
|
||||
self.hostDecoderCMakeCppFiles = ""
|
||||
|
||||
def addSrcEntry(m):
|
||||
mkSrcEntry = m.getMakefileSrcEntry()
|
||||
cmakeSrcEntry = m.getCMakeSrcEntry()
|
||||
if m.directory == self.guest_encoder_tag:
|
||||
self.guestAndroidMkCppFiles += mkSrcEntry
|
||||
elif m.directory == self.host_tag:
|
||||
self.hostDecoderCMakeCppFiles += cmakeSrcEntry
|
||||
else:
|
||||
self.hostCMakeCppFiles += cmakeSrcEntry
|
||||
|
||||
self.forEachModule(addSrcEntry)
|
||||
|
||||
def addGuestEncoderModule(
|
||||
self, basename, extraHeader="", extraImpl="", useNamespace=True, headerOnly=False,
|
||||
suppressFeatureGuards=False, moduleName=None, suppressVulkanHeaders=False, implOnly=False):
|
||||
@@ -790,9 +733,6 @@ class BumpPool;
|
||||
def beginFile(self, genOpts):
|
||||
OutputGenerator.beginFile(self, genOpts)
|
||||
|
||||
write(self.host_cmake_generator(self.hostCMakeCppFiles),
|
||||
file = self.outFile)
|
||||
|
||||
self.forEachModule(lambda m: m.begin(self.genOpts.directory))
|
||||
self.forEachWrapper(lambda w: w.onBegin(), None)
|
||||
|
||||
|
||||
@@ -957,7 +957,6 @@ def makeGenOpts(args):
|
||||
CerealGenerator,
|
||||
CGeneratorOptions(
|
||||
conventions = conventions,
|
||||
filename = "CMakeLists.txt",
|
||||
directory = directory,
|
||||
apiname = 'vulkan',
|
||||
profile = None,
|
||||
|
||||
Reference in New Issue
Block a user