Commit Graph

53 Commits

Author SHA1 Message Date
Samuli Piippo
35c8457a39 qt6: force all tools to be built
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING is deprecated in favor of
QT_FORCE_BUILD_TOOLS.

Change-Id: Ibd644adabe9cdd8bd39179c38974d953ce34e5a4
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-05-13 07:31:29 +00:00
Samuli Piippo
312d7185d8 qt6: make configure more verbose
Qt configure has lowered its verbose when not using developer-build.
Increase the verbose level to have the configure summary of the
Qt module back into the logs.

Pick-to: 6.3 6.2
Change-Id: If742b68353fe6f0614bf4be8f355cfc24f9a42f3
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-04-05 08:14:46 +00:00
Samuli Piippo
eaee55e9fe sdk: add bin to PATH
Prepend PATH env with the path to the bin directory in the cmake
toolchain file. This let's CMake to find CMAKE_MAKE_PROGRAM (make or
ninja) without need to specify it explicitly when using the qt-cmake*
helper scripts.

Pick-to: 6.3 6.2
Change-Id: Ic7ce057421395d98158b3ad6e529f30b629bdded
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-03-16 08:09:39 +00:00
Samuli Piippo
554b947ba4 sdk: support cmake builds on Windows
CMake and Ninja combination does not support changing RPATH on Windows hosts,
even when cross-compiling. Add CMake configuration to workaround this.

Pick-to: 6.3 6.2
Change-Id: I5d82c0a7f91cf81a0b3ed7c0f14aeccc36464f91
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-03-16 08:09:35 +00:00
Samuli Piippo
a64c978983 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.

Pick-to: 6.3 6.2
Change-Id: I33a9b0f3915417d98ad12559ce7661c92b1cc739
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
2022-03-10 08:10:47 +02:00
Samuli Piippo
6492c16955 srcrev_update: fix update task with latest fetcher
Additional check was added into the bb.fetcher that needs to be
workaround in srcrev_update task. Otherwise task will fail with
error:

Exception: bb.fetch2.FetchError: Fetcher failure: Recipe uses a
floating tag/branch without a fixed SRCREV yet doesn't call
bb.fetch2.get_srcrev() (use SRCPV in PV for OE).

Pick-to: 6.3 6.2
Change-Id: Ib3c2665257c344c312074519a03d96437866cd8d
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-03-04 07:06:21 +00:00
Samuli Piippo
0ef2348d49 sdk: resolve absolute paths in toolchain file at runtime
MinGW toolchain doesn't perform relocation during installation,
so all the absolute path point to the temporary sdk paths.
Use the location of the toolchain file to get the absolute
paths at runtime instead instead of using external SDKPATH
env for it.

Change-Id: I699b2178baf5cc855a57186056341b6c6eefbbf5
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2022-03-04 07:06:13 +00:00
Samuli Piippo
5cbac6cf35 sdk: rewrite cmake toolchain file without environment variables
The default OEToolchainConfig.cmake uses environment variables
to set all the cmake variables in place. The Qt6Toolchain.cmake
chainloaded the same toolchain file after setting everything to env.

Rewrite the Qt6Toolchain.cmake now to set all the cmake variables
directly without using environment variables or chainloading
the origin OEToolchainConfig.cmake.

This allow better integration to QtCreator that might be used
to modify the compiler flags for projects.

Change-Id: I7c7c42ec17c86f53b62ed557d9b61d5d19abc1e0
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-03-04 07:05:59 +00:00
Samuli Piippo
e78c281c0a sdk: use relativate path with cmake toolchain file
Paths in mingw toolchain are not relocated when installed, so we
need to use relative path for the Qt6Toolchain.cmake file.

Fixes: QTBUG-100642
Pick-to: 6.3 6.2
Change-Id: I48542f20f4443c8130f89c2436f5b0ecea914bb0
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-02-10 09:26:51 +02:00
Samuli Piippo
cbac31ee90 qt6-cmake: inherit pkgconfig
Static build needs pkgconfig for every Qt module. Include it already
in qt6-cmake class instead of in each individual module.

