meson.build 1013 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
# Since version 0.49.0 Meson has native libgcrypt dependency support, which has
# the advantage over find_library() as it uses libgcrypt-config to query the
# required linker flags.
# However, we still need to use find_library() first, to prevent Meson
# falsly assuming a target libgcrypt is available in case there is no
# libgcrypt-config entry in the cross file and libgcrypt is installed on the
# host. In this case, Meson will falsly use the native libgcrypt-config and
# will falsly assume it has found the gcrypt library for the target.
#
# See: https://github.com/MusicPlayerDaemon/MPD/pull/495
11
gcrypt_dep = c_compiler.find_library('gcrypt', required: get_option('qobuz'))
12 13 14
if gcrypt_dep.found()
  gcrypt_dep = dependency('libgcrypt')
endif
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
if not gcrypt_dep.found()
  subdir_done()
endif

gcrypt = static_library(
  'gcrypt',
  'MD5.cxx',
  include_directories: inc,
  dependencies: [
    gcrypt_dep,
  ],
)

gcrypt_dep = declare_dependency(
  link_with: gcrypt,
  dependencies: [
    gcrypt_dep,
  ],
)