about summary refs log tree commit diff
path: root/third_party/nix/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/meson.build')
-rw-r--r--third_party/nix/meson.build5
1 files changed, 3 insertions, 2 deletions
diff --git a/third_party/nix/meson.build b/third_party/nix/meson.build
index 50d4dfc0c93e..9e20c499f3ca 100644
--- a/third_party/nix/meson.build
+++ b/third_party/nix/meson.build
@@ -474,9 +474,10 @@ endif
 
 # 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(
-        dependencies : cpp.find_library('sodium'),
+        dependencies : libsodium_lib,
         link_args :  get_option('sodium_link_args'))
     config_h.set('HAVE_SODIUM', 1, description : 'Whether to use libsodium for cryptography.')
 else