Build QtWebEngine from source
Introduction#
Sometimes we need to build QtWebEngine from source for some reason, such as for mp3 support.
Build on Windows
Requirements
- Windows 10, please set your system locale to English, otherwise there may be errors
- Visual Studio 2013 or 2015
- QtWebEngine 5.7 source code (could be downloaded from here)
- Qt 5.7 install version, install it and add
qmake.exe
folder to system path - Python 2, add
python.exe
folder to system path - Git, add
git.exe
folder to system path - gperf, add
gperf.exe
folder to system path - flex-bison, add
win_bison.exe
folder to system path, and rename it tobison.exe
Note: I didn’t test for Visual Studio versions, all Qt versions.. Let’s just take an example here, other versions should be about the same.
Steps to build
- Decompress source code to a folder, let’s call it
ROOT
- Open
Developer Command Prompt for VS2013
, and go toROOT
folder - Run
qmake WEBENGINE_CONFIG+=use_proprietary_codecs qtwebengine.pro
. We add this flag to enable mp3 support. - Run
nmake
Note: Mp3 is not supported by QtWebEngine by default, due to license issue. Please make sure to get a license for the codec you added.