chore(3p/nix): Make libsodium an auto dependency

This means do autodetection if the user doesn't specify.

(cherry picked from commit 1be6ab4d3eb4d6b04c322b9ed0a108c2b5354ec5)
This commit is contained in:
John Ericson 2019-10-26 05:16:39 -04:00 committed by Vincent Ambo
parent 3f6f3356e8
commit 9c21176f57
2 changed files with 5 additions and 4 deletions

View file

@ -474,9 +474,10 @@ endif
# Look for libsodium, an optional dependency. # Look for libsodium, an optional dependency.
#-------------------------------------------------- #--------------------------------------------------
if (get_option('with_libsodium')) libsodium_lib = cpp.find_library('sodium', required: get_option('with_libsodium'))
if (libsodium_lib.found())
libsodium_dep = declare_dependency( libsodium_dep = declare_dependency(
dependencies : cpp.find_library('sodium'), dependencies : libsodium_lib,
link_args : get_option('sodium_link_args')) link_args : get_option('sodium_link_args'))
config_h.set('HAVE_SODIUM', 1, description : 'Whether to use libsodium for cryptography.') config_h.set('HAVE_SODIUM', 1, description : 'Whether to use libsodium for cryptography.')
else else

View file

@ -153,8 +153,8 @@ option(
option( option(
'with_libsodium', 'with_libsodium',
type : 'boolean', type : 'feature',
value : 'true', value : 'auto',
description : 'build nix with shared libs') description : 'build nix with shared libs')
option( option(