1

I have a project.gpr used by 5 projects containing this :

MyProject_Source_Dirs := 
{
  external ("HOME") & "/project2/src/**",
  external ("HOME") & "/project3/src/**",
  "./src/**",
  "./stub/**"
}
for Source_Dirs use MyProject_Source_Dirs;

When I build my project I have following error :

"./stub" is not a valid directory

This gpr file is used for 5 different projects. 2 of theses projects have no directory named "stub". Is there a way to check if directory exists ?

Simon Wright
  • 25,108
  • 2
  • 35
  • 62
A.Pissicat
  • 3,023
  • 4
  • 38
  • 93
  • 1
    You might try [_Setting the --create-missing-dirs option in a gprbuild file_](https://stackoverflow.com/q/46520424/230513). – trashgod May 04 '22 at 17:55
  • I've try but my company has an old GPR, this option is not recognised. – A.Pissicat May 05 '22 at 12:07
  • 1
    Please [edit] your question to reflect the version requirement and any relevant context, e.g. a build script that might be able to handle the problem. – trashgod May 09 '22 at 14:51
  • I have never seen this syntax before `MyProject_Source_Dirs := { ... }` for GPR files. The closest thing to this is inside the GNAT docs, in the section describing the GPR file syntax principles `name ::= simple_name { . simple_name }` – LoneWanderer May 12 '22 at 22:56
  • @trashgod I've on the latest version of GNAT Pro/GNAT Studio and I have `for Create_Missing_Dirs use "True";` at the top of my gpr file, but I still have the same issue as the OP. Do you have any other ideas? – Dan Feb 21 '23 at 09:17
  • You might experiment with this [example](https://github.com/trashgod/roots). – trashgod Feb 21 '23 at 12:15

0 Answers0