Files
qt6-migration-pipeline/app/build_log4qt.sh
T
torsten e83af961e6
Qt6 Migration CI / migrate (push) Waiting to run
Adds log4qt built script
2026-08-29 15:06:01 +02:00

22 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -e
cd /tmp
git clone --depth 1 https://github.com/MEONMedical/Log4Qt.git ./log4qt
cd log4qt
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17
make -j$(nproc)
make install
# Patch installed headers for C++17 compatibility
# Fix 1: Replace C++20 spaceship operator with traditional comparison operators in level.h
# Uses mValue (the actual member variable) instead of mLevel
sed -i 's/\[\[nodiscard\]\] constexpr auto operator<=>(const Level\& other) const noexcept = default;/bool operator<(const Level\& other) const noexcept { return mValue < other.mValue; }\n bool operator<=(const Level\& other) const noexcept { return mValue <= other.mValue; }\n bool operator>(const Level\& other) const noexcept { return mValue > other.mValue; }\n bool operator>=(const Level\& other) const noexcept { return mValue >= other.mValue; }\n bool operator==(const Level\& other) const noexcept { return mValue == other.mValue; }/' /usr/local/include/log4qt/level.h
# Fix 2: Ensure mThreshold.load() is used in appenderskeleton.h
sed -i 's/return (mThreshold <= level)/return (mThreshold.load() <= level)/g' /usr/local/include/log4qt/appenderskeleton.h
echo "log4qt built and patched for C++17"