module-set qt5-set
    repository qt-projects
    branch kde/5.15 # The last Qt5 branch?

    # init-repository supports catch-alls like "default" as well, in which case
    # you will want to uncomment ignore-modules below to control which modules to
    # leave out
    use-modules qtbase qtdeclarative qtgraphicaleffects qtimageformats          \
        qtmultimedia qtquickcontrols qtquickcontrols2 qtsensors qtsvg  \
        qttools qtwayland qtwebchannel qtwebsockets qtwebview qtx11extras       \
        qtnetworkauth qtspeech qtxmlpatterns

    # qtwebengine is very different to the rest of Qt. You can try ignoring it if
    # you cannot get it to compile by uncommenting the next line.
    # ignore-modules qtwebengine

    # install path. This *MUST* match your qtdir setting in kdesrc-buildrc!
    prefix ${qtdir}

    configure-flags -release -reduce-relocations -force-debug-info -separate-debug-info -skip qtdocgallery

    # Applies to every make command run for Qt build, including Qt's own attempts to
    # run make from its configure script.
    set-env MAKEFLAGS -j${num-cores}
end module-set

# qtwebengine is essentially the Chromium Embedded Framework with Qt bindings
# It has unusually complex source codes which require a lot of memory to compile..
#
# This module will eat a *ton* of RAM and can lockup your system if you have a
# lot of CPU cores. qtwebengine uses a lower number of cores to compile by
# default but you can change the setting to -j here (or in your global options)
# to change that.
options qtwebengine
    set-env NINJAFLAGS -j${num-cores-low-mem}
end options
