meson: Add wrap for libelf on Windows

Uses release from Lag Free Games GitHub, which applies Windows build
fixes to FreeBSD libelf.

The amd_common library uses libelf.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10202>
This commit is contained in:
James Park 2021-04-13 00:43:13 -07:00 committed by Marge Bot
parent c93bd731f8
commit e9254699a7
2 changed files with 11 additions and 1 deletions

View File

@ -1686,7 +1686,11 @@ with_opencl_native = _opencl != 'disabled' and get_option('opencl-native')
if (with_amd_vk or with_gallium_radeonsi or
(with_gallium_opencl and with_opencl_native) or
(with_gallium_r600 and with_llvm))
dep_elf = dependency('libelf', required : false)
if with_platform_windows
dep_elf = dependency('libelf', required : false, fallback : ['libelf', 'libelf_dep'])
else
dep_elf = dependency('libelf', required : false)
endif
if not dep_elf.found()
dep_elf = cc.find_library('elf')
endif

6
subprojects/libelf.wrap Normal file
View File

@ -0,0 +1,6 @@
[wrap-git]
directory = libelf-lfg-win32-1.0.0-freebsd-12.1.0
url = https://github.com/LagFreeGames/libelf-lfg-win32.git
revision = 1.0.0
depth = 1