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

It is useful to have a separate directory for storing object files. However, it gprbuildwill complain if the directory does not exist yet. I use hgversion control, which does not allow you to track empty directories (AFAIK this also applies git), but even if that were the case, it would be useless to clutter up the repository with an empty directory. gprbuildhas an option --create-missing-dirs(short form -p) that does exactly what it says on tin. This is extremely helpful. However, I would like to know if there is a way to set this in a file .gpr. It is disgusting to remind my users to compile with a parameter -pinstead of just starting it gprbuild project. Unfortunately, the docs for gprguildhave the following:

By default, GPRbuild checks to see if the project files, libraries, and exec specified in the project files exist. The switch -pinstructs GPRbuild to try to create the missing directories. Please note that these switches can be specified in the Builder package of the main project, but they are useless there, because either directories already exist or the processing of the project files failed before evaluating the Builder switches, because there is at least one missing directory.

Is there really a way to do what I am describing?

+4
source share
2 answers

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

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

The 2017 GNAT GPL has this.

+5
source

, , , git/hg . * , .

hg, .hgignore ( ), .keep ( ) , .hgignore, .

git .gitignore , . .gitignore . (: )

  • , , .,
-1
source

Source: https://habr.com/ru/post/1686742/


All Articles