Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: release logging variant #301

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading