diff --git a/src/mavsdk/CMakeLists.txt b/src/mavsdk/CMakeLists.txt index 2336bfa8a0..1fb570c053 100644 --- a/src/mavsdk/CMakeLists.txt +++ b/src/mavsdk/CMakeLists.txt @@ -14,6 +14,8 @@ find_package(tinyxml2 REQUIRED) find_package(libevents 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 bc3ec94540..0a54dd7e33 100644 --- a/src/mavsdk_server/src/CMakeLists.txt +++ b/src/mavsdk_server/src/CMakeLists.txt @@ -37,7 +37,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 153f1bf491..7247df0908 100644 --- a/src/mavsdk_server/test/CMakeLists.txt +++ b/src/mavsdk_server/test/CMakeLists.txt @@ -48,8 +48,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 0e4f5414ce..1b4c925fd1 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}"