From: Brian P. Hinz Date: Tue, 4 Nov 2014 05:03:24 +0000 (-0500) Subject: Static build fix - only attempt to link against libtasn1 if it's present X-Git-Tag: v1.3.90~15^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=44759765fc36417d5fdd58b161f8d54f23d3f65e;p=tigervnc.git Static build fix - only attempt to link against libtasn1 if it's present GnuTLS may be compiled without external libtasn1, so we shouldn't try to link against it unless it's actually present. --- diff --git a/cmake/StaticBuild.cmake b/cmake/StaticBuild.cmake index df12db41..49706bd3 100644 --- a/cmake/StaticBuild.cmake +++ b/cmake/StaticBuild.cmake @@ -30,9 +30,14 @@ if(BUILD_STATIC) HINTS ${PC_GNUTLS_LIBDIR} ${PC_GNUTLS_LIBRARY_DIRS}) FIND_LIBRARY(NETTLE_LIBRARY NAMES nettle libnettle HINTS ${PC_GNUTLS_LIBDIR} ${PC_GNUTLS_LIBRARY_DIRS}) + FIND_LIBRARY(TASN1_LIBRARY NAMES tasn1 libtasn1 + HINTS ${PC_GNUTLS_LIBDIR} ${PC_GNUTLS_LIBRARY_DIRS}) - set(GNUTLS_LIBRARIES "-Wl,-Bstatic -lgnutls -ltasn1") + set(GNUTLS_LIBRARIES "-Wl,-Bstatic -lgnutls") + if(TASN1_LIBRARY) + set(GNUTLS_LIBRARIES "${GNUTLS_LIBRARIES} -ltasn1") + endif() if(NETTLE_LIBRARY) set(GNUTLS_LIBRARIES "${GNUTLS_LIBRARIES} -lnettle -lhogweed -lgmp") endif()