Skip to content

Commit 1dd73ca

Browse files
committed
saving.
1 parent 230cfa3 commit 1dd73ca

File tree

2 files changed

+45
-6
lines changed

2 files changed

+45
-6
lines changed

.github/workflows/ubuntu.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ jobs:
1111
run: |
1212
make &&
1313
./unit
14+
- name: Use CMake
15+
run: |
16+
cmake -B build &&
17+
cmake --build build &&
18+
ctest --test-dir build
19+

README.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ Fast, vectorized VByte decoding for 32‑bit integers in C, with optional differ
66

77
- Requires x86-64 with SSE4.1 (available on virtually all modern x64 CPUs)
88
- C99 compatible
9-
- Includes a tiny test and a runnable example
10-
11-
Platform notes
12-
--------------
13-
- The library and tests build on Linux and macOS with a standard C toolchain.
14-
- The Makefile installs a shared object named `libmaskedvbyte.so` and uses `ldconfig`, which are Linux specific. On macOS, build and run targets work, but the `install` target is not applicable.
159

1610

1711
Build and test
@@ -22,6 +16,27 @@ make # builds the library and the test binary
2216
./unit # runs a quick correctness test
2317
```
2418

19+
CMake build (alternative)
20+
------------------------
21+
22+
```sh
23+
mkdir -p build
24+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
25+
-DMASKEDVBYTE_BUILD_TESTS=ON \
26+
-DMASKEDVBYTE_BUILD_EXAMPLES=ON
27+
cmake --build build -j
28+
ctest --test-dir build --output-on-failure # optional
29+
30+
# run the example built by CMake
31+
./build/example
32+
```
33+
34+
Install with CMake (optional):
35+
36+
```sh
37+
cmake --install build --prefix /usr/local
38+
```
39+
2540
Build and run the example
2641
-------------------------
2742

@@ -95,6 +110,24 @@ Tips
95110
- If you know the compressed byte length, use the `*_fromcompressedsize` functions to decode exactly that many bytes.
96111

97112

113+
Use from your CMake project
114+
---------------------------
115+
116+
After installation (see above):
117+
118+
```cmake
119+
find_package(maskedvbyte CONFIG REQUIRED)
120+
target_link_libraries(your_target PRIVATE maskedvbyte::maskedvbyte)
121+
```
122+
123+
Or as a subdirectory (vendored):
124+
125+
```cmake
126+
add_subdirectory(path/to/MaskedVByte)
127+
target_link_libraries(your_target PRIVATE maskedvbyte::maskedvbyte)
128+
```
129+
130+
98131
Interesting applications
99132
-----------------------
100133

0 commit comments

Comments
 (0)