Pick-to: 6.3 6.2
Change-Id: I065382ee49d6b40b76ede9e632d17221451de8d1
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
2022-02-01 06:00:46 +00:00
Samuli Piippo
17c05714ad qt6-cmake: remove unncessary directory separator
Pick-to: 6.3 6.2
Change-Id: Ie4ced4340bcf672cfbf7f034283beb53c93dbd92
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-01-20 15:56:15 +02:00
Samuli Piippo
7f3cb3884d sdk: use Qt's own qt.toolchain.cmake in build scripts
qt-cmake* helper build scripts by default use Qt's generated
qt.toolchain.cmake as the CMAKE_TOOLCHAIN_FILE. Keep this behavior and
patch qt.toolchain.cmake so that will chain-load our Qt6Toolchain.cmake.

qt.toolchain.cmake includes bits that are needed for the conan
integration to work correctly with the sdk.

Pick-to: 6.3 6.2
Change-Id: I89a5e152324178151ba8a5ab4734d542fa4c995c
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2022-01-11 12:12:25 +02:00
Jeroen Hofstee
af73962f3d qt6-qmake: use the OE_QMAKE bindir and libexecdir
The bindir and libexecdir can be set to a different directory. Since
qmake and tools were searched for in the normal native staging bindir
and libexec dir, they would not be found. So use the OE_QMAKE version
of them instead.

Change-Id: I834bded248a79a6f0d18c6a32b4230f44ddf6a64
Pick-to: 6.2 6.3
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2021-12-29 05:24:07 +00:00
Samuli Piippo
7297b1bee8 sdk: support additional build scripts from qtbase
QtBase has several helper scripts available that can be used
to build other modules and tests. Patch those so they work
properly from the sdk.

Fixes: QTBUG-93342
Pick-to: 6.3 6.2
Change-Id: If393d1a0abdebe21a70439190e49715bcd3e35a1
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
2021-12-14 20:23:31 +02:00
Jeroen Hofstee
6b7208cedd sdk: don't append the first line to qt.conf
Since commit 212ae9b ("Use bindir for tools on Windows SDK) qt.conf is
now created in the WORKDIR and is still present when rebuilding the SDK.
Since all lines are appended to the file it will continuesly increase.
So write the first line to the file instead of appending it.

Pick-to: 6.2
Change-Id: I52d4cb91630884a1ecdc1e6b225fda4cf39d852b
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2021-12-08 07:07:30 +01:00
Jeroen Hofstee
002b2ce29f sdk: fix compiler location for QT6_INSTALL_BINDIR != bindir
If QT6_INSTALL_BINDIR is set to a different value than bindir, the compiler
cannot be found, since it is typically installed in bindir. So point to
bindir by default instead.

Pick-to: 6.2
Change-Id: I3bb94c2daf97f1b2500560fdcc4304cba9699ab5
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2021-12-07 06:44:13 +00:00
Samuli Piippo
3bb76773a8 qtbase-native: don't try to find tools
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING triggered qtbase-native
to try to find tools from QT_HOST_PATH, which obviously
doesn't exists yet. Use it only for target and nativesdk
builds.

Fixes compilation failure:
 | -- Searching for tool 'Qt6::moc' in package Qt6CoreTools.
 | CMake Error at cmake/QtToolHelpers.cmake:122 (message):
 |   Neither QT_HOST_PATH_CMAKE_DIR nor Qt6HostInfo_DIR} available.

Pick-to: 6.2
Change-Id: I260526c08f48f179049eb4b0ab3e6561958d0a53
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-08 05:20:06 +02:00
Samuli Piippo
f61b87ae78 Move all Qt module SRCREVs into one file
Move all the module SRCREV into qt6-git.inc file using the same format,
where repository name is used for the postfix. Changes to the module SRCREVs
are mostly done by updating all the modules at once, usually either with
a separate update script, srcrev_update bbclass or by external update bot.
This change should make the update process more easily automated.

Update the srcrev_update bbclass to handle updates in qt6-git.inc in addition
to recipe files, with and without the repository name postfix.

Pick-to: 6.2
Change-Id: I711e7867dba3b066d363ca40f78e7b4aa740a69c
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-09-15 07:53:53 +03:00
Samuli Piippo
7e83f2fc76 Convert to new override syntax
This is the result of automated script (0.9.1) conversion:

oe-core/scripts/contrib/convert-overrides.py .

converting the metadata to use ":" as the override character instead of "_".

Task-number: QTBUG-95705
Change-Id: Ieb57084e2cea47eb3407960ebfce404cee1ddc36
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-08-24 14:37:21 +03:00
Samuli Piippo
7ac9c84014 sdk: use relative paths in qt.conf
Change the absolute host paths in qt.conf to relative. This allows
SDK to work in Windows without need to patch the paths.

