From e067509439009c6bcf1fcbfa3d6356f4f4a89ea1 Mon Sep 17 00:00:00 2001 From: Jonas Vautherin Date: Thu, 28 Nov 2024 13:54:06 +0100 Subject: [PATCH] Enable ssl in curl --- src/mavsdk/CMakeLists.txt | 2 ++ src/mavsdk_server/src/CMakeLists.txt | 1 - src/mavsdk_server/test/CMakeLists.txt | 4 ---- third_party/CMakeLists.txt | 8 +++++++- third_party/curl/CMakeLists.txt | 10 +++------- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/mavsdk/CMakeLists.txt b/src/mavsdk/CMakeLists.txt index 9b8d9a881f..e6f77a586c 100644 --- a/src/mavsdk/CMakeLists.txt +++ b/src/mavsdk/CMakeLists.txt @@ -12,6 +12,8 @@ hunter_add_package(tinyxml2) find_package(tinyxml2 REQUIRED) target_link_libraries(mavsdk + PUBLIC + ${CMAKE_DL_LIBS} PRIVATE JsonCpp::JsonCpp tinyxml2::tinyxml2 diff --git a/src/mavsdk_server/src/CMakeLists.txt b/src/mavsdk_server/src/CMakeLists.txt index 30fd9db340..026dbae4ee 100644 --- a/src/mavsdk_server/src/CMakeLists.txt +++ b/src/mavsdk_server/src/CMakeLists.txt @@ -35,7 +35,6 @@ target_link_libraries(mavsdk_server PRIVATE mavsdk gRPC::grpc++ - ${CMAKE_DL_LIBS} ) if(BUILD_WITH_PROTO_REFLECTION) diff --git a/src/mavsdk_server/test/CMakeLists.txt b/src/mavsdk_server/test/CMakeLists.txt index eff0e065af..c09afaccec 100644 --- a/src/mavsdk_server/test/CMakeLists.txt +++ b/src/mavsdk_server/test/CMakeLists.txt @@ -47,8 +47,4 @@ if (BUILD_STATIC_MAVSDK_SERVER) set_target_properties(unit_tests_mavsdk_server PROPERTIES LINK_SEARCH_END_STATIC ON) endif() -if(NOT BUILD_STATIC_MAVSDK_SERVER AND ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")) - target_link_libraries(unit_tests_mavsdk_server PRIVATE ${CMAKE_DL_LIBS}) -endif() - add_test(unit_tests unit_tests_mavsdk_server) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index e19d739275..45d8c7bde9 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -14,14 +14,20 @@ if (SUPERBUILD) build_target(liblzma) if(NOT BUILD_WITHOUT_CURL) + build_target(openssl) + if(NOT IOS) build_target(zlib-ng) endif() + build_target(curl) endif() if(BUILD_MAVSDK_SERVER) - build_target(openssl) + if (BUILD_WITHOUT_CURL) + build_target(openssl) + endif() + build_target(cares) build_target(absl) build_target(protobuf) diff --git a/third_party/curl/CMakeLists.txt b/third_party/curl/CMakeLists.txt index 06365c2110..b5c83a1494 100644 --- a/third_party/curl/CMakeLists.txt +++ b/third_party/curl/CMakeLists.txt @@ -9,8 +9,9 @@ list(APPEND CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}" "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" - "-DCURL_USE_OPENSSL=OFF" + "-DCURL_USE_OPENSSL=ON" "-DCURL_USE_LIBSSH2=OFF" + "-DBUILD_CURL_EXE=OFF" "-DBUILD_SHARED_LIBS=OFF" "-DCURL_CA_PATH_SET=OFF" "-DCURL_ZLIB=OFF" @@ -19,13 +20,8 @@ list(APPEND CMAKE_ARGS "-DBUILD_TESTING=OFF" ) -if(ANDROID) +if(IOS) list(APPEND CMAKE_ARGS - "-DBUILD_CURL_EXE=OFF" - ) -elseif(IOS) - list(APPEND CMAKE_ARGS - "-DBUILD_CURL_EXE=OFF" "-DPLATFORM=${PLATFORM}" "-DDEPLOYMENT_TARGET=${DEPLOYMENT_TARGET}" "-DENABLE_STRICT_TRY_COMPILE=${ENABLE_STRICT_TRY_COMPILE}"