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.
 
 
 
 
 
 

23 lines
564 B

project('link_with custom target', ['c'])
#
# libraries created by a custom_target currently can be used in sources: (see
# common/100 manygen/ for an example of that), but not in link_with:
#
lib_generator = find_program('lib_generator.py')
cc = meson.get_compiler('c').cmd_array().get(-1)
libfoo_target = custom_target(
'libfoo',
input: ['foo.c'],
output: ['libfoo.a'],
command: [lib_generator, cc, '@INPUT@', '@OUTPUT@']
)
libfoo = declare_dependency(
link_with: libfoo_target,
)
executable('demo', ['demo.c'], dependencies: [libfoo])