C
开发测试过程
step1. 安装vcpkg
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
export VCPKG_ROOT="$PWD/vcpkg"
export PATH="$VCPKG_ROOT:$PATH"
step2. 通过vcpkg
安装依赖库
vcpkg install curl libyaml libgit2 libarchive libqrencode cunit
step3. 配置
cmake \
-S . \
-B build.d \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_TESTING=ON
step4. 编译
cmake --build build.d
step5. 运行单元测试
ctest --test-dir build.d/algorithm/base16
step6. 运行valgrind测试
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --error-exitcode=1 build.d/algorithm/base16
release安装过程
step1. 安装vcpkg
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
export VCPKG_ROOT="$PWD/vcpkg"
export PATH="$VCPKG_ROOT:$PATH"
step2. 通过vcpkg
安装依赖库
vcpkg install curl libyaml libgit2 libarchive libqrencode cunit
step3. 配置
cmake \
-S . \
-B build.d \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_INSTALL_PREFIX=./output \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=OFF
step4. 编译
cmake --build build.d
step5. 安装
cmake --install build.d