Skip to content

Commit

Permalink
Merge pull request #301 from qzhuyan/build/william/release-logging-va…
Browse files Browse the repository at this point in the history
…riant
  • Loading branch information
qzhuyan authored Sep 29, 2024
2 parents 0a3107f + b4a62e7 commit 1552351
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@ else()
set(QUIC_ENABLE_LOGGING "OFF")
endif()

set(LIBNAME_SUFFIX "")
if (DEFINED ENV{QUIC_LOGGING_TYPE})
set(QUIC_ENABLE_LOGGING "ON")
set(QUIC_LOGGING_TYPE $ENV{QUIC_LOGGING_TYPE})
if (${QUIC_LOGGING_TYPE} STREQUAL "stdout")
add_compile_options(-DQUICER_LOGGING_STDOUT)
endif()
if (DEFINED ENV{BUILD_RELEASE})
set(LIBNAME_SUFFIX "-log${QUIC_LOGGING_TYPE}")
endif()
endif()

if (DEFINED ENV{QUICER_USE_LTTNG} AND DEFINED ENV{QUICER_USE_SNK})
Expand Down Expand Up @@ -184,7 +188,7 @@ add_dependencies(quicer_static msquic)

set_target_properties(quicer_nif
PROPERTIES
LIBRARY_OUTPUT_NAME quicer_nif
LIBRARY_OUTPUT_NAME quicer_nif${LIBNAME_SUFFIX}
VERSION ${QUICER_VERSION}
SOVERSION ${QUICER_ABI_VERSION}
)
Expand Down
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,24 @@ download() {
remove_dups() {
cp -L $TARGET_SO ${TARGET_SO}tmp
rm ${TARGET_SO}.*
rm ${TARGET_SO}-.*
mv ${TARGET_SO}tmp $TARGET_SO
}

release() {
local variant=${1:-""}
if [ -z "$PKGNAME" ]; then
echo "unable_to_resolve_release_package_name"
exit 1
fi
mkdir -p _packages
PKGNAME="$(basename $PKGNAME .gz)${variant}.gz"
TARGET_PKG="_packages/${PKGNAME}"
tar czvf "$TARGET_PKG" -C $(dirname "$TARGET_SO") \
--exclude include --exclude share --exclude .gitignore \
--exclude lib \
.
#$(basename $TARGET_SO).*
# use openssl but not sha256sum command because in some macos env it does not exist
if command -v openssl; then
openssl dgst -sha256 "${TARGET_PKG}" | cut -d ' ' -f 2 > "${TARGET_PKG}.sha256"
Expand All @@ -101,6 +105,9 @@ release() {
if [ "${BUILD_RELEASE:-}" = 1 ]; then
build
release
## build logging type variant
QUIC_LOGGING_TYPE=stdout build
release "logstdout"
else
if [ "${QUICER_DOWNLOAD_FROM_RELEASE:-0}" = 1 ]; then
if ! download; then
Expand Down

0 comments on commit 1552351

Please sign in to comment.