From bf1855c7f85f831673ba8d9f7218ce4513905e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 10 May 2024 13:59:01 +0200 Subject: [PATCH] meson: allow using xxhash as subproject --- src/meson.build | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/meson.build b/src/meson.build index 6162f8f7..71a6168d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -190,11 +190,16 @@ if libdovi.found() build_deps += libdovi endif -xxhash_inc = include_directories() +inc_dirs = [ vulkan_headers_inc ] + xxhash = dependency('libxxhash', required: get_option('xxhash')) components.set('xxhash', xxhash.found()) if xxhash.found() - xxhash_inc = xxhash.get_variable('includedir') + if xxhash.type_name() == 'internal' + build_deps += xxhash + else + inc_dirs += xxhash.get_variable('includedir') + endif endif # Generate configuration files @@ -233,9 +238,8 @@ if host_machine.system() == 'windows' include_directories: meson.project_source_root()/'win32') endif -fast_float_inc = include_directories() if fs.is_dir('../3rdparty/fast_float/include') - fast_float_inc = include_directories('../3rdparty/fast_float/include') + inc_dirs += include_directories('../3rdparty/fast_float/include') endif ### Main library build process @@ -245,7 +249,7 @@ lib = library('placebo', sources, install: true, dependencies: build_deps + glad_dep, soversion: apiver, - include_directories: [ inc, vulkan_headers_inc, fast_float_inc, xxhash_inc ], + include_directories: [ inc, inc_dirs ], link_args: link_args, link_depends: link_depends, gnu_symbol_visibility: 'hidden',