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.
60 lines
1.5 KiB
60 lines
1.5 KiB
11 years ago
|
project('run target', 'c')
|
||
|
|
||
9 years ago
|
# Make it possible to run built programs.
|
||
|
# In cross builds exe_wrapper should be added if it exists.
|
||
|
|
||
|
exe = executable('helloprinter', 'helloprinter.c')
|
||
8 years ago
|
run_target('runhello',
|
||
|
command : [exe, 'argument'])
|
||
9 years ago
|
|
||
9 years ago
|
converter = find_program('converter.py')
|
||
|
|
||
|
hex = custom_target('exe.hex',
|
||
|
input : exe,
|
||
|
output : 'exe.hex',
|
||
|
command : [converter, '@INPUT@', '@OUTPUT@',
|
||
|
],
|
||
|
)
|
||
|
|
||
8 years ago
|
fakeburner = find_program('fakeburner.py')
|
||
|
|
||
9 years ago
|
# These emulates the Arduino flasher application. It sandwiches the filename inside
|
||
|
# a packed argument. Thus we need to declare it manually.
|
||
|
run_target('upload',
|
||
8 years ago
|
command : [fakeburner, 'x:@0@:y'.format(exe.full_path())],
|
||
9 years ago
|
depends : exe,
|
||
|
)
|
||
|
|
||
|
run_target('upload2',
|
||
8 years ago
|
command : [fakeburner, 'x:@0@:y'.format(hex.full_path())],
|
||
9 years ago
|
depends : hex,
|
||
|
)
|
||
|
|
||
8 years ago
|
python3 = find_program('python3', required : false)
|
||
|
if not python3.found()
|
||
|
python3 = find_program('python')
|
||
|
endif
|
||
|
|
||
8 years ago
|
run_target('py3hi',
|
||
|
command : [python3, '-c', 'print("I am Python3.")'])
|
||
8 years ago
|
|
||
8 years ago
|
run_target('check_exists',
|
||
|
command : [find_program('check_exists.py'), files('helloprinter.c')])
|
||
8 years ago
|
|
||
|
# What if the output of a custom_target is the command to
|
||
|
# execute. Obviously this will not work as hex is not an
|
||
|
# executable but test that the output is generated correctly.
|
||
|
run_target('donotrunme',
|
||
8 years ago
|
command : hex)
|
||
7 years ago
|
|
||
|
# Ensure configure files can be passed
|
||
|
conf = configure_file(
|
||
|
input: 'configure.in',
|
||
|
output: 'configure',
|
||
|
configuration: configuration_data()
|
||
|
)
|
||
|
|
||
|
run_target('configure_script',
|
||
|
command : conf
|
||
|
)
|