Skip to content

Commit

Permalink
pkg-config: add argon2 dependency when not using included version
Browse files Browse the repository at this point in the history
  • Loading branch information
aberaud committed Jun 18, 2017
1 parent c11dcf5 commit 2ed99db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Expand Up @@ -33,7 +33,10 @@ endif ()
if (NOT OPENDHT_ARGON2)
find_package(PkgConfig)
pkg_search_module(argon2 libargon2)
if (NOT argon2_FOUND)
if (argon2_FOUND)
message("Argon2 found " ${argon2_req})
set(argon2_lib ", libargon2")
else ()
message("Argon2 not found, using included version.")
set(OPENDHT_ARGON2 ON)
endif()
Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Expand Up @@ -104,7 +104,10 @@ AC_ARG_WITH([argon2], AS_HELP_STRING([--without-argon2], [Use included Argon2]))
AS_IF([test "x$with_argon2" != "xno"],
[PKG_CHECK_MODULES([Argon2], [libargon2], [have_argon2=yes], [have_argon2=no])],
[have_argon2=no])
AS_IF([test "x$have_argon2" = "xyes"], [], [
AS_IF([test "x$have_argon2" = "xyes"], [
AC_MSG_NOTICE([Using system Argon2])
AC_SUBST(argon2_lib, [", libargon2"])
], [
AS_IF([test "x$with_argon2" = "xyes"], [
AC_MSG_ERROR([Argon2 requested but not found])
],[
Expand Down
2 changes: 1 addition & 1 deletion opendht.pc.in
Expand Up @@ -7,5 +7,5 @@ Description: C++ Distributed Hash Table library
Version: @VERSION@
Libs: -L${libdir} -lopendht
Libs.private: -lpthread
Requires.private: gnutls >= 3.1
Requires.private: gnutls >= 3.1@argon2_lib@
Cflags: -I${includedir}

0 comments on commit 2ed99db

Please sign in to comment.