]> git.ipfire.org Git - thirdparty/zstd.git/commit
faster rebuild of zstd
authorYann Collet <yann.collet.73@gmail.com>
Fri, 16 Oct 2020 07:01:41 +0000 (00:01 -0700)
committerYann Collet <yann.collet.73@gmail.com>
Fri, 16 Oct 2020 07:01:41 +0000 (00:01 -0700)
commit80cee8d3fee5997d819c6cb24bfdae1a13c141a2
treeed9620e9e386033caacebeb7ce893ddbb76bd54b
parentca885a198a618494d22ebb65c5124f8c54f6163b
faster rebuild of zstd

Building the zstd CLI costs time.
Some part of it is incompressible, leading to substantial iteration delay when testing code modifications.
That's mainly because all source files from the library must be rebuilt from source every time.

The main reason we don't build the CLI from library object files
is that we can't just build the object directly in the lib/ directory
(which they would by default)
since they use different compilation flags.
Specifically, the CLI enables multithreading, while the library doesn't (by default).

This is solved in this commit, by generating the object files locally.
Now, the CLI and the library can employ different sets of flags, without tripping over each other.
All library object files are generated directly into programs/ dir.
This works because no 2 source files have the same name.

Now, modifying a file doesn't require to recompile the entire lib, just the modified files.
The recipe is also compatible with `-j` parallel build, leading to large build time reductions on multi-core systems.
programs/Makefile