Because dependent files must be accessed, you must follow the GNAT semantic restrictions on file structuring to operate in this mode:
The output consists of error messages as appropriate. No object file is
ALI file is generated for use in the context of
cross-reference tools, but this file is marked as not being suitable
for binding (since no object file is generated).
The checking corresponds exactly to the notion of
legality in the Ada Reference Manual.
Any unit can be compiled in semantics-checking-only mode, including units that would not normally be compiled (subunits, and specifications where a separate body is present).