Skip to content

Commit ede255b

Browse files
primeosXinfengZhang
authored andcommitted
meson: Allow for libdir and includedir to be absolute paths
Meson allows to use absolute paths for libdir and includedir [0]. But if they're absolute paths one must not append the prefix. The join_paths() function [1] nicely supports both relative and absolute paths. This is e.g. important for Nixpkgs (i.e. Nix(OS)) where binaries and library files are usually installed under different prefixes. [0]: mesonbuild/meson@a513bcf [1]: https://mesonbuild.com/Reference-manual.html#join_paths Signed-off-by: Michael Weiss <[email protected]>
1 parent ccf3b08 commit ede255b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ libva_lt_version = '@0@.@1@.@2@'.format(libva_lt_current,
6565

6666
driverdir = get_option('driverdir')
6767
if driverdir == ''
68-
driverdir = '@0@/@1@/@2@'.format(get_option('prefix'), get_option('libdir'), 'dri')
68+
driverdir = join_paths(get_option('prefix'), get_option('libdir'), 'dri')
6969
endif
7070

7171
configinc = include_directories('.')

pkgconfig/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ pkgconf = configuration_data()
22

33
pkgconf.set('prefix', get_option('prefix'))
44
pkgconf.set('exec_prefix', '${prefix}')
5-
pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
6-
pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
5+
pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
6+
pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
77
pkgconf.set('LIBVA_VERSION', libva_version)
88
pkgconf.set('VA_API_VERSION', va_api_version)
99
pkgconf.set('LIBVA_DRIVERS_PATH', driverdir)

0 commit comments

Comments
 (0)