diff options
author | Chris Lamb <lamby@debian.org> | 2021-11-21 09:49:39 -0800 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2021-11-21 14:38:33 -0500 |
commit | 958b1a7fb4f384b17b23a68ecd7f90ef4bbef4ab (patch) | |
tree | 843ebc5285e876ac27304ffca81566c214da7dec /mesonbuild/modules/cmake.py | |
parent | 809792c2233ee0da4127d77f73c3bf715128d33c (diff) | |
download | meson-958b1a7fb4f384b17b23a68ecd7f90ef4bbef4ab.zip meson-958b1a7fb4f384b17b23a68ecd7f90ef4bbef4ab.tar.gz meson-958b1a7fb4f384b17b23a68ecd7f90ef4bbef4ab.tar.bz2 |
Make the generated reproducible .cmake files reproducible.
Whilst working on the Reproducible Builds effort [0], I noticed that meson did
not generate reproducible .cmake files: they include the full path name.
This commit not only makes the build reproducible, but it also matches CMake's
own behaviour. Specifically, CMakePackageConfigHelpers.cmake does the
equivalent transformation using:
get_filename_component(inputFileName "${_inputFile}" NAME)
I originally filed this in Debian as bug #1000327 [1].
[0] https://reproducible-builds.org/
[1] https://bugs.debian.org/1000327
Diffstat (limited to 'mesonbuild/modules/cmake.py')
-rw-r--r-- | mesonbuild/modules/cmake.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index 76a7b9b..67fdd0c 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -299,7 +299,7 @@ class CmakeModule(ExtensionModule): def create_package_file(self, infile, outfile, PACKAGE_RELATIVE_PATH, extra, confdata): package_init = PACKAGE_INIT_BASE.replace('@PACKAGE_RELATIVE_PATH@', PACKAGE_RELATIVE_PATH) - package_init = package_init.replace('@inputFileName@', infile) + package_init = package_init.replace('@inputFileName@', os.path.basename(infile)) package_init += extra package_init += PACKAGE_INIT_SET_AND_CHECK |