diff options
| author | Patrick Steinhardt <ps@pks.im> | 2017-08-30 21:47:12 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2017-09-15 08:16:58 +0200 |
| commit | d630887bb6ab91a55e72fddc65db93ee6abcd984 (patch) | |
| tree | 59435b3bc93059b9c0acf436b0bcdf75565c7f52 /include | |
| parent | 583e4141022481e21a22aa71a1c4c988a57423e9 (diff) | |
| download | libgit2-d630887bb6ab91a55e72fddc65db93ee6abcd984.tar.gz | |
cmake: enable reproducible static linking
By default, both ar(1) and ranlib(1) will insert additional information
like timestamps into generated static archives and indices. As a
consequence, generated static archives are not deterministic when
created with default parameters.
Both programs do support a deterministic mode, which will simply zero
out undeterministic information with `ar D` and `ranlib -D`.
Unfortunately, CMake does not provide an easy knob to add these command
line parameters. Instead, we have to redefine the complete command
definitons stored in the variables CMAKE_C_ARCHIVE_CREATE,
CMAKE_C_ARCHIVE_APPEND and CMAKE_C_ARCHIVE_FINISH.
Introduce a new build option `ENABLE_REPRODUCIBLE_BUILDS`. This option
is available on Unix-like systems with the exception of macOS, which
does not have support for the required flags. If the option is being
enabled, we add those flags to the invocation of both `ar` and `ranlib`
to enable deterministically building the static archive.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
