From b897209e0d10d1c96767cc0f2709a1eaa7a7046c Mon Sep 17 00:00:00 2001 From: bubnikv Date: Fri, 2 Mar 2018 21:16:00 +0100 Subject: [PATCH] Removed -DCURL_STATIC on OSX, added dynamic linking of OpenSSL on Linux, even if libcurl is linked statically. --- xs/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xs/CMakeLists.txt b/xs/CMakeLists.txt index e4e0e1c6c..a294dc11e 100644 --- a/xs/CMakeLists.txt +++ b/xs/CMakeLists.txt @@ -528,6 +528,15 @@ find_package(CURL REQUIRED) include_directories(${CURL_INCLUDE_DIRS}) target_link_libraries(XS ${CURL_LIBRARIES}) +if (SLIC3R_STATIC AND CMAKE_SYSTEM_NAME STREQUAL "Linux") + # As of now, our build system produces a statically linked libcurl, + # which links the OpenSSL library dynamically. + find_package(OpenSSL REQUIRED) + message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}") + message("OpenSSL libraries: ${OPENSSL_LIBRARIES}") + include_directories(${OPENSSL_INCLUDE_DIR}) + target_link_libraries(XS ${OPENSSL_LIBRARIES}) +endif() ## OPTIONAL packages