The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
899 B
35 lines
899 B
3 years ago
|
project('subproject-sandbox-violation')
|
||
|
|
||
|
sub1_d = subproject('subproj1').get_variable('d')
|
||
|
sub1_mustfail = sub1_d.get_variable('dir') / '..' / 'file.txt'
|
||
|
|
||
|
sub2_d = subproject('subproj2').get_variable('d')
|
||
|
sub2_mustfail = sub2_d.get_variable('dir') / 'file.txt'
|
||
|
|
||
3 years ago
|
main_d = declare_dependency(
|
||
|
variables: [
|
||
|
'dir=@0@'.format(meson.current_source_dir()),
|
||
|
]
|
||
|
)
|
||
|
main_mustfail = main_d.get_variable('dir') / 'subprojects/subproj3/file.txt'
|
||
|
|
||
3 years ago
|
if get_option('failmode') == 'parent-dir'
|
||
|
mustfail = sub1_mustfail
|
||
|
elif get_option('failmode') == 'not-installed'
|
||
|
mustfail = sub2_mustfail
|
||
3 years ago
|
elif get_option('failmode') == 'root-subdir'
|
||
|
mustfail = main_mustfail
|
||
3 years ago
|
endif
|
||
|
|
||
|
custom_target(
|
||
|
'mustfail',
|
||
|
input: mustfail,
|
||
|
output: 'file.txt',
|
||
|
command: [
|
||
|
'python3', '-c',
|
||
|
'import os; shutil.copy(sys.argv[1], sys.argv[2])',
|
||
|
'@INPUT@',
|
||
|
'@OUTPUT@'
|
||
|
],
|
||
|
)
|