docs: add Linux (WSL/Ubuntu) quick start and build/test instructions
This commit is contained in:
54
README.md
54
README.md
@@ -70,6 +70,60 @@ cmake -S example -B example/build -DCMAKE_BUILD_TYPE=Release
|
|||||||
cmake --build example/build --config Release
|
cmake --build example/build --config Release
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Linux (WSL/Ubuntu) – Quick start
|
||||||
|
|
||||||
|
Prerequisites (Ubuntu/Debian):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get update -y && sudo apt-get install -y \
|
||||||
|
build-essential cmake git pkg-config libcurl4-openssl-dev \
|
||||||
|
curl zip unzip tar ninja-build ca-certificates
|
||||||
|
```
|
||||||
|
|
||||||
|
Bootstrap vcpkg (once):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/microsoft/vcpkg.git "$HOME/vcpkg"
|
||||||
|
"$HOME/vcpkg/bootstrap-vcpkg.sh" -disableMetrics
|
||||||
|
```
|
||||||
|
|
||||||
|
Build (library, tests, example):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export VCPKG_ROOT="$HOME/vcpkg"
|
||||||
|
cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
|
||||||
|
cmake --build build --config Release
|
||||||
|
```
|
||||||
|
|
||||||
|
Or simply use the helper script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash ./build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./build/example/example
|
||||||
|
```
|
||||||
|
|
||||||
|
Run tests:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ctest --test-dir build --output-on-failure
|
||||||
|
```
|
||||||
|
|
||||||
|
Artifacts:
|
||||||
|
|
||||||
|
- Library: `build/libprivatebinapi.so`
|
||||||
|
- Example binary: `build/example/example`
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
- vcpkg dependencies (`cryptopp`, `nlohmann-json`) are installed automatically during CMake configure when the toolchain file is provided.
|
||||||
|
- On Linux the example links directly against the in-tree target `privatebinapi`. On Windows it additionally copies the DLL next to the example executable after build.
|
||||||
|
- PrivateBin delete operation is performed via HTTP POST (per API), not HTTP DELETE.
|
||||||
|
|
||||||
### Windows (PowerShell) – Build via build_thinkpad.bat
|
### Windows (PowerShell) – Build via build_thinkpad.bat
|
||||||
|
|
||||||
For systems with Visual Studio 2022 Build Tools (C++ workload) and vcpkg in the user profile, there is a robust build script:
|
For systems with Visual Studio 2022 Build Tools (C++ workload) and vcpkg in the user profile, there is a robust build script:
|
||||||
|
|||||||
Reference in New Issue
Block a user