Build order with gprbuild

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…
Example:

with "code_generation.gpr";

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");
end Main;

(*) 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.

bin/B: b/src/*.ads b/src/*.adb b/b.gpr
	gprbuild -P b/b.gpr

a/src/generated.adb: bin/B
	bin/B > $@

bin/A: a/src/*.ads a/src/*.adb a/src/generated.adb a/a.gpr
	gprbuild -P a/a.gpr

(untested)

I also use Makefiles for this. Alire build actions can do some of it - the only Alire build action in Enacs Ada mode invokes a makefile.