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.
46 lines
1.1 KiB
46 lines
1.1 KiB
8 years ago
|
project('build on all', 'c')
|
||
|
|
||
|
py3_mod = import('python3')
|
||
|
py3 = py3_mod.find_python()
|
||
|
|
||
7 years ago
|
executable('fooprog', 'foo.c',
|
||
|
build_by_default : false,
|
||
|
)
|
||
|
|
||
|
executable('barprog', 'foo.c',
|
||
|
build_by_default : false,
|
||
|
build_always : true,
|
||
|
)
|
||
|
|
||
8 years ago
|
comp = files('mygen.py')
|
||
7 years ago
|
checkexists = files('checkexists.py')
|
||
|
|
||
|
mytarget = custom_target('gendat1',
|
||
|
output : 'generated1.dat',
|
||
|
input : 'source.txt',
|
||
|
command : [py3] + comp + ['@INPUT@', '@OUTPUT@'],
|
||
|
build_by_default : true,
|
||
|
)
|
||
|
|
||
|
mytarget = custom_target('gendat2',
|
||
|
output : 'generated2.dat',
|
||
8 years ago
|
input : 'source.txt',
|
||
|
command : [py3] + comp + ['@INPUT@', '@OUTPUT@'],
|
||
|
build_by_default : true,
|
||
7 years ago
|
build_always : false,
|
||
8 years ago
|
)
|
||
|
|
||
7 years ago
|
ct1_output = join_paths(meson.build_root(), 'generated1.dat')
|
||
|
ct2_output = join_paths(meson.build_root(), 'generated2.dat')
|
||
|
exe1_output = join_paths(meson.build_root(), 'fooprog')
|
||
|
exe2_output = join_paths(meson.build_root(), 'barprog')
|
||
|
|
||
8 years ago
|
if host_machine.system() == 'windows'
|
||
7 years ago
|
exe1_output += '.exe'
|
||
|
exe2_output += '.exe'
|
||
8 years ago
|
endif
|
||
|
|
||
|
test('check-build-by-default', py3,
|
||
7 years ago
|
args : [checkexists,
|
||
|
ct1_output, ct2_output, '--not', exe1_output, exe2_output])
|