1
0
mirror of https://github.com/juzzlin/Heimer.git synced 2025-05-09 21:01:39 +08:00

Update MXE and build Windows versions against Qt 6

This commit is contained in:
Jussi Lind 2024-07-01 14:46:16 +03:00
parent 58e6b485bb
commit 5b3615cdae
5 changed files with 27 additions and 23 deletions

View File

@ -1,16 +1,12 @@
project(Heimer)
cmake_minimum_required(VERSION 3.10)
cmake_policy(VERSION 3.10)
project(Heimer)
if(POLICY CMP0005)
cmake_policy(SET CMP0005 NEW)
endif()
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW)
endif()
@ -55,6 +51,8 @@ option(BUILD_TESTS "Build unit tests." ON)
option(BUILD_WITH_QT6 "Build with Qt 6 instead of Qt 5" OFF)
option(ENABLE_CCACHE "Use CCache if found." ON)
# Default to release C++ flags if CMAKE_BUILD_TYPE not set
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
@ -79,14 +77,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
# Automatically use ccache if found
if(ENABLE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
endif()
endif()
elseif(MSVC)
add_definitions(-DNOMINMAX)
endif()

4
Jenkinsfile vendored
View File

@ -76,7 +76,7 @@ pipeline {
stage('Windows NSIS installer') {
agent {
docker {
image 'juzzlin/mxe-qt5-20.04:latest'
image 'juzzlin/mxe-qt6-22.04:latest'
args '-t -v $WORKSPACE:/heimer'
}
}
@ -92,7 +92,7 @@ pipeline {
stage('Windows ZIP') {
agent {
docker {
image 'juzzlin/mxe-qt5-20.04:latest'
image 'juzzlin/mxe-qt6-22.04:latest'
args '-t -v $WORKSPACE:/heimer'
}
}

View File

@ -8,16 +8,17 @@ CPACK=/mxe/usr/bin/i686-w64-mingw32.static-cpack
CMD="export LANG=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
export PATH='$PATH':/mxe/usr/bin && \
export CCACHE_DISABLE=1 && \
cd /heimer && \
rm -rf build-windows-nsis && mkdir -p build-windows-nsis && \
cd build-windows-nsis && ${CMAKE} -GNinja -DPACKAGE_TYPE=NSIS .. && \
${CMAKE} --build . && ${CPACK} -G NSIS"
cd build-windows-nsis && ${CMAKE} -GNinja -DBUILD_WITH_QT6=ON -DPACKAGE_TYPE=NSIS .. && \
ninja && ${CPACK} -G NSIS"
if [ -f /.dockerenv ]; then
echo "Script inside Docker"
bash -c "${CMD}"
else
echo "Script outside Docker"
docker run --user $(id -u):$(id -g) -t -v $(pwd):/heimer juzzlin/mxe-qt5-20.04:latest bash -c "${CMD}"
docker run --user $(id -u):$(id -g) -t -v $(pwd):/heimer juzzlin/mxe-qt6-22.04:latest bash -c "${CMD}"
fi

View File

@ -9,10 +9,11 @@ CMAKE=/mxe/usr/bin/i686-w64-mingw32.static-cmake
CMD="export LANG=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
export PATH='$PATH':/mxe/usr/bin && \
export CCACHE_DISABLE=1 && \
cd /heimer && \
rm -rf build-windows-zip && mkdir -p build-windows-zip && \
cd build-windows-zip && ${CMAKE} -GNinja -DPACKAGE_TYPE=ZIP .. && \
${CMAKE} --build . && \
cd build-windows-zip && ${CMAKE} -GNinja -DBUILD_WITH_QT6=ON -DPACKAGE_TYPE=ZIP .. && \
ninja && \
mkdir zip && cd zip && \
cp -v ../AUTHORS . && \
cp -v ../CHANGELOG . && \
@ -26,6 +27,6 @@ if [ -f /.dockerenv ]; then
bash -c "${CMD}"
else
echo "Script outside Docker"
docker run --user $(id -u):$(id -g) -t -v $(pwd):/heimer juzzlin/mxe-qt5-20.04:latest bash -c "${CMD}"
docker run --user $(id -u):$(id -g) -t -v $(pwd):/heimer juzzlin/mxe-qt6-22.04:latest bash -c "${CMD}"
fi

View File

@ -17,9 +17,13 @@
void HashSeed::init()
{
#if QT_VERSION >= 0x50600
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
qt_qhash_seed.store(0);
#else
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
qSetGlobalQHashSeed(0);
#else
qt_qhash_seed.store(0);
QHashSeed::setDeterministicGlobalSeed();
#endif
#endif
}