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

@ -616,7 +616,7 @@ dep_dxheaders = null_dep
if with_gallium_d3d12 or with_microsoft_clc
dep_dxheaders = dependency('DirectX-Headers', fallback : ['DirectX-Headers', 'dep_dxheaders'],
required : with_gallium_d3d12
)
)
endif
if with_vulkan_overlay_layer or with_aco_tests
@ -1757,6 +1757,13 @@ else
dep_llvmspirvlib = null_dep
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')
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
# 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]
libopencl = shared_library(

View File

@ -55,7 +55,7 @@ libclc_compiler = shared_library(
opencl_c_base_h,
vs_module_defs : 'clon12compiler.def',
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]
)