From b2b5308706cc8ea3cd56a2053c9317e079579ff6 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Wed, 24 Aug 2022 14:57:25 -0700 Subject: [PATCH] meson: Add an option to specify the WGL gallium megadriver filename Specifying the name at build time, as opposed to renaming after the build, serves two purposes: 1. The link from Mesa's OpenGL32.dll and (and EGL/GLES) to the megadriver is done by filename. If using these frontends, the megadriver can't be renamed afterwards. And Windows doesn't have very good symlink support, so that's not really an option either. 2. The symbol (PDB) filename is also embedded in the DLL using the build-time expected filename. Renaming can produce odd artifacts while debugging. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7115 Reviewed-by: Bill Kristiansen Part-of: --- meson_options.txt | 6 ++++++ src/gallium/targets/wgl/meson.build | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 99c75b8aec1f8..2a5d9fddf6ba0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -163,6 +163,12 @@ option( value : 'disabled', description : 'build gallium "clover" OpenCL frontend.', ) +option( + 'gallium-windows-dll-name', + type : 'string', + value : 'libgallium_wgl', + description : 'name of gallium megadriver DLL built for Windows. defaults to libgallium_wgl.dll to match DRI', +) option( 'opencl-spirv', type : 'boolean', diff --git a/src/gallium/targets/wgl/meson.build b/src/gallium/targets/wgl/meson.build index 2999ee5492ec4..435bc05ff248f 100644 --- a/src/gallium/targets/wgl/meson.build +++ b/src/gallium/targets/wgl/meson.build @@ -30,8 +30,9 @@ wgl_def = custom_target( '--compiler_id', cc.get_argument_syntax(), '--cpu_family', host_machine.cpu_family()] ) +gallium_wgl_name = get_option('gallium-windows-dll-name') libgallium_wgl = shared_library( - 'gallium_wgl', + gallium_wgl_name, ['wgl.c'], vs_module_defs : wgl_def, include_directories : [ @@ -46,7 +47,7 @@ libgallium_wgl = shared_library( driver_d3d12, driver_zink, winsys_d3d12_wgl ], link_args : gallium_wgl_link_args, - name_prefix : 'lib', + name_prefix : '', install : true, ) libgallium_wgl_build_dir = meson.current_build_dir()