From ff5f2768b6afb1dc21686ce37e6fb9a9195e2376 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Fri, 26 Jul 2024 17:21:01 -0700 Subject: [PATCH] meson: Vendor glslang --- debian/rules | 2 +- meson.build | 29 ++++++++++++++++++----------- subprojects/glslang.wrap | 4 ++++ 3 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 subprojects/glslang.wrap diff --git a/debian/rules b/debian/rules index 25a0f7b9d0..184c3a848c 100755 --- a/debian/rules +++ b/debian/rules @@ -63,7 +63,7 @@ override_dh_auto_configure: override_dh_auto_build: ./build.sh ${XEMU_BUILD_OPTIONS} ${common_configure_opts} || \ - { echo ===== BUILD FAILED ===; tail -n 50 config.log; exit 1; } + { echo ===== BUILD FAILED ===; cat build/meson-logs/meson-log.txt; exit 1; } cp debian/copyright debian/qemu.deb.copyright cp dist/LICENSE.txt debian/copyright diff --git a/meson.build b/meson.build index 7c12d40fb5..058c0092d4 100644 --- a/meson.build +++ b/meson.build @@ -1181,10 +1181,10 @@ if not get_option('opengl').auto() or have_system or have_vhost_user_gpu endif vulkan = not_found +libglslang = not_found + if targetos == 'windows' - vulkan = declare_dependency( - compile_args: ['-DVK_USE_PLATFORM_WIN32_KHR', '-DVK_NO_PROTOTYPES'], - ) + vulkan = declare_dependency(compile_args: ['-DVK_USE_PLATFORM_WIN32_KHR']) libglslang = declare_dependency(link_args: [ '-lglslang', '-lMachineIndependent', @@ -1195,14 +1195,21 @@ if targetos == 'windows' ]) elif targetos == 'linux' vulkan = dependency('vulkan') - libglslang = declare_dependency(link_args: [ - '-lglslang', - '-lMachineIndependent', - '-lGenericCodeGen', - '-lSPIRV', - '-lSPIRV-Tools', - '-lSPIRV-Tools-opt' - ]) +endif + +if vulkan.found() and not libglslang.found() + cmake = import('cmake') + # FIXME: Get spirv-tools to enable opt. + glslang_opts = cmake.subproject_options() + glslang_opts.add_cmake_defines({'ENABLE_OPT': false}) + glslang_subpro = cmake.subproject('glslang', options: glslang_opts) + libglslang = declare_dependency(link_with: [ + glslang_subpro.target('glslang'), + glslang_subpro.target('MachineIndependent'), + glslang_subpro.target('GenericCodeGen'), + glslang_subpro.target('SPIRV'), + ], include_directories: ['subprojects' / 'glslang'] + ) endif subdir('thirdparty') diff --git a/subprojects/glslang.wrap b/subprojects/glslang.wrap new file mode 100644 index 0000000000..7e6fe8414e --- /dev/null +++ b/subprojects/glslang.wrap @@ -0,0 +1,4 @@ +[wrap-git] +url=https://github.com/KhronosGroup/glslang +revision=vulkan-sdk-1.3.283.0 +depth=1