How to install #1853
Replies: 2 comments
-
|
Hey! I’m not sure if you still need help, but just in case — you can use the vcpkg package manager to install uWebSockets much more easily than doing it manually. Setting it up by hand usually requires multiple tools like Microsoft Build Tools, OpenSSL, zlib, and other essential libraries, plus manual environment configuration. |
Beta Was this translation helpful? Give feedback.
-
|
I use CMake + CPM.cmake, and I managed to do this with the following: if(uWebSockets_ADDED)
set(LIB_USOCKETS ${uWebSockets_SOURCE_DIR}/uSockets/uSockets.a)
add_custom_command(
COMMAND make CFLAGS=-fPIC
OUTPUT "${LIB_USOCKETS}"
WORKING_DIRECTORY "${uWebSockets_SOURCE_DIR}")
add_custom_target(build_uSockets
DEPENDS ${LIB_USOCKETS})
add_library(uSockets STATIC IMPORTED GLOBAL)
set_target_properties(uSockets PROPERTIES
IMPORTED_LOCATION ${LIB_USOCKETS}
INTERFACE_INCLUDE_DIRECTORIES ${uWebSockets_SOURCE_DIR}/uSockets/src
)
add_dependencies(uSockets build_uSockets)
add_library(uWebSockets INTERFACE)
target_include_directories(uWebSockets INTERFACE
${uWebSockets_SOURCE_DIR}/src
)
# uWebSockets requires linking to these dependencies:
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Threads REQUIRED)
target_link_libraries(uWebSockets INTERFACE
OpenSSL::SSL
OpenSSL::Crypto
ZLIB::ZLIB
Threads::Threads
uSockets
)
# Optional: define macros expected by uSockets
target_compile_definitions(uWebSockets INTERFACE
UWS_NO_ZLIB=0
LIBUS_USE_OPENSSL=1
)
endif()Then you can safely add it to your project with: target_link_libraries(target PRIVATE uWebSockets) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone i want to install uwebsockets to make my project on uwebsockets but unable to install please guide me on this i am using window 11 64 bit please help me..
Beta Was this translation helpful? Give feedback.
All reactions