Verify QT_VERSION

Add task to verify that QT_VERSION matches the version used in the Qt sources.

Pick-to: 6.8
Change-Id: I0065bf3bcda7174a337960f4ec1ac7c403599fcf
Reviewed-by: Ari Parkkila <ari.parkkila@qt.io>
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
(cherry picked from commit e32ce33ee2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e45ceca70d)
This commit is contained in:
Samuli Piippo 2025-12-10 07:22:59 +00:00 committed by Qt Cherry-pick Bot
parent efdcfa06e2
commit 77171e9de8
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,22 @@
python do_verify_qt_version() {
import os, re
qt_version = d.getVar('QT_VERSION')
cmake_conf = os.path.join(d.getVar('S'), '.cmake.conf')
with open(cmake_conf, 'r', encoding='utf-8') as f:
data = f.read()
m = re.search(r'set\(QT_REPO_MODULE_VERSION "([0-9.]+)"\)', data)
if not m:
bb.fatal("Could not parse QT_REPO_MODULE_VERSION from %s" % cmake_conf)
repo_version = m.group(1)
if qt_version != repo_version:
bb.fatal("Qt version mismatch: QT_VERSION (%s) does not match the sources (%s)" \
% (qt_version, repo_version))
}
addtask verify_qt_version after do_patch before do_configure

View File

@ -15,7 +15,7 @@ LIC_FILES_CHKSUM = " \
file://LICENSES/Qt-GPL-exception-1.0.txt;md5=9a13522cd91a88fba784baf16ea66af8 \
"
inherit qt6-cmake
inherit qt6-cmake verify-qt-version
include recipes-qt/qt6/qt6-git.inc
include recipes-qt/qt6/qt6.inc