I have a new meson project with 58 targets. Many of them use the same *.cc files, and meson builds each *.cc file once for each target, which is much slower than autotools. Also, the compile flags should be the same between targets, so in theory meson should be able to re-use the objects.
Is building many targets well-supported in meson? Is there a standard solution for situations like this? I could try to organize all of the sources in my project into shared libraries, but then I would have to decide how to group them, and with autotools I don't have to decide that. I haven't managed to find documentation on this.
-BenRI
P.S. Here is a minimal example:
-------- file: app1.cc -------
int f(int x ,int y) {return x;}
int main() { return f(0,1);}
------ file: meson.build -----
project('app12','cpp')
executable('app1',['app1.cc'])
executable('app2',['app1.cc'])
---------- command -----------
% meson . meson
% cd meson
% meson configure -Dwarning_level=3
% ninja
You should see a warning for unused parameter 'y' occur twice. The file compile_commands.json also has two entries for app1.cc .