@@ -168,8 +168,6 @@ if is_unixy
168168endif
169169
170170link_args = cc.get_supported_link_arguments([' -Wl,-Bsymbolic-functions' , ' -Wl,-z,relro' , ' -Wl,--exclude-libs,ALL' , ' -lGL' , ' -static-libstdc++' ])
171- # meson fails to check version-script so just force add
172- link_args += ' -Wl,--version-script,@0@' .format(join_paths (meson .current_source_dir(), ' mangohud.version' ))
173171
174172mangohud_static_lib = static_library (
175173 ' MangoHud' ,
@@ -211,11 +209,25 @@ mangohud_shared_lib = shared_library(
211209 ' MangoHud' ,
212210 objects : mangohud_static_lib.extract_all_objects(),
213211 link_with : mangohud_static_lib,
214- link_args : link_args,
212+ link_args : [ link_args, ' -Wl,--version-script,@0@ ' .format( join_paths ( meson .current_source_dir(), ' mangohud.version ' ))] ,
215213 install_dir : libdir_mangohud,
216214 install : true
217215)
218216
217+ mangohud_opengl_syms = configuration_data ()
218+ if get_option (' with_x11' ).enabled()
219+ mangohud_opengl_syms.set(' x11_symbols' , ' glX*; mangohud_find_glx_ptr;' )
220+ endif
221+ if get_option (' with_wayland' ).enabled()
222+ mangohud_opengl_syms.set(' wayland_symbols' , ' egl*; mangohud_find_egl_ptr;' )
223+ endif
224+
225+ mangohud_opengl_version_file = configure_file (
226+ input : ' mangohud_opengl.version.in' ,
227+ output : ' mangohud_opengl.version' ,
228+ configuration : mangohud_opengl_syms,
229+ )
230+
219231mangohud_opengl_shared_lib = shared_library (
220232 ' MangoHud_opengl' ,
221233 mangohud_version,
@@ -244,8 +256,9 @@ mangohud_opengl_shared_lib = shared_library(
244256 json_dep,
245257 implot_dep],
246258 include_directories : [inc_common],
247- link_args : link_args,
259+ link_args : [ link_args, ' -Wl,--version-script,@0@ ' .format( join_paths ( meson .current_build_dir(), ' mangohud_opengl.version ' ))] ,
248260 link_with : mangohud_static_lib,
261+ link_depends : mangohud_opengl_version_file,
249262 install_dir : libdir_mangohud,
250263 install : true
251264)
0 commit comments