Pick-to: 6.2 6.1
Change-Id: I0a3f6e793b033d727f7633c022b27392acc91823
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-06-28 15:27:36 +03:00
Samuli Piippo
f850278548 qmake: use correct host prefix
QT_HOST_PREFIX should point to the root of the host sysroot.

Pick-to: 6.1
Change-Id: I7bb02df58da432ef70dba47f5e5866948f121c53
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-05-25 22:38:17 +03:00
Samuli Piippo
22f55689b5 sdk: use pkg-config from the sdk
Add needed envs to the default toolchain file used when
the setup-environment-* script have not been used.

Fixes: QTBUG-93896
Pick-to: 6.1
Change-Id: I5dc1773152b87f0c11434643de75386ddd999f72
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
2021-05-25 22:38:07 +03:00
Samuli Piippo
7ec2742246 Enable ptest support for Qt modules
Build tests for ptest in Qt modules. The default build using
PACKAGECONFIG[tests] doesn't work as the installation of tests is
not working correctly. Instead build the tests separately after
the module has been built and installed.

The tests have dependencies to the data and source files which
need to be packaged with the test binaries.

Change-Id: Ibae55a29135267ce96949aa0c15ad7e236ef2512
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-05-12 08:03:07 +03:00
Samuli Piippo
212ae9b201 Use bindir for tools on Windows SDK
Move all the builttime tools back to bindir when building a Windows
SDK. This saves us from adding mingw libraries to the libexec dir
needed by the tools.

Fixes: QTBUG-91895
Pick-to: 6.1
Change-Id: I4da0f03190e3862e93c49fbd267baf567bf7a5d5
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-03-18 14:45:31 +02:00
Samuli Piippo
f55ee894d0 sdk: copy qt.conf to libexec dir
Some of the tools have been moved to libexec dir and need to have
the qt.conf available there as well. Amend also commit
381dcb985d so that qt.conf in the SDK
contains the path for the host libexecdir.

Task-number: QTBUG-91756
Pick-to: 6.1
Change-Id: Id76b603d1107dd70c63be7682007e4c34621750a
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-03-16 09:56:33 +02:00
Samuli Piippo
381dcb985d qt6: add support for QT_HOST_LIBEXECS
QMake has new config path for QT_HOST_LIBEXECS that's used for
tools moved from bin to libexec dir.

Change-Id: I7b8ea8c137ce93ff9d9f583eb8e333ab6b16c0bf
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-03-10 09:31:09 +02:00
Samuli Piippo
21c1abd75b Add QMAKE_AR_LTCG
Amend 438c538fd285b33406633574f65dd5045baf8134 with QMAKE_AR_LTCG which
is needed when using LTCG configure option. Cleanup unused variables:
QMAKE_NM has never been used and QMAKE_CFLAGS_ISYSTEM is no longer used.

Pick-to: 6.0
Change-Id: Icdb9ba48f867ff30066d8fda0c223cc3b2be2c2d
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-01-20 15:17:55 +02:00
Samuli Piippo
ac8056ef0e Add QMAKE_OBJCOPY and QMAKE_NM to mkspec
Needed to use the correct cross-compiler tools for objcopy and nm.

Fixes: QTBUG-90256
Pick-to: 6.0
Change-Id: I38048033b17d388b86612bc7205c4e22d948be29
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
2021-01-18 09:44:52 +02:00
Samuli Piippo
9bd853d4fe Add bbclass for disabling unsupported modules
The bbclass can be used to temporarily disable build of a broken
Qt module recipe without breaking the CI, packagegroup or toolchain
builds that include it.

Change-Id: I3a3e4b72350521b16f1c4fe50f423146ad86515d
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2020-11-16 22:04:43 +02:00
Samuli Piippo
07cc8b02a0 sdk: make qt-cmake usable from the sdk
By default qt-cmake contains paths to the build time locations.
Overwrite it so that it's usable from the SDK. Set toolchain file
to Qt6Toolchain.cmake making it work without need to source the
environment-setup script.

Change-Id: I157c0ad3cdb814438be03028a0e045abb85bf058
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2020-10-16 10:14:02 +03:00
Samuli Piippo
e400d8ff3c Use QT_HOST_PATH only with target and nativesdk builds
Native build cannot use QT_HOST_PATH as it doens't exists yet.

