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
pull/9605/head
Chris Lamb 3 years ago committed by Eli Schwartz
parent 809792c223
commit 958b1a7fb4
  1. 2
      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

Loading…
Cancel
Save