meson: extract libversion checks from clc & clover

The src/microsoft/clc/meson.build was assuming to be run only on
Windows. That's about to change.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9156>
This commit is contained in:
Lionel Landwerlin 2021-09-29 19:59:30 +03:00 committed by Marge Bot
parent 2bc4650b45
commit a9c49a0541
3 changed files with 9 additions and 10 deletions

View file

@ -1757,6 +1757,13 @@ else
dep_llvmspirvlib = null_dep dep_llvmspirvlib = null_dep
endif endif
# Be explicit about only using this lib on Windows, to avoid picking
# up random libs with the generic name 'libversion'
dep_version = null_dep
if with_opencl_spirv and host_machine.system() == 'windows'
dep_version = cpp.find_library('version')
endif
with_opencl_native = _opencl != 'disabled' and get_option('opencl-native') with_opencl_native = _opencl != 'disabled' and get_option('opencl-native')
if (with_amd_vk or with_gallium_radeonsi or if (with_amd_vk or with_gallium_radeonsi or

View file

@ -85,14 +85,6 @@ if not (dep_clang.found() and dep_clang_usable)
endif endif
endif endif
# Be explicit about only using this lib on Windows, to avoid picking
# up random libs with the generic name 'libversion'
if host_machine.system() == 'windows'
dep_version = cpp.find_library('version')
else
dep_version = null_dep
endif
ocldef = files(opencl_libname + '.def')[0] ocldef = files(opencl_libname + '.def')[0]
libopencl = shared_library( libopencl = shared_library(

View file

@ -55,7 +55,7 @@ libclc_compiler = shared_library(
opencl_c_base_h, opencl_c_base_h,
vs_module_defs : 'clon12compiler.def', vs_module_defs : 'clon12compiler.def',
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_compiler, inc_gallium, inc_spirv], include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_compiler, inc_gallium, inc_spirv],
dependencies: [idep_nir_headers, dep_clang, dep_llvm, cc.find_library('version'), dependencies: [idep_nir_headers, dep_clang, dep_llvm, dep_version,
dep_llvmspirvlib, idep_mesautil, idep_libdxil_compiler, idep_nir, dep_spirv_tools] dep_llvmspirvlib, idep_mesautil, idep_libdxil_compiler, idep_nir, dep_spirv_tools]
) )