However, that illustrates a fundamental weakness of Ninja that is
never documented. There is no way (and most other build automation
tools have some way for that) to use ninja (without regenerating the
build.ninja file) on files which are not statically
expected (and
explicitly mentioned) in that
build.ninja
and I have such a use case in my
bismon program; it
generates plugins (I call them modules) at runtime, and runs a build
command for them.
a generated plugin has a source file name (such as
modules/modbm_9oXtCgAbkqv_4y1xhhF5Nhz.c
in bismon) which cannot be statically predicted. So the build system
don't know statically that module name when it is built (it only
knows that the collection of modules is the set of
modules/modbm_*.c
files). I solved that in bismon by using
ninja to build
the main program which would use
make to build modules or
plugins (and this solution is not elegant).
Notice that Ninja is presented as generating the
build.ninja
at configure time (that would be the equivalent of running
configure
scripts in GNU projects using autoconf + make technology) which is
expected to be slow and is run rarely and later running
ninja
which should run quickly (and would be very often used). With that
dichotomy in mind I would still expect Ninja to offer optionally
more dynamic aspects. My lua scripting proposal (in the previous
emails) deals with that (and probably would still keep ninja fast,
with the philosophy "don't pay for dynamic features you don't use").
I also noticed that lua scripting was mentioned previously on that
list, e.g. in
https://groups.google.com/d/msg/ninja-build/gs2eMFdEnKc/wHIlzv-pAQAJ
Regards.
--
Basile STARYNKEVITCH == http://starynkevitch.net/Basile
opinions are mine only - les opinions sont seulement miennes
Bourg La Reine, France