Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/CI-Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,17 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y cmake
CXX_STANDARD=${{ matrix.std }} ./scripts/run_tests.sh
Tests-Linux-vcpkg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install cmake and vcpkg
run: |
sudo apt-get update && sudo apt-get install -y cmake
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Build and Run Tests with vcpkg
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
run: |
CXX_STANDARD=17 ./scripts/run_tests.sh
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ siphash.init(key, 2, 4);
std::cout << "SipHash-2-4 for 'hello': " << siphash.update(data).digest() << std::endl;
```

## vcpkg

This library can be installed with [vcpkg](https://github.com/microsoft/vcpkg):

```sh
vcpkg install siphash-cpp
```

After installation, a CMake project may use:

```cmake
find_package(siphash_cpp CONFIG REQUIRED)
target_link_libraries(your_app PRIVATE siphash_cpp::siphash_cpp)
```

To verify the build with vcpkg, run:

```sh
VCPKG_ROOT=/path/to/vcpkg ./scripts/run_tests.sh
```




Expand Down
6 changes: 5 additions & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BUILD_DIR="$ROOT_DIR/build"

rm -rf "$BUILD_DIR"
cmake -S "$ROOT_DIR" -B "$BUILD_DIR" -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=${CXX_STANDARD:-17}
cmake_args=(-S "$ROOT_DIR" -B "$BUILD_DIR" -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=${CXX_STANDARD:-17})
if [[ -n "${VCPKG_ROOT:-}" ]]; then
cmake_args+=(-DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
fi
cmake "${cmake_args[@]}"
cmake --build "$BUILD_DIR" --config Release
cd "$BUILD_DIR"
ctest --output-on-failure
10 changes: 10 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "siphash-cpp",
"version": "1.0.0",
"description": "SipHash header-only C++ library",
"license": "CC0-1.0",
"dependencies": [
{ "name": "vcpkg-cmake", "host": true },
{ "name": "vcpkg-cmake-config", "host": true }
]
}
Loading