diff options
Diffstat (limited to 'test cases/unit/106 subproject symlink')
7 files changed, 43 insertions, 0 deletions
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/main.c b/test cases/unit/106 subproject symlink/main.c new file mode 100644 index 0000000..62bd4b4 --- /dev/null +++ b/test cases/unit/106 subproject symlink/main.c @@ -0,0 +1,6 @@ +extern int foo(void); + +int main(void) +{ + return foo(); +} diff --git a/test cases/unit/106 subproject symlink/meson.build b/test cases/unit/106 subproject symlink/meson.build new file mode 100644 index 0000000..6766c8e --- /dev/null +++ b/test cases/unit/106 subproject symlink/meson.build @@ -0,0 +1,15 @@ +project('foo', 'c') + +symlinked_subproject = subproject('symlinked_subproject').get_variable('dep') + +executable('foo', + sources : 'main.c', + 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 new file mode 100644 index 0000000..3930465 --- /dev/null +++ b/test cases/unit/106 subproject symlink/symlinked_subproject/meson.build @@ -0,0 +1,10 @@ +project('symlinked_subproject', 'c', version : '1.0.0') + +dep = declare_dependency( + sources : 'src.c', + variables : { + 'datadir': meson.current_source_dir() / 'datadir' + } +) + +subdir('datadir') diff --git a/test cases/unit/106 subproject symlink/symlinked_subproject/src.c b/test cases/unit/106 subproject symlink/symlinked_subproject/src.c new file mode 100644 index 0000000..97d7ad1 --- /dev/null +++ b/test cases/unit/106 subproject symlink/symlinked_subproject/src.c @@ -0,0 +1,4 @@ +int foo(void) +{ + return 0; +} |