Hi
I read through the libide documentation. It seems that the parts dealing
with build system and their integration is a bit light at the moment. I
figured to write a few words about requirements and such to make the design
work a bit easier (or harder if the requirements I mention have not yet
been thought of).
Given what Builder aims to do, it absolutely needs to support two different
build system setups:
- Autotools (obviously)
- a custom build step (lots of people build with plain Make and the like)
It might also make sense to support CMake (or at least not make it
needlessly hard) because it is very popular. In addition you might want to
support some lesser used systems that provide better performance or ease of
use (such as Meson).
There are at least two integration points that matter for end-user
usability: automatic detection of compiler flags (needed for syntax
highlighting etc) and operational changes (e.g. add a source file to a
target and the IDE automatically updates the build definition files.
Starting from the bottom, a custom build step obviously can not be
automatically updated as the definition syntax can be anything. Command
flags are also hard to discover and the only (semi-)reliable way is to
parse the build command's output and detect compilation commands. If your
custom backend chooses to hide compilation commands, there is very little
to be done.
A workaround for this is to have an entry box where you can specify build
flags. This is what Eclipse does and it works relatively ok, but is a pain
to set up every time.
The only reliable way to get per-file build flags is to have a build system
that exports them in a parseable format. As far as I know, the only ones
that do this are the ones that use Ninja as their backend, as it has a tool
specifically for this.
Supporting automatically changing the build definition files when a new
file is added is not too hard if you do not allow people to hand-edit their
Autotools files and absolute hell on earth if you do ;-). Meson aims to
provide these kinds of operations as command line utilities ("mesonedit
--add-file foobar.c --target mytarget" or somesuch) but this is not
supported yet and I don't think any other build system supports this
functionality.
That's about what I had in mind. This was more of a brain dump than any
sort of real design thing, hopefully at least some of it is useful. I guess
the only practical suggestion I have would be to start by first
implementing the custom build step (because you can use any build system
with it) and then go to Autotools while keeping the API such that you can
easily add more systems as needed.
Thanks,
_______________________________________________
Builder-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/builder-list