aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2024-10-16 15:49:57 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-11-12 14:00:46 +0100
commit0b58c0ec6e9686e9645e269e020e77efbe30ab79 (patch)
tree832889fb4d07d4b938ce32836d7d71d07480f300 /gcc
parentb30440436fcae4fd0b7237a7ade312b5e7165f5c (diff)
downloadgcc-0b58c0ec6e9686e9645e269e020e77efbe30ab79.zip
gcc-0b58c0ec6e9686e9645e269e020e77efbe30ab79.tar.gz
gcc-0b58c0ec6e9686e9645e269e020e77efbe30ab79.tar.bz2
ada: Add Ada coverage instrumentation support
gcc/ada/ChangeLog: * gnat2.gpr: New file.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/gnat2.gpr54
1 files changed, 54 insertions, 0 deletions
diff --git a/gcc/ada/gnat2.gpr b/gcc/ada/gnat2.gpr
new file mode 100644
index 0000000..df64846
--- /dev/null
+++ b/gcc/ada/gnat2.gpr
@@ -0,0 +1,54 @@
+-- The "2" in Gnat2 is arbitrary and is there because "gnat.gpr" already
+-- exists in the repository.
+project Gnat2 is
+
+ -- We need C++ as a language to force the use of g++ for linking. That
+ -- causes GPRbuild to emit a warning because we don't have C++ source
+ -- files, but it should be fine.
+ for Languages use ("Ada", "C++");
+
+ for Main use ("gnat1drv.adb",
+ "gnatbind.adb",
+ "gnatmake.adb",
+ "gnatlink.adb",
+ "gnatcmd.adb",
+ "gnatchop.adb",
+ "gnatkr.adb",
+ "gnatls.adb",
+ "gnatprep.adb",
+ "gnatname.adb",
+ "gnatclean.adb");
+
+ Build_Dir := external ("Build_Dir");
+
+ Generated_Dir := Build_Dir & "/generated";
+
+ for Source_Dirs use (".", Build_Dir, Generated_Dir);
+
+ for Excluded_Source_Files use
+ ("indepsw-aix.adb",
+ "indepsw-darwin.adb",
+ "ada_get_targ.adb",
+ "indepsw-gnu.adb",
+ "seinfo_tables.ads",
+ "seinfo_tables.adb");
+
+ for Object_Dir use Build_Dir;
+
+ for Exec_Dir use Build_dir & "/..";
+
+ package Builder is
+ for Executable ("gnat1drv.adb") use "gnat1";
+
+ for Executable ("gnatcmd.adb") use "gnat";
+
+ end Builder;
+
+ package Coverage is
+ -- To make building from the oldest supported compiler work, we copy a handful
+ -- of fresh source files from the run-time library. We need gnatcov to not instrument
+ -- those files, so we add the clause below. It's unknown why only putting "GNAT" is sufficient???
+ -- We also pull in GNAT.Lists for example, but specifying it here triggers a warning.
+ for Excluded_Units use ("Gnat");
+ end Coverage;
+end Gnat2;