diff options
author | John Ericson <git@JohnEricson.me> | 2019-10-26T09·16-0400 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-17T14·56+0100 |
commit | 9c21176f5779d5757cfc38497873bb0e13eb4f0b (patch) | |
tree | 9f8d580cd1bae8cd079dcc9e0e5434abf87f350d | |
parent | 3f6f3356e86c5f48955dcf55cfbb1bf42456533a (diff) |
chore(3p/nix): Make libsodium an auto dependency r/734
This means do autodetection if the user doesn't specify. (cherry picked from commit 1be6ab4d3eb4d6b04c322b9ed0a108c2b5354ec5)
-rw-r--r-- | third_party/nix/meson.build | 5 | ||||
-rw-r--r-- | third_party/nix/meson_options.txt | 4 |
2 files changed, 5 insertions, 4 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 diff --git a/third_party/nix/meson_options.txt b/third_party/nix/meson_options.txt index 9bad1b2c4c65..8d8e5dab53e1 100644 --- a/third_party/nix/meson_options.txt +++ b/third_party/nix/meson_options.txt @@ -153,8 +153,8 @@ option( option( 'with_libsodium', - type : 'boolean', - value : 'true', + type : 'feature', + value : 'auto', description : 'build nix with shared libs') option( |