From 87b052588bdd40803778f5a775a09ad7b505501a Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sun, 10 Apr 2016 19:16:44 +0200 Subject: [PATCH] Link with 'anl' only when building shared lib. --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b5231e6..aaec1d15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1012,11 +1012,13 @@ LIST(APPEND CMAKE_REQUIRED_LIBRARIES anl) CHECK_SYMBOL_EXISTS(getaddrinfo_a netdb.h VMIME_HAVE_GETADDRINFO_A) IF(VMIME_HAVE_GETADDRINFO_A) - TARGET_LINK_LIBRARIES( - ${VMIME_LIBRARY_NAME} - ${TARGET_LINK_LIBRARIES} - anl - ) + IF(VMIME_BUILD_SHARED_LIBRARY) + TARGET_LINK_LIBRARIES( + ${VMIME_LIBRARY_NAME} + ${TARGET_LINK_LIBRARIES} + anl + ) + ENDIF() ENDIF()