Skip to content

Commit

Permalink
Fix specifying openssl support in cpp-httplib
Browse files Browse the repository at this point in the history
  • Loading branch information
equeim committed Dec 30, 2024
1 parent eea3c9e commit 7450794
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 3 additions & 5 deletions cmake/FindCppHttplib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 10 additions & 5 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7450794

Please sign in to comment.