diff options
Diffstat (limited to 'meta-boot2qt/classes')
-rw-r--r-- | meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass | 11 | ||||
-rw-r--r-- | meta-boot2qt/classes/qt5-features.bbclass | 40 |
2 files changed, 51 insertions, 0 deletions
diff --git a/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass b/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass index e98565c..ee1a25f 100644 --- a/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass +++ b/meta-boot2qt/classes/populate_b2qt_qt5_sdk.bbclass | |||
@@ -34,6 +34,7 @@ NATIVE_SDK_MKSPEC_DIR = "${SDK_OUTPUT}${SDKPATHNATIVE}${libdir}/${QT_DIR_NAME}/m | |||
34 | SDK_MKSPEC = "devices/linux-oe-generic-g++" | 34 | SDK_MKSPEC = "devices/linux-oe-generic-g++" |
35 | SDK_DEVICE_PRI = "${SDK_MKSPEC_DIR}/qdevice.pri" | 35 | SDK_DEVICE_PRI = "${SDK_MKSPEC_DIR}/qdevice.pri" |
36 | SDK_DYNAMIC_FLAGS = "-O. -pipe -g" | 36 | SDK_DYNAMIC_FLAGS = "-O. -pipe -g" |
37 | MACHINE_CMAKE = "${SDK_OUTPUT}${SDKPATHNATIVE}${datadir}/cmake/OEToolchainConfig.cmake.d/${MACHINE}.cmake" | ||
37 | 38 | ||
38 | create_sdk_files_append () { | 39 | create_sdk_files_append () { |
39 | # Create the toolchain user's generic device mkspec | 40 | # Create the toolchain user's generic device mkspec |
@@ -79,6 +80,16 @@ EOF | |||
79 | 80 | ||
80 | # Link /etc/resolv.conf is broken in the toolchain sysroot, remove it | 81 | # Link /etc/resolv.conf is broken in the toolchain sysroot, remove it |
81 | rm -f ${SDK_OUTPUT}${SDKTARGETSYSROOT}${sysconfdir}/resolv.conf | 82 | rm -f ${SDK_OUTPUT}${SDKTARGETSYSROOT}${sysconfdir}/resolv.conf |
83 | |||
84 | # Create and add cmake toolchain file | ||
85 | echo "set(CMAKE_SYSROOT ${SDKTARGETSYSROOT})" > ${MACHINE_CMAKE} | ||
86 | echo "set(CMAKE_PREFIX_PATH ${SDKTARGETSYSROOT}${OE_QMAKE_PATH_LIBS}/cmake)" >> ${MACHINE_CMAKE} | ||
87 | echo "set(compiler_flags \"${TARGET_CC_ARCH}\")" >> ${MACHINE_CMAKE} | ||
88 | echo "set(CMAKE_C_COMPILER_ARG1 \"\${compiler_flags}\")" >> ${MACHINE_CMAKE} | ||
89 | echo "set(CMAKE_CXX_COMPILER_ARG1 \"\${compiler_flags}\")" >> ${MACHINE_CMAKE} | ||
90 | echo "set(OE_QMAKE_PATH_EXTERNAL_HOST_BINS ${SDKPATHNATIVE}${OE_QMAKE_PATH_HOST_BINS})" >> ${MACHINE_CMAKE} | ||
91 | mkdir -p ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/ | ||
92 | install -m 0644 ${MACHINE_CMAKE} ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/ | ||
82 | } | 93 | } |
83 | 94 | ||
84 | create_qtcreator_configure_script () { | 95 | create_qtcreator_configure_script () { |
diff --git a/meta-boot2qt/classes/qt5-features.bbclass b/meta-boot2qt/classes/qt5-features.bbclass new file mode 100644 index 0000000..89b3ee6 --- /dev/null +++ b/meta-boot2qt/classes/qt5-features.bbclass | |||
@@ -0,0 +1,40 @@ | |||
1 | ############################################################################ | ||
2 | ## | ||
3 | ## Copyright (C) 2018 The Qt Company Ltd. | ||
4 | ## Contact: https://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:GPL$ | ||
9 | ## Commercial License Usage | ||
10 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
11 | ## accordance with the commercial license agreement provided with the | ||
12 | ## Software or, alternatively, in accordance with the terms contained in | ||
13 | ## a written agreement between you and The Qt Company. For licensing terms | ||
14 | ## and conditions see https://www.qt.io/terms-conditions. For further | ||
15 | ## information use the contact form at https://www.qt.io/contact-us. | ||
16 | ## | ||
17 | ## GNU General Public License Usage | ||
18 | ## Alternatively, this file may be used under the terms of the GNU | ||
19 | ## General Public License version 3 or (at your option) any later version | ||
20 | ## approved by the KDE Free Qt Foundation. The licenses are as published by | ||
21 | ## the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||
22 | ## included in the packaging of this file. Please review the following | ||
23 | ## information to ensure the GNU General Public License requirements will | ||
24 | ## be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||
25 | ## | ||
26 | ## $QT_END_LICENSE$ | ||
27 | ## | ||
28 | ############################################################################ | ||
29 | |||
30 | FEATURES := "${THISDIR}/features/${QT_MODULE}.opt" | ||
31 | do_configure[file-checksums] += "${FEATURES}:True" | ||
32 | |||
33 | def qt_features(d): | ||
34 | featurefile = d.getVar('FEATURES', True) | ||
35 | with open(featurefile, 'r') as f: | ||
36 | features = f.read().replace('\n', ' ') | ||
37 | return features | ||
38 | |||
39 | QT_CONFIG_FLAGS_append_class-target = " ${@qt_features(d)}" | ||
40 | EXTRA_QMAKEVARS_CONFIGURE_append_class-target = " ${@qt_features(d)}" | ||