Gpr file, do not include all directory in source

There is my project.gpr file :

project Test is
    Project_Source_Dirs := ("Dir1")
      & ("src")
      & ("../../lib_all");
    for Object_Dir is "lib";
    for Main use ("Main_file.adb");
    for Languages use ("Ada");

    for Source_Dirs use Project_Source_Dirs & project'Object_Dir;
    -- [...]
end Test;

There is my "../../lib_all" folder :

|- file1.adb
|- file2.adb
|- file3.adb
|- file4.adb

I only want to use file3, how can I modify my .gpr file to not compile all other files each time ?


  • You can use Source_Files or Excluded_Source_Files settings, as described here:

    But I think, the easier way could be simply moving unneeded files to separated directory and adding that directory with its content on demand (based on variables, etc.).