mirror of
http://code.qt.io/yocto/meta-qt6.git
synced 2026-01-01 13:58:07 +00:00
Create Conan profile
Generate Conan profiles that can then be used with the SDK.
Task in qtbase generates profile that has all the architecture bits
and configure arguments in place. The profile added in the SDK phase
lets Conan recipes know how to use the SDK with the QT_CONFIGURE_MODULE
environment variable.
Change-Id: I33a9b0f3915417d98ad12559ce7661c92b1cc739
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit a64c978983)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
975f77f9e8
commit
853c9c8a37
|
|
@ -129,6 +129,14 @@ EOF
|
|||
# resolve absolute paths at runtime
|
||||
sed -i -e 's|${SDKPATH}/sysroots|\${SYSROOTS}|g' \
|
||||
${SDK_OUTPUT}${SDKPATHNATIVE}/usr/share/cmake/Qt6Toolchain.cmake
|
||||
|
||||
# Conan profile
|
||||
mkdir -p ${SDK_OUTPUT}${SDKPATHNATIVE}/usr/share/conan
|
||||
cat > ${SDK_OUTPUT}${SDKPATHNATIVE}/usr/share/conan/profile <<EOF
|
||||
include(${SDKTARGETSYSROOT}${datadir}/conan/profile)
|
||||
[env]
|
||||
QT_CONFIGURE_MODULE=${SDKPATHNATIVE}${QT6_INSTALL_BINDIR}/qt-configure-module
|
||||
EOF
|
||||
}
|
||||
|
||||
# default debug prefix map isn't valid in the SDK
|
||||
|
|
|
|||
52
recipes-qt/qt6/conan.inc
Normal file
52
recipes-qt/qt6/conan.inc
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# Generate Conan profile
|
||||
do_install:append:class-target() {
|
||||
install -d ${D}${datadir}/conan
|
||||
cat > ${D}${datadir}/conan/profile <<EOF
|
||||
[settings]
|
||||
os=Linux
|
||||
arch=${@map_conan_arch(d.getVar('TARGET_ARCH'), d)}
|
||||
compiler=gcc
|
||||
compiler.version=$(${CC} -dumpfullversion | cut -d . -f 1,2)
|
||||
compiler.libcxx=libstdc++11
|
||||
build_type=${BUILD_TYPE}
|
||||
[options]
|
||||
qtbase:cmake_args_qtbase="${@cmake_args_qtbase(d)}"
|
||||
*:cmake_args_leaf_module=""
|
||||
[build_requires]
|
||||
[env]
|
||||
CONAN_CMAKE_GENERATOR=${OECMAKE_GENERATOR}
|
||||
EOF
|
||||
}
|
||||
|
||||
def map_conan_arch(a, d):
|
||||
import re
|
||||
|
||||
valid_archs = "x86, x86_64, ppc32be, ppc32, ppc64le, ppc64, \
|
||||
armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, \
|
||||
sparc, sparcv9, mips, mips64, avr, s390, s390x, asm.js, wasm, sh4le, \
|
||||
e2k-v2, e2k-v3, e2k-v4, e2k-v5, e2k-v6, e2k-v7, xtensalx6, xtensalx106"
|
||||
|
||||
if re.match('i.86$', a): return 'x86'
|
||||
elif re.match('x86.64$', a): return 'x86_64'
|
||||
elif re.match('arm$', a): return 'arm'
|
||||
elif re.match('aarch64$', a): return 'armv8'
|
||||
elif re.match('mips(isa32)?(el)?$', a): return 'mips'
|
||||
elif re.match('mips(isa)?(64)?(el)?$', a): return 'mips64'
|
||||
elif re.match('p(pc|owerpc)$', a): return 'ppc32be'
|
||||
elif re.match('p(pc|owerpc)le$', a): return 'ppc32'
|
||||
elif re.match('p(pc|owerpc)64$', a): return 'ppc64'
|
||||
elif re.match('p(pc|owerpc)64le$', a): return 'ppc64le'
|
||||
elif re.match('sh4$', a): return 'sh4le'
|
||||
elif a in valid_archs: return a
|
||||
else:
|
||||
bb.warn("cannot map '%s' to a conan architecture" % a)
|
||||
|
||||
def cmake_args_qtbase(d):
|
||||
import re
|
||||
rm_args = ['-DQT_HOST_PATH[^ ]*']
|
||||
args = d.getVar('EXTRA_OECMAKE')
|
||||
for arg in rm_args:
|
||||
args = re.sub(arg, '', args)
|
||||
return args
|
||||
|
||||
FILES:${PN}-dev += "${datadir}/conan"
|
||||
|
|
@ -12,6 +12,7 @@ inherit qt6-cmake
|
|||
|
||||
include recipes-qt/qt6/qt6-git.inc
|
||||
include recipes-qt/qt6/qt6.inc
|
||||
include recipes-qt/qt6/conan.inc
|
||||
|
||||
SRC_URI += "\
|
||||
file://0001-Add-linux-oe-g-platform.patch \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user