From a9c49a05416fde272df105fdf1038fd87ca71aed Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 29 Sep 2021 19:59:30 +0300 Subject: [PATCH] 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 Reviewed-by: Jesse Natalie Reviewed-by: Dylan Baker Part-of: --- meson.build | 9 ++++++++- src/gallium/targets/opencl/meson.build | 8 -------- src/microsoft/clc/meson.build | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 0bf02182864d5..a1728c4ac8e00 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build index b77826b6e1e96..ec65fcbe18efd 100644 --- a/src/gallium/targets/opencl/meson.build +++ b/src/gallium/targets/opencl/meson.build @@ -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( diff --git a/src/microsoft/clc/meson.build b/src/microsoft/clc/meson.build index 05b48b6a813dc..fb53f5445bdc3 100644 --- a/src/microsoft/clc/meson.build +++ b/src/microsoft/clc/meson.build @@ -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] )