Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the --create-missing-dirs option in a gprbuild file

Tags:

ada

gnat

It's useful to have a separate directory to store object files in. However, gprbuild will complain if the directory doesn't already exist. I use hg for version control, which doesn't allow you to track empty directories (AFAIK this is true of git as well), but even if it did, it's unfortunate to have to clutter up the repository with an empty directory. gprbuild has an option, --create-missing-dirs (short form -p) which does precisely what it says on the tin. This is exceedingly useful. What I would like to know, however, is if there is some way to set this in a .gpr file. It is obnoxious to have to remind my users to compile with the -p option, instead of being able to just run gprbuild project. Unfortunately, the docs for gprguild have this to say:

By default, GPRbuild checks that the object, library and exec directories specified in project files exist. Switch -p instructs GPRbuild to attempt to create missing directories. Note that these switches may be specified in package Builder of the main project, but they are useless there as either the directories already exist or the processing of the project files has failed before the evaluation of the Builder switches, because there is at least one missing directory.

Surely there has to be a way to do what I am describing?

like image 727
junius Avatar asked Oct 02 '17 06:10

junius


1 Answers

Recent versions of gprbuild (since 19 August 2016, see Git) support the Create_Missing_Dirs attribute.

project Foo is
   for Create_Missing_Dirs use "True";
   ...

GNAT GPL 2017 has this.

like image 66
Simon Wright Avatar answered Nov 08 '22 09:11

Simon Wright