drogonframework / drogonframework/drogon
Vcpkg feature "redis" does not include "hiredis" as a required dependence
- Dominant language
- C++
- Stars
- 14.3k
- Forks
- 1.4k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
**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](https://github.com/microsoft/vcpkg/blob/master/ports/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:
```json
"dependencies": [
{
"name": "drogon",
"default-features": false,
"features": [
"redis"
]
}
]
```
3. In your `CMakeLists.txt`, add these lines before `project()` :
```cmake
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 ()
```
4. In your `CMakeLists.txt`, add these lines after `add_executable()` or `add_library()` :
```cmake
find_package(Drogon CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon)
```
5. Run CMake command in your build directory, then you can see vcpkg is automaticly downloads and installs packages.
6. 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
Contributor guide
Assessment
This issue has not been assessed yet.