With the following project structure
pj
|-src
|-pj.c
|-meson.build
|-meson.build
where pj/meson.build is
project('pj', 'c', version : '0.1')
subdir('src')
library('pj', sources : srcs)
and pj/src/meson.build is
srcs = 'pj.c'
then running
pj$ meson build
pj$ ninja -C build
gives the ninja error
File pj.c does not exist.
The only way I can get it to work is by setting pj/src/meson.build to
srcs='src/pj.c'
Easy enough when there’s only 1 file but suppose there was 1,000.I found this earlier
Meson targets that depend on subdir siblings
and I’d like to do it the way rellenberg’s answer suggested however I can’t see why my code won’t work.