0

The GNAT Project files (.gpr) allow to specify the suffix of source code for compilation. For example:

package Naming is
    for Spec_Suffix ("c++") use ".h";
    for Body_Suffix ("c++") use ".cc";
 end Naming;

However in some cases, like C++ you may need to support multiple suffixes when code comes from several sources (typically .cc and .cpp).

Any idea how to do this?

Jeffrey R. Carter
  • 3,033
  • 9
  • 10
maxime-esa
  • 215
  • 1
  • 9
  • 2
    If they're from several sources, use multiple project files, and specify the naming scheme in each of them – egilhh Feb 03 '22 at 20:23
  • Thank you. Right if there is no proper option, I'll do that, but that adds unnecessary complexity (sharing all compilation flags and variables between all projects will possibly imply yet another gpr). I have source code generated from different tools (with different extensions) and the purpose is to let gprbuild compile and link everything together from one project file... – maxime-esa Feb 04 '22 at 07:38

0 Answers0