8ae90fa3c753f5aa8559f0c78f4a68fed59add29
setup dev env
install cmake & ninja
# linux
sudo apt install ninja-build
CMAKE_VER=v4.2.1
sudo apt install libssl-dev openssl
git clone --branch $CMAKE_VER --depth 1 https://github.com/Kitware/CMake.git
cd CMake
./bootstrap && make && sudo make install
# mac
brew install cmake ninja
install dependencies
vcpkg --disable-metrics install --recurse
update vcpkg baseline
vcpkg --disable-metrics x-update-baseline
show package versions
vcpkg --disable-metrics list
create CMakeUserPresets.json
{
"version": 2,
"configurePresets": [
{
"name": "default",
"inherits": "vcpkg",
"environment": {
"VCPKG_ROOT": "path/to/vcpkg"
}
}
]
}
format
find . \( -path ./build -o -path ./vcpkg_installed \) -prune -o \
-type f \( -name '*.cc' -o -name '*.h' \) -exec clang-format -i {} +
build
cmake --preset=default
cmake --build build
run
spin up a local redis server
docker run --name redis -p 6379:6379 -it redis:8.4.0
run the binary
./build/main
push messages with redis-cli
docker exec -it redis redis-cli -h localhost -p 6379
XADD key_01 * f1 v1 f2 v2
clean
rm -rf ./build
rm -rf $HOME/.cache/vcpkg
Description
Languages
C++
94%
CMake
6%