Debian Codegraph @

test cases/failing/120 subproject sandbox violation/meson.build

raw
1 project('subproject-sandbox-violation')
2
3 sub1_d = subproject('subproj1').get_variable('d')
4 sub1_mustfail = sub1_d.get_variable('dir') / '..' / 'file.txt'
5
6 sub2_d = subproject('subproj2').get_variable('d')
7 sub2_mustfail = sub2_d.get_variable('dir') / 'file.txt'
8
9 main_d = declare_dependency(
10 variables: [
11 'dir=@0@'.format(meson.current_source_dir()),
12 ]
13 )
14 main_mustfail = main_d.get_variable('dir') / 'subprojects/subproj3/file.txt'
15
16 if get_option('failmode') == 'parent-dir'
17 mustfail = sub1_mustfail
18 elif get_option('failmode') == 'not-installed'
19 mustfail = sub2_mustfail
20 elif get_option('failmode') == 'root-subdir'
21 mustfail = main_mustfail
22 endif
23
24 custom_target(
25 'mustfail',
26 input: mustfail,
27 output: 'file.txt',
28 command: [
29 'python3', '-c',
30 'import os; shutil.copy(sys.argv[1], sys.argv[2])',
31 '@INPUT@',
32 '@OUTPUT@'
33 ],
34 )