drogon
drogon copied to clipboard
Vcpkg feature "redis" does not include "hiredis" as a required dependence
Describe the bug
Drogon's feature redis
does not include hiredis
as an required dependence, which would cause redis module fails to compile.
See drogon/vcpkg.json#L60 for details
To Reproduce Steps to reproduce the behavior:
- Create a CMake project with a
vcpkg.json
in root - Add drogon with redis feature in
vcpkg.json
, example:
"dependencies": [
{
"name": "drogon",
"default-features": false,
"features": [
"redis"
]
}
]
- In your
CMakeLists.txt
, add these lines beforeproject()
:
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
if (WIN32)
message(STATUS "Platform is Win32")
set(VCPKG_TARGET_TRIPLET "x64-windows" CACHE STRING "Vcpkg target triplet" FORCE)
elseif (UNIX)
message(STATUS "Platform is Unix")
set(VCPKG_TARGET_TRIPLET "x64-linux" CACHE STRING "Vcpkg target triplet" FORCE)
endif ()
- In your
CMakeLists.txt
, add these lines afteradd_executable()
oradd_library()
:
find_package(Drogon CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon)
-
Run CMake command in your build directory, then you can see vcpkg is automaticly downloads and installs packages.
-
Build the project, then you can see drogon framework raises an error which says something like:
"redis module require hiredis installed to work properly"
Expected behavior Hiredis should be installed by vcpkg as a dependency for redis feature.
Screenshots
Desktop (please complete the following information):
- OS: Windows 11 Pro
- Compiler: Visual Studio 2019