Re: [anjuta-devel] Clang and the include files



Hi Eran, hi Moritz!

For example the Anjuta project itself. I need the path to the include
folder for glib (/usr/include/glib-2.0 and /lib/glib-2.0/include), so
clang
can parse the code correct.


The best and most reliable way is it to "record" the build output and
parse
the build process output lines (simple parsing, extracting -L / -I / -D
switches)
This requires user to run at full build at least once and later the IDE
can
make use of the parsed output (cache it somewhere).

FYI: codelite & vim are both using this approach to handle makefile
based
projects (vim is actually using a wrapper script around gcc to record
the
build output)

In addition, you should also provide a way for user to manually add
search
paths / macros to the clang code completion.

Luckily we won't have to fall back to the parsing approach for most of our
libraries (actually all that are correctly included in the project with
pkg-config).

http://git.gnome.org/browse/anjuta/tree/libanjuta/anjuta-pkg-config.h:

anjuta_package_config_get_directories() is your friend here together with
receiving the need packages from the project manager. You can have a look
at cpp-packages
(http://git.gnome.org/browse/anjuta/tree/plugins/language-support-cpp-java/cpp-packages.c)
which shows an example on how to use that API. But that should be rather
straightforward.

The only problem here could be some standard include paths which we might
want to add as default.

Regards,
Johannes



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]