-
Notifications
You must be signed in to change notification settings - Fork 750
Faster builds (Linux)
Because this library uses cgo
in order to communicate with Qt
library,
compilation is slow. However there are a few options.
Note the output of the following command (on *nix systems):
# On Arch linux
$ which gcc
/usr/sbin/gcc
# On Ubuntu
$ which gcc
/usr/bin/gcc
After installing ccache
, you need update your PATH
. In ~/.zshrc or ~/.bashrc:
export PATH="/usr/lib/ccache:$PATH"
Now you should see something like this:
# On Arch linux
$ which gcc
/usr/lib/ccache/bin/gcc
# On Ubuntu
$ which gcc
/usr/lib/ccache/gcc
Now all your compilations will go through ccache
and it does its best job to
cache the results. You can query its statistics with ccache -s
and clear its
cache with ccache -C
.
Qt is a complex library, therefore there are a lot of objects to be linked. This
is one reason why your builds are sloe. Fortunately there is an alternative to
gnu's linker called Gold Linker, which links way faster than gnu's. It comes in
binutils
on Linux. In order to use it you need to make move the old ld
and
make a symbolic link to ld.gold
. You can find them in these locations:
/usr/bin/ld
/usr/bin/ld.gold
Now your builds should be significantly faster.