When a GNAT project A depends on project B, is there a simple (*) way to make gprbuild build project B before starting the build of A?
It would be useful when project B generates Ada sources…
project Main is
for Source_Dirs use (".", "gen");
for Object_Dir use "obj";
for Create_Missing_Dirs use "True"; -- Flips by default the "-p" switch
for Main use ("main.adb");
(*) By “simple” I mean simpler than the way described here:
I never got rid of Makefiles in any project of a sensible size. Gprbuild only works for its intended use case: building libraries and executables from source files. Anything else is better done in scripts or Makefiles: checking out sources from a version control system, downloading files from the internet, generating source code or documentation, uploading files to a server or to a target board, etc.