dependencies: Use prefix variable with define_variable

The test used by the new define_variable parameter was using the
includedir directory. However, in order to get a successful test,
the includedir variables needs to be relative to the prefix
variable, otherwise the replacemente will not have any effect.

This changes uses the prefix variable itself because we can
assure that it will be present.
pull/2663/head
Iñigo Martínez 7 years ago
parent 44dd429ee5
commit f8aab2f011
  1. 2
      test cases/linuxlike/1 pkg-config/meson.build

@ -18,7 +18,7 @@ zprefix = dep.get_pkgconfig_variable('prefix') # Always set but we can't be sure
# pkg-config returns empty string for not defined variables
assert(dep.get_pkgconfig_variable('nonexisting') == '', 'Value of unknown variable is not empty.')
# pkg-config is able to replace variables
assert(dep.get_pkgconfig_variable('includedir', define_variable: ['prefix', '/tmp']) == '/tmp/include', 'prefix variable has not been replaced.')
assert(dep.get_pkgconfig_variable('prefix', define_variable: ['prefix', '/tmp']) == '/tmp', 'prefix variable has not been replaced.')
# Test that dependencies of dependencies work.
dep2 = declare_dependency(dependencies : dep)

Loading…
Cancel
Save