aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/interpreter/interpreter.py2
-rw-r--r--test cases/common/251 subproject dependency variables/meson.build5
-rw-r--r--test cases/common/251 subproject dependency variables/subprojects/subfiles/foo.c1
-rw-r--r--test cases/common/251 subproject dependency variables/subprojects/subfiles/meson.build3
-rw-r--r--test cases/common/251 subproject dependency variables/test.json1
5 files changed, 11 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 17d21ca..aab15d1 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -680,7 +680,7 @@ class Interpreter(InterpreterBase, HoldableObject):
else:
if not self.is_subproject() and srcdir / self.subproject_dir in p.parents:
continue
- if p.is_absolute() and p.is_dir() and srcdir / self.root_subdir in p.resolve().parents:
+ if p.is_absolute() and p.is_dir() and srcdir / self.root_subdir in [p] + list(p.resolve().parents):
variables[k] = P_OBJ.DependencyVariableString(v)
for d in deps:
if not isinstance(d, dependencies.Dependency):
diff --git a/test cases/common/251 subproject dependency variables/meson.build b/test cases/common/251 subproject dependency variables/meson.build
index 6abcc16..403b6f1 100644
--- a/test cases/common/251 subproject dependency variables/meson.build
+++ b/test cases/common/251 subproject dependency variables/meson.build
@@ -11,3 +11,8 @@ executable(
'foo2',
subfiles_dep.get_variable('pkgdatadir2') / 'foo.c'
)
+
+executable(
+ 'foor32',
+ subfiles_dep.get_variable('pkgdatadir3') / 'foo.c'
+)
diff --git a/test cases/common/251 subproject dependency variables/subprojects/subfiles/foo.c b/test cases/common/251 subproject dependency variables/subprojects/subfiles/foo.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/test cases/common/251 subproject dependency variables/subprojects/subfiles/foo.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/test cases/common/251 subproject dependency variables/subprojects/subfiles/meson.build b/test cases/common/251 subproject dependency variables/subprojects/subfiles/meson.build
index 0c63bac..f5ad0f2 100644
--- a/test cases/common/251 subproject dependency variables/subprojects/subfiles/meson.build
+++ b/test cases/common/251 subproject dependency variables/subprojects/subfiles/meson.build
@@ -4,11 +4,13 @@ files_dep = declare_dependency(
variables: [
'pkgdatadir=@0@/subdir'.format(meson.current_source_dir()),
'pkgdatadir2=@0@/subdir2'.format(meson.current_source_dir()),
+ 'pkgdatadir3=@0@'.format(meson.current_source_dir()),
]
)
install_data('subdir/foo.c', install_dir: get_option('datadir') / 'subdir')
install_subdir('subdir2', install_dir: get_option('datadir'))
+install_data('foo.c', install_dir: get_option('datadir'))
import('pkgconfig').generate(
name: 'depvar_resource',
@@ -21,6 +23,7 @@ import('pkgconfig').generate(
uninstalled_variables: [
'pkgdatadir=@0@/subdir'.format(meson.current_source_dir()),
'pkgdatadir2=@0@/subdir2'.format(meson.current_source_dir()),
+ 'pkgdatadir3=@0@'.format(meson.current_source_dir()),
],
dataonly: true,
)
diff --git a/test cases/common/251 subproject dependency variables/test.json b/test cases/common/251 subproject dependency variables/test.json
index dfd348c..c345bbe 100644
--- a/test cases/common/251 subproject dependency variables/test.json
+++ b/test cases/common/251 subproject dependency variables/test.json
@@ -1,6 +1,7 @@
{
"installed": [
{ "type": "file", "file": "usr/share/pkgconfig/depvar_resource.pc" },
+ { "type": "file", "file": "usr/share/foo.c" },
{ "type": "file", "file": "usr/share/subdir/foo.c" },
{ "type": "file", "file": "usr/share/subdir2/foo.c" }
]