From 3d084a600bfa7730f4dbf0dd01c6fba24bee422f Mon Sep 17 00:00:00 2001 From: Alexey Rochev Date: Mon, 30 Dec 2024 21:43:17 +0300 Subject: [PATCH 1/2] Simplify plattorm-conditional features in vcpkg.json --- vcpkg.json | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index 7a0cd596..aa882f1e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -18,15 +18,11 @@ "png", "testlib", "thread", - "widgets" - ] - }, - { - "name": "qtbase", - "platform": "!windows", - "default-features": false, - "features": [ - "openssl" + "widgets", + { + "name": "openssl", + "platform": "!windows" + } ] }, { From dbb594eadc4756d85dc4cda96697ad808855480c Mon Sep 17 00:00:00 2001 From: Alexey Rochev Date: Mon, 30 Dec 2024 21:45:11 +0300 Subject: [PATCH 2/2] Fix specifying openssl support in cpp-httplib --- cmake/FindCppHttplib.cmake | 8 +++----- src/CMakeLists.txt | 3 --- vcpkg.json | 15 ++++++++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cmake/FindCppHttplib.cmake b/cmake/FindCppHttplib.cmake index a522c9fb..05464835 100644 --- a/cmake/FindCppHttplib.cmake +++ b/cmake/FindCppHttplib.cmake @@ -25,15 +25,13 @@ macro(find_system_httplib) endmacro() macro(include_bundled_httplib) - set(HTTPLIB_REQUIRE_OPENSSL "${OPENSSL_FOUND}") + if (NOT WIN32) + set(HTTPLIB_REQUIRE_OPENSSL ON) + endif() add_subdirectory(3rdparty/cpp-httplib EXCLUDE_FROM_ALL) endmacro() macro(find_cpp_httplib) - find_package(OpenSSL 3.0.0) - if (NOT OPENSSL_FOUND) - message(WARNING "Using cpp-httplib without OpenSSL support") - endif() if (TREMOTESF_WITH_HTTPLIB STREQUAL "auto") find_system_httplib() if (NOT httplib_FOUND) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ceba939c..bf0cd36d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -446,9 +446,6 @@ if (BUILD_TESTING) find_cpp_httplib() add_executable(requestrouter_test rpc/requestrouter_test.cpp) target_compile_definitions(requestrouter_test PRIVATE TEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/rpc/test-data") - if (OPENSSL_FOUND) - target_compile_definitions(requestrouter_test PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT) - endif() add_test(NAME requestrouter_test COMMAND requestrouter_test) target_link_libraries(requestrouter_test PRIVATE tremotesf_objects Qt::Test) if (TARGET PkgConfig::httplib) diff --git a/vcpkg.json b/vcpkg.json index aa882f1e..61285a42 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -39,13 +39,18 @@ }, "qtsvg", "fmt", - { - "name": "openssl", - "platform": "!windows" - }, "kf6widgetsaddons", "cxxopts", - "cpp-httplib", + { + "name": "cpp-httplib", + "default-features": false, + "features": [ + { + "name": "openssl", + "platform": "!windows" + } + ] + }, { "name": "pkgconf", "platform": "windows",