How to do multiple simultaneous builds?



  • How can I build an app or library for multiple platforms/kits/compilers at once? For example, how would I create apps or libraries for the various Android kits in one build? Are there any good examples of this? Where does Qt store the build scripts that it uses?

    Thanks.


  • Moderators

    [quote author="SteveG" date="1401248622"]Where does Qt store the build scripts that it uses?[/quote]

    Every time you run qmake, a Makefile is generated: that is your build script. If you mean Qt library build scripts instead, check out "this":https://qt.gitorious.org/qtsdk.

    [quote author="SteveG" date="1401248622"]How can I build an app or library for multiple platforms/kits/compilers at once?[/quote]

    I think you need to create your own scripts for that, I doubt it can be somehow made automatically using qmake. It is possible that it is possible in QBS.



  • Are there any "simple" examples of a build script that invokes qmake (or QBS), make, etc. multiple times to create an app, plugin, library, etc, for multiple platforms/kits/compilers?

    Thanks.



  • @
    #!/bin/bash

    qt_installation_path is <binary installation location>/<qt version>

    for example: ~/qt-project/5.3/

    for arch in $qt_installation_path/*
    do mkdir -p ${PWD}/build/${arch}
    cd ${PWD}/build/${arch}
    $qt_installation_path/${arch}/bin/qmake $project_path &&
    make &
    done
    @

    Each qmake binary has a built-in configuration that provides a basic set of sane build options for its associated Qt build.

    This script doesn't attempt any sort of job count limitation. If you are using a POSIX platform, GNU parallel is useful, as is the -j flag for make.

    If your situation is on the complex side, a continuous integration tool such as Jenkins might be appropriate.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.