Change-Id: I4ca81b15b13e1fe422f04b334eeab058e7db0c9d
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2020-09-30 14:46:46 +03:00
Samuli Piippo
9e69b0f3b0 sdk: set default install prefix
Set default install prefix to match the Qt's prefix path. This makes
deployment on Windows work as otherwise the default path would be some
Windows path instead of target path in the device.

Use CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT same as cmake so that
projects can still set their default path if not forced from command line.

Change-Id: If2d703a3f46abaeaa015df4e9385313498ec9d17
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-24 10:35:44 +00:00
Samuli Piippo
08d101c2eb Add support for mingw32 build
Add support for building nativesdk components with meta-mingw layer
for Windows SDK. Skip some of the nativesdk tools as they cannot be built.

Qt6Toolchain.cmake can be used with SDKPATH environment variable set
to the SDK installation path using forward slashes as path separators.
It depends on the nativesdk-cmake which cannot be built until upstream
patches to meta-mingw are approved.

Task-number: QTBUG-86431
Change-Id: I482f85f10461e77bb183cf763d6ef531b45e016a
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2020-09-22 04:31:51 +00:00
Samuli Piippo
69b4e15f1c sdk: tell qmake to sysrootify all paths
Qmake is no longer using sysroot by default, add config in qt.conf
to make it happen when using from nativesdk.
2020-08-25 10:05:30 +03:00
Samuli Piippo
0a7a810787 Add class for updating SRCREVs
The class can be used for updating the SRCREVs in the recipes
to the latest revision available. It's inherited by default in
all the Qt module recipes. The update can be done for all recipes
with command
  bitbake world -c srcrev_update
2020-06-29 10:03:09 +03:00
Samuli Piippo
c8b6dfd5e7 Use qt.conf to sysrootify the qmake builds
Instead of patching the qtbase sources, use the qt.conf to override
the sysrootify option for qmake.
2020-06-23 10:43:29 +03:00
Samuli Piippo
6b57024c9a qmake: patch prl and pri files
Replace host paths with qmake built-in properties
2020-06-09 15:00:59 +03:00
Samuli Piippo
a6f0dd9305 Update modules
Remove merged patches and remove unneeded patching from qtbase.
2020-05-25 08:37:02 +03:00
Samuli Piippo
15d42fc22c Remove obsolete install fix for qmake builds
With recipe-sysroot now used, the concurrent installation
cannot occur and the install fix is not needed.
2020-05-19 09:48:58 +03:00
Samuli Piippo
b3107df602 Add default qmake configration to work from SDK
The default options are used when the setup-environment script
is not used. This is useful when running qmake builds from
Qt Creator

Task-number: QTBUG-84228
2020-05-18 12:18:10 +03:00
Samuli Piippo
b00138a4d5 cmake: add compiler to the PATH
Compiler needs to be in PATH to be found by CMake.
2020-05-18 08:45:54 +03:00
Samuli Piippo
313d317a42 Add missing quotes 2020-05-18 08:45:26 +03:00
Samuli Piippo
33593d668e Support qmake from SDK
Add correct paths to the qt.conf file for the SDK. Remove unneeded
qtbase patch and patching of the pri/prf files.
2020-05-14 17:26:48 +03:00
Samuli Piippo
90925c5d16 Create cmake toolchain file for Qt
Generate new toolchain file that allows using Qt from the SDK
without sourcing the setup-environment script. This is particularly
useful for integrating the SDK with QtCreator.

Remove qt-cmake and the related qt.toolchain.cmake as they do not
work correctly when used with OE.
2020-05-14 13:06:23 +03:00
Samuli Piippo
4ef5a29445 Add support for building toolchain
A WIP patch that supports cross-compiling tools needed for the
nativesdk. Patching needed for the cmake files to work in
the relocated sdk.
2020-04-28 17:38:43 +03:00
Samuli Piippo
c83312d402 Use syncqt from libexecs
syncqt is moved to libexec, but prf files still try to find it from bins.
2020-04-07 17:26:38 +03:00
Samuli Piippo
85b084989a add class for sdk population
... to create qt.conf
2020-03-25 14:34:47 +02:00
Samuli Piippo
fe753369b5 add dependency to perl 2020-03-25 12:34:35 +02:00
Samuli Piippo
2f4aa0aff4 qmake: don't use recursive by default 2020-03-20 08:45:35 +02:00
Samuli Piippo
bcb8c13a7f Add support for qmake 2020-02-17 17:21:03 +02:00