qttools: check available clang version

qttools required at least clang 17. Don't try to enable the support
unless suitable version is available. meta-clang defines LLVMVERSION
global variable with the version number.

Pick-to: 6.8
Change-Id: I9df38bb475391a177daa8fde349718529f4350e5
Reviewed-by: Ari Parkkila <ari.parkkila@qt.io>
This commit is contained in:
Samuli Piippo 2024-11-04 13:16:30 +00:00
parent 6e1ec45c58
commit e8cf73dca6

View File

@ -26,9 +26,10 @@ SRC_URI += " \
DEPENDS += "qtbase qtdeclarative qttools-native"
PACKAGECONFIG:class-native = "${@bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', 'clang', '', d)}"
PACKAGECONFIG:class-nativesdk = "${@bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', 'clang', '', d)}"
PACKAGECONFIG:remove:mingw32 = "clang"
QTTOOLS_USE_CLANG ?= "${@ 'clang' if bb.utils.vercmp_string_op(d.getVar('LLVMVERSION') or '', '17', '>') else ''}"
PACKAGECONFIG:class-native = "${QTTOOLS_USE_CLANG}"
PACKAGECONFIG:class-nativesdk = "${QTTOOLS_USE_CLANG}"
PACKAGECONFIG:remove:mingw32 = "${QTTOOLS_USE_CLANG}"
PACKAGECONFIG[clang] = "-DFEATURE_clang=ON,-DFEATURE_clang=OFF,clang"