From 935ca128220806911821c5694e7856c0d343806a Mon Sep 17 00:00:00 2001 From: Iñigo Martínez Date: Mon, 20 Nov 2017 22:00:25 +0100 Subject: dependencies: Allow pkg-config to define variables pkg-config enables to define variables by using the define-variable option. This allows some packages to redefine relative paths, so files can be installed in the same relative paths but under prefix. --- test cases/linuxlike/1 pkg-config/meson.build | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test cases/linuxlike') diff --git a/test cases/linuxlike/1 pkg-config/meson.build b/test cases/linuxlike/1 pkg-config/meson.build index 7e438211f..8a4940b6b 100644 --- a/test cases/linuxlike/1 pkg-config/meson.build +++ b/test cases/linuxlike/1 pkg-config/meson.build @@ -17,6 +17,8 @@ test('zlibtest', exe) zprefix = dep.get_pkgconfig_variable('prefix') # Always set but we can't be sure what the value is. # 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.') # Test that dependencies of dependencies work. dep2 = declare_dependency(dependencies : dep) -- cgit v1.2.3 From f8aab2f011afc93767a487cb68e856e21f9786d8 Mon Sep 17 00:00:00 2001 From: Iñigo Martínez Date: Fri, 1 Dec 2017 11:08:51 +0100 Subject: 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. --- test cases/linuxlike/1 pkg-config/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test cases/linuxlike') diff --git a/test cases/linuxlike/1 pkg-config/meson.build b/test cases/linuxlike/1 pkg-config/meson.build index 8a4940b6b..f72e11126 100644 --- a/test cases/linuxlike/1 pkg-config/meson.build +++ b/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) -- cgit v1.2.3