From 4ce78bdb4daa02bb3d547717e549016ecfcd7a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Thu, 5 Dec 2019 18:28:59 -0500 Subject: [PATCH] c wrapper: link statically when required --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de93c04f..b8fc2b35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,12 @@ if (OPENDHT_C) c/opendht_c.h ) target_compile_definitions(opendht-c PRIVATE OPENDHT_C_BUILD) - target_link_libraries(opendht-c opendht) + if (OPENDHT_SHARED) + target_link_libraries(opendht-c opendht) + else () + target_link_libraries(opendht-c opendht-static) + endif () + # PkgConfig module configure_file ( opendht-c.pc.in