aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/interpreter/interpreter.py2
-rw-r--r--test cases/unit/106 subproject symlink/cp.py6
-rw-r--r--test cases/unit/106 subproject symlink/meson.build11
-rw-r--r--test cases/unit/106 subproject symlink/symlinked_subproject/datadir/datafile1
-rw-r--r--test cases/unit/106 subproject symlink/symlinked_subproject/datadir/meson.build1
-rw-r--r--test cases/unit/106 subproject symlink/symlinked_subproject/meson.build9
6 files changed, 26 insertions, 4 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 3bf9b42..5cadf52 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -684,7 +684,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] + list(p.resolve().parents):
+ if p.is_absolute() and p.is_dir() and srcdir / self.root_subdir in [p] + list(Path(os.path.abspath(p)).parents):
variables[k] = P_OBJ.DependencyVariableString(v)
for d in deps:
if not isinstance(d, dependencies.Dependency):
diff --git a/test cases/unit/106 subproject symlink/cp.py b/test cases/unit/106 subproject symlink/cp.py
new file mode 100644
index 0000000..adb0547
--- /dev/null
+++ b/test cases/unit/106 subproject symlink/cp.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python3
+
+from sys import argv
+from shutil import copy
+
+copy(argv[1], argv[2])
diff --git a/test cases/unit/106 subproject symlink/meson.build b/test cases/unit/106 subproject symlink/meson.build
index 51c78c7..6766c8e 100644
--- a/test cases/unit/106 subproject symlink/meson.build
+++ b/test cases/unit/106 subproject symlink/meson.build
@@ -1,8 +1,15 @@
project('foo', 'c')
-symlinked_subproject = subproject('symlinked_subproject')
+symlinked_subproject = subproject('symlinked_subproject').get_variable('dep')
executable('foo',
sources : 'main.c',
- dependencies : symlinked_subproject.get_variable('dep')
+ dependencies : symlinked_subproject
+)
+
+custom_target(
+ input : symlinked_subproject.get_variable('datadir') / 'datafile',
+ output : 'datafile_copy',
+ command : [find_program('cp.py'), '@INPUT@', '@OUTPUT@'],
+ build_always : true
)
diff --git a/test cases/unit/106 subproject symlink/symlinked_subproject/datadir/datafile b/test cases/unit/106 subproject symlink/symlinked_subproject/datadir/datafile
new file mode 100644
index 0000000..6a68294
--- /dev/null
+++ b/test cases/unit/106 subproject symlink/symlinked_subproject/datadir/datafile
@@ -0,0 +1 @@
+hello meson
diff --git a/test cases/unit/106 subproject symlink/symlinked_subproject/datadir/meson.build b/test cases/unit/106 subproject symlink/symlinked_subproject/datadir/meson.build
new file mode 100644
index 0000000..cbeb0a9
--- /dev/null
+++ b/test cases/unit/106 subproject symlink/symlinked_subproject/datadir/meson.build
@@ -0,0 +1 @@
+install_data('datafile')
diff --git a/test cases/unit/106 subproject symlink/symlinked_subproject/meson.build b/test cases/unit/106 subproject symlink/symlinked_subproject/meson.build
index 61440c7..3930465 100644
--- a/test cases/unit/106 subproject symlink/symlinked_subproject/meson.build
+++ b/test cases/unit/106 subproject symlink/symlinked_subproject/meson.build
@@ -1,3 +1,10 @@
project('symlinked_subproject', 'c', version : '1.0.0')
-dep = declare_dependency(sources : 'src.c')
+dep = declare_dependency(
+ sources : 'src.c',
+ variables : {
+ 'datadir': meson.current_source_dir() / 'datadir'
+ }
+)
+
+subdir('datadir')