drogon icon indicating copy to clipboard operation
drogon copied to clipboard

Vcpkg feature "redis" does not include "hiredis" as a required dependence

Open ParticleG opened this issue 3 years ago • 0 comments

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:

  1. Create a CMake project with a vcpkg.json in root
  2. Add drogon with redis feature in vcpkg.json, example:
"dependencies": [
    {
        "name": "drogon",
        "default-features": false,
        "features": [
            "redis"
        ]
    }
]
  1. In your CMakeLists.txt, add these lines before project() :
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 ()
  1. In your CMakeLists.txt, add these lines after add_executable() or add_library() :
find_package(Drogon CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon)
  1. Run CMake command in your build directory, then you can see vcpkg is automaticly downloads and installs packages.

  2. 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 SRMQJ)_}XAEOFJ@XBTUUMEA

Desktop (please complete the following information):

  • OS: Windows 11 Pro
  • Compiler: Visual Studio 2019

ParticleG avatar Oct 14 '21 02:10 ParticleG