Skip to content

Commit

Permalink
Use path join operator for includedir and libdir in cmake config
Browse files Browse the repository at this point in the history
When includedir or libdir are set to an absolute path, the previous code
appends that absolute path to ${prefix}, which results in a wrong path. The
right behavior would be in this case to drop ${prefix} and just use the
absolute path.

This is an issue in nixpkgs, where includedir is set to the final (absolute)
path of the built library in the Nix store.

See NixOS/nixpkgs#180054.
  • Loading branch information
2xsaiko committed Oct 26, 2022
1 parent 83769b9 commit 61d8e9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,8 @@ endif
have_gobject = conf.get('HAVE_GOBJECT', 0) == 1

cmake_config = configuration_data()
cmake_config.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
cmake_config.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
cmake_config.set('libdir', '${prefix}' / '@0@'.format(get_option('libdir')))
cmake_config.set('includedir', '${prefix}' / '@0@'.format(get_option('includedir')))
cmake_config.set('HB_LIBTOOL_VERSION_INFO', hb_libtool_version_info)
cmake_config.set('have_gobject', '@0@'.format(have_gobject))
configure_file(input: 'harfbuzz-config.cmake.in',
Expand Down

0 comments on commit 61d8e9d

Please sign in to comment.