CMakeLists.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. set(BUILD_CURL_EXE OFF)
  2. set(BUILD_EXAMPLES OFF)
  3. set(BUILD_LIBCURL_DOCS OFF)
  4. set(BUILD_MISC_DOCS OFF)
  5. set(BUILD_SHARED_LIBS OFF)
  6. set(BUILD_STATIC_LIBS ON)
  7. set(BUILD_TESTING OFF)
  8. set(CURL_ENABLE_EXPORT_TARGET OFF)
  9. set(HTTP_ONLY ON)
  10. set(CURL_USE_LIBPSL OFF)
  11. set(CURL_USE_LIBSSH2 OFF)
  12. set(CURL_ZLIB OFF CACHE BOOL "" FORCE)
  13. set(CURL_ZSTD OFF)
  14. set(USE_LIBIDN2 OFF)
  15. set(USE_NGHTTP2 OFF)
  16. if(UNIX)
  17. # We use mbedtls on Unix(-like) systems and Android.
  18. set(CURL_USE_OPENSSL OFF)
  19. # This is set if the dolphin_find_optional_system_library call from the main CMakeLists.txt
  20. # is able to find mbedtls on the system.
  21. if(MBEDTLS_FOUND)
  22. # We can just enable CURL_USE_MBEDTLS.
  23. set(CURL_USE_MBEDTLS ON)
  24. else()
  25. # HACK: Set some internal variables to pretend like mbedtls was found on the system.
  26. # We can't use CURL_USE_MBEDTLS with our copy from Externals, as that flag expects
  27. # mbedtls to be installed (the CMakeLists attempts to search for it with find_package).
  28. set(_ssl_enabled ON)
  29. set(USE_MBEDTLS ON)
  30. set(_curl_ca_bundle_supported TRUE)
  31. endif()
  32. endif()
  33. if(WIN32)
  34. set(CURL_USE_SCHANNEL ON)
  35. endif()
  36. if(ANDROID)
  37. set(CURL_CA_PATH "/system/etc/security/cacerts" CACHE STRING "")
  38. endif()
  39. add_subdirectory(curl)
  40. if(UNIX AND NOT MBEDTLS_FOUND)
  41. # HACK: Manually link with the mbedtls libraries.
  42. target_link_libraries(libcurl_static PRIVATE
  43. MbedTLS::mbedtls
  44. MbedTLS::mbedx509)
  45. endif()