Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux only: full system-wide install with uSockets + Hints for CMake users #1702

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ capi: default
./build capi

install:
cp uSockets/uSockets.a "$(DESTDIR)$(prefix)/lib"
cp uSockets/src/libusockets.h "$(DESTDIR)$(prefix)/include"
mkdir -p "$(DESTDIR)$(prefix)/include/uWebSockets"
cp -r src/* "$(DESTDIR)$(prefix)/include/uWebSockets"

Expand Down
18 changes: 18 additions & 0 deletions misc/READMORE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ There are a few compilation flags for µSockets (see its documentation), but com

You can use the Makefile on Linux and macOS. It is simple to use and builds the examples for you. `WITH_OPENSSL=1 make` builds all examples with SSL enabled. Examples will fail to listen if cert and key cannot be found, so make sure to specify a path that works for you.

### Steps for Linux
```sh
git clone --resurse-submodules https://github.com/uNetworking/uWebSockets
make # prepend variables if desired such as `WITH_OPENSSL` as mentioned above
make install
```

_Note for Linux CMake users: make sure to include ZLIB as a dependency as well as `uSockets.a` static library (which was installed during `make install`)._

Here is an example:
```
...
find_library(USOCKETS_LIBRARY uSockets.a PATHS /usr/local/lib REQUIRED)
find_package(ZLIB REQUIRED)
target_link_libraries(${PROJECT_NAME} ${USOCKETS_LIBRARY} ZLIB::ZLIB)
...
```

## User manual

### uWS::App & uWS::SSLApp
Expand Down