drogonframework / drogonframework/drogon

Unable to build with WSL2

Open
#1,788 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 12h
Merged PRs (30d)
15

Description

I'm trying to build my project under WSL2 but always I get error on CMAKE_INSTALL_PREFIX variable being defined multiple times.
I can correctly build and run project under Windows with vcpkg installed libs, but I can't do the same for WSL2.

I added these lines in CMakeLists.txt file:
```
if(WIN32)
message(STATUS "Configuring for Windows")
set(CMAKE_TOOLCHAIN_FILE "[...]/vcpkg/scripts/buildsystems/vcpkg.cmake")
set(VCPKG_TARGET_TRIPLET "x64-windows")
elseif(UNIX AND NOT APPLE)
message(STATUS "Configuring for Linux")
set(CMAKE_TOOLCHAIN_FILE "[...]/vcpkg/scripts/buildsystems/vcpkg.cmake")
set(VCPKG_TARGET_TRIPLET "x64-linux")
endif()
```
It correctly finds all the libs as I see `Found Brotli: [...]/vcpkg/installed/x64-linux/debug/lib/libbrotlidec-static.a` and it takes ~ 139 seconds to build all, instead of 10 secs in windows env.
As soon as I start build it I get CMAKE_INSTALL_PREFIX error plus other 900 error too.
![image](https://github.com/drogonframework/drogon/assets/1809665/7798f87e-1c41-4994-929e-f9b9fdc340c2)

My goal is to use build this project for windows and arm64 linux, but I'm only able to build for windows...

What I'm missing?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.