From 004a76148ae573d4c0d8f7c5b2a7f6699797d826 Mon Sep 17 00:00:00 2001 From: Marco Thaller <143189670+marcothaller@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:50:45 +0100 Subject: [PATCH] Always build libcurl as shared library Ignore BUILD_SHARED_LIBS and build libcurl as shared library. We cache current value of BUILD_SHARED_LIBS, set BUILD_SHARED_LIBS ON when including curl and reset BUILD_SHARED_LIBS to it's previous value afterwards. --- cmake/dependencies.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index db5df87..58daff0 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -23,7 +23,11 @@ include(FetchContent) include(cmake/dependencies/kdutils.cmake) if (BUILD_INTEGRATION_CURL) + # Ignore BUILD_SHARED_LIBS and build libcurl as shared library + set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS}) + set(BUILD_SHARED_LIBS ON) include(cmake/dependencies/curl.cmake) + set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD}) endif() if (BUILD_INTEGRATION_MQTT)