QtWebEngine/Qt6Build: Difference between revisions
m (more description) |
m (add configure qt base) |
||
Line 33: | Line 33: | ||
==Select branches== | ==Select branches== | ||
Let's assume we want to compile Qt 6.4 | Let's assume we want to compile Qt 6.2.4 with Qt Webengine 6.4.3 | ||
Therefore, in qtbase, qtshadertools, qtdeclarative repositories we select barnches: | Therefore, in qtbase, qtshadertools, qtdeclarative repositories we select barnches: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
git checkout origin/6.4 | git checkout origin/6.2.4 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 44: | Line 44: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
cd qtwebengine | cd qtwebengine | ||
git checkout origin/6. | git checkout origin/6.4.3 | ||
git submodule update | git submodule update | ||
cd .. | cd .. | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==Shadow build== | |||
It is common practice to compile project is separate build directory instead of doing in-source build, therefore we create following build layout: | |||
<syntaxhighlight> | |||
mkdir build | |||
cd build | |||
mkdir qtbase qtshadertools qtdeclarative qtwebengine | |||
</syntaxhighlight> | |||
==Configure and build qtbase== | |||
From out qtbase build direcotry we call configure from qtbase source directory: | |||
<syntaxhighlight> | |||
cd build/qtbase | |||
../../qtbase/configure -opensource -confirm-license -release -nomake tests -nomake examples -xcb -opengl desktop -qpa xcb -no-pch -linker lld | |||
</syntaxhighlight> | |||
Here we do release build with no examples and no tests. For other configure options please refer to configure quide https://doc.qt.io/qt-6/configure-options.html | |||
Note to speed up linking time for webengine we decided to use lld linker. |
Revision as of 11:26, 23 March 2023
Building Qt6 WebEngine from Source
Please check platform notes for required dependencies https://doc.qt.io/qt-6/qtwebengine-platform-notes.html.
Qt builds can be done in top level manner, meaning that you clone qt5 main repository (git://code.qt.io/qt/qt5.git), which then initializes all the qt modules as sub-modules,configures and builds everything in one go. However, this small guide shows the alternative way, so called module build, which is more robust as it clones minimum subset of modules required for QtWebEngine and compiles each module separately. It is also very flexible way of building as you can try to compile newer QtWebEngine module with older qt modules. Compiling each module separately has also advantage that you can see configure and compilation issues just for given module, meaning that you can install missing dependencies and just reconfigure and recompile the problematic module instead of rerunning configuration for all modules.
Obtain Qt6 source code
mkdir qt6
cd qt6
git clone git://code.qt.io/qt/qtbase.git
git clone git://code.qt.io/qt/qtshadertools.git
git clone git://code.qt.io/qt/qtdeclarative.git
git clone git://code.qt.io/qt/qtwebengine.git
cd qtwebenigne
git submodule init
git submodule update
cd ..
Note that web engine needs initialization of submodule.
Select branches
Let's assume we want to compile Qt 6.2.4 with Qt Webengine 6.4.3 Therefore, in qtbase, qtshadertools, qtdeclarative repositories we select barnches:
git checkout origin/6.2.4
Where-else in qtwebengine
cd qtwebengine
git checkout origin/6.4.3
git submodule update
cd ..
Shadow build
It is common practice to compile project is separate build directory instead of doing in-source build, therefore we create following build layout:
mkdir build
cd build
mkdir qtbase qtshadertools qtdeclarative qtwebengine
Configure and build qtbase
From out qtbase build direcotry we call configure from qtbase source directory:
cd build/qtbase
../../qtbase/configure -opensource -confirm-license -release -nomake tests -nomake examples -xcb -opengl desktop -qpa xcb -no-pch -linker lld
Here we do release build with no examples and no tests. For other configure options please refer to configure quide https://doc.qt.io/qt-6/configure-options.html
Note to speed up linking time for webengine we decided to use lld linker.