From c219ff47324a1723b6bda90ffea02e06dd9f8a06 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Mon, 14 Oct 2024 16:41:24 +1300 Subject: [PATCH] add msquic_debug script --- scripts/msquic_debug.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/msquic_debug.sh diff --git a/scripts/msquic_debug.sh b/scripts/msquic_debug.sh new file mode 100755 index 0000000..d2a40f0 --- /dev/null +++ b/scripts/msquic_debug.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -e + +CWD=$(pwd) + +system=$(uname -s) + +arch=$(uname -m) + +out_dir=${CWD}/build/${system}-${arch} + +mkdir -p ${out_dir} + +cd msquic || { echo "Submodule directory not found"; exit 1; } + +rm -rf build + +mkdir build && cd build + +if [ $system = "Darwin" ]; then + cmake -DCMAKE_BUILD_TYPE=Debug -DQUIC_ENABLE_LOGGING=ON -DQUIC_LOGGING_TYPE=stdout -DCMAKE_OSX_ARCHITECTURES=$arch -DCMAKE_C_FLAGS="-Wno-invalid-unevaluated-string" -DQUIC_BUILD_SHARED=off .. +elif [ $system = "Linux" ]; then + cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DQUIC_ENABLE_LOGGING=ON -DQUIC_LOGGING_TYPE=stdout -DCMAKE_OSX_ARCHITECTURES=$arch -DCMAKE_C_FLAGS="-Wno-invalid-unevaluated-string" -DQUIC_BUILD_SHARED=off .. +fi + +cmake --build . || { echo "Build msquic library failed"; exit 1; } + +cp bin/Debug/libmsquic.a ${out_dir} + +echo "msquic built successfully"