I downloaded qt-everywhere-src-5.12.7.tar.xz
which containts a README which says:
See output of `./configure -help' for documentation on various options to configure.
That output includes the following:
Component selection:
-make <part> ......... Add <part> to the list of parts to be built.
Specifying this option clears the default list first.
[libs and examples, also tools if not cross-building,
also tests if -developer-build]
-nomake <part> ....... Exclude <part> from the list of parts to be built.
- How can I find the names which can be used as
part
?
From How to compile Qt as static, I can see some options are
-nomake demos -nomake tools
- What about
-no-webkit -no-script
, is this the same as-nomake-webkit -nomake-script
?
I tried the following and got an error related to -no-webkit
:
$ ./configure -prefix $PWD/qtbase -opensource -release -no-webkit -no-script -no-scripttools -no-qt3support -nomake demos -nomake tools -nomake examples
+ cd qtbase
+ /home/user/Downloads/qt/qt-everywhere-src-5.12.7/qtbase/configure -top-level -prefix /home/user/Downloads/qt/qt-everywhere-src-5.12.7/qtbase -opensource -release -no-webkit -no-script -no-scripttools -no-qt3support -nomake demos -nomake tools -nomake examples
Creating qmake...
............................................................................................Done.
Info: creating super cache file /home/user/Downloads/qt/qt-everywhere-src-5.12.7/.qmake.super
Info: creating cache file /home/user/Downloads/qt/qt-everywhere-src-5.12.7/.qmake.cache
ERROR: Unknown command line option '-no-webkit'.
Qt 6 now explicitly spells out the allowed values in the configure –help output.
You can find this located at the base of the qtbase repository in the config_help.txt file. Make sure you have the Qt 6 version of the sources – either an expanded Qt 6 source tarball or git module checked out to a 6.x branch or tag. Below is the value:
-make <part> ......... Add <part> to the list of parts to be built.
Specifying this option clears the default list first.
(allowed values: libs, tools, examples, tests,
benchmarks, manual-tests, minimal-static-tests)
[default: libs and examples, also tools if not
cross-building, also tests if -developer-build]
For Qt 5, you can see the acceptable values in configure.json located at the base of the qtbase git module directory. Make sure you have the Qt 5 version of the sources – either an expanded Qt 5 source tarball or git module checked out to a 5.x branch or tag. Below is the value:
"make": { "type": "addString", "values": [ "examples", "libs", "tests", "tools" ] },
The -no-feature
Flag
You can also use the flag -no-feature-<feature>
to disable certain features such as webengine (the new name for webkit in newer Qt versions). Executing configure -list-features
gives a comprehensive list of features that you can enable/disable with this flag.
So, for example, if I wanted to disable support for animated images, I could use the following flag:
-no-feature-movie
The -nomake
Flag
You can use this in conjunction with the -make/-nomake
flags as well. configure -help
shows possible options (parts) for these flags:
-make <part> … Add <part> to the list of parts to be built. Specifying this option clears the default list first.
(allowed values: libs, tools, examples, tests, benchmarks, manual-tests, minimal-static-tests)
[default: libs and examples, also tools if not cross-building, also tests if -developer-build]
-nomake <part> ……. Exclude <part> from the list of parts to be built.
So, for example, if I wanted to exclude the building of examples, I would add the following flag:
-nomake examples
The -skip
Flag
Finally, you can also use the -skip <repo>[,<repo>]
flag (other permutations available, check config_help.txt) to skip building submodules entirely.
For example, to exclude the Qt Wayland Compositor, use the following flag:
-skip qtwayland
And for more info on statically compiling Qt 6.*, reference The Qt Documentation.
Conclusion
So, what are the differences between using the -no-feature
, -nomake
, and -skip
, and what are the specific advantages between using these flags?
-no-feature
: This flag is used to disable specific features (optional components) within Qt modules. By using this flag, you can exclude certain features from being built, which is useful for reducing the size of the final build if you don’t need those features.
-nomake
: This flag is used to skip over building certain components or tools entirely by excluding specific Qt modules/tools from the build process altogether, which helps reduce the overall build time and size.
-skip
: This flag is similar to -nomake, but it’s used specifically within the Qt source tree to skip building certain modules or components during the configuration phase, and accepts a wider range of parameters.
Hope this helps! (sorry for being 3 years late lol)
https://doc.qt.io/qbs/qt-modules.html
axcontainer
axserver
concurrent
core
dbus
declarative
designer
enginio
gui
help
multimedia
multimediawidgets
network
opengl
phonon
printsupport
quick
quickcontrols2
qml
qmltest
script
scxml
sql
svg
testlib
webkit
webkitwidgets
widgets
xml
xmlpatterns
1