[Emacs-ada-mode] gpr files

Stephen Leake stephen_leake at stephe-leake.org
Sat Dec 2 11:02:06 PST 2006


I have an initial implementation of using gpr files to get the source
and object file search paths. This is not on the web yet.

I'd like some advice on how to allow using gpr files with _no_ .adp
file.

Currently, you can do this in your .adp:

gpr_file=hello_5.gpr

This is used to set the 'gnatmake_opt' project variable, so it is used
in all project commands that use gnatmake.

It is also used to set the 'src_dir' and 'obj_dir' project variables.

I'm planning to add:

ADA_PROJECT_PATH=../Example_4/Gnat_Project;foo;bar

When the project file is parsed, this sets a project variable, not the
environment variable. Emacs will set the environment variable just
before any command that might need it is executed. That allows
switching projects easily, without rereading the project file (since
that might be slow for deep GNAT project trees).

Back to my question; how do you want to specify the GNAT project file,
when not using an Ada mode project file?

The value of 'gpr_file' defaults to 'ada-prj-default-gpr-file', so you
can set that in your .emacs. But that's not very convenient.

One option is to have menu Ada | Project | Load check the file
extension; if it is '.gpr', parse it as a gpr file; otherwise parse it
as a .adp file. Note that '.adp' is _not_ required; I use '.prj'. On
the other hand, GNAT does require '.gpr', so this is a reasonable
approach.

Other suggestions?

What do you prefer?

-- 
-- Stephe



More information about the Emacs-ada-mode mailing list