Skip to content

Commit

Permalink
Make so many libraries as modules in the SFML library
Browse files Browse the repository at this point in the history
The problem with this approach is that the list of sources has to be
specified and that the documentation is not generated by gnatdoc, so it is
left in this experimental branch, until a solution is found.

See issue #6
  • Loading branch information
mgrojo committed Oct 16, 2020
1 parent d52a2d0 commit 2734942
Show file tree
Hide file tree
Showing 11 changed files with 357 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ all:
gprbuild -j0 -P asfml.gpr

doc:
gnatdoc -P asfml.gpr
gnatdoc -P asfml_doc.gpr
35 changes: 6 additions & 29 deletions asfml.gpr
Original file line number Diff line number Diff line change
@@ -1,40 +1,17 @@
aggregate library project ASFML is

library project ASFML is

type T_OS is ("Windows_NT", "Linux");
V_OS : T_OS := external ("OS", "Linux");

for Languages use ("Ada");

for Create_Missing_Dirs use "True";

for Source_Dirs use ("include");
for Object_Dir use "obj";
for Project_Files use
("asfml_system.gpr",
"asfml_audio.gpr",
"asfml_window.gpr",
"asfml_graphics.gpr");

for Library_Name use "asfml";

for Library_Dir use "lib";
for Library_ALI_Dir use "lib";
for Library_Kind use "static";


package Linker is
case V_OS is
when "Windows_NT" =>
for Linker_Options use
("-LD:\Libraries\CSFML-2.5\lib\gcc",
"-lcsfml-system", "-lcsfml-audio", "-lcsfml-network",
"-lcsfml-audio", "-lcsfml-graphics", "-lcsfml-window",
"-lasfml");
when others =>
for Linker_Options use
("-lcsfml-system", "-lcsfml-audio", "-lcsfml-network",
"-lcsfml-audio", "-lcsfml-graphics", "-lcsfml-window",
"-lasfml");
end case;
end Linker;


package Documentation is
for Documentation_Dir use "doc";
for Doc_Pattern use "^/ |^/< ";
Expand Down
60 changes: 60 additions & 0 deletions asfml_audio.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
with "asfml_system.gpr";

library project ASFML_Audio is

type T_OS is ("Windows_NT", "Linux");
V_OS : T_OS := external ("OS", "Linux");

for Languages use ("Ada");

for Create_Missing_Dirs use "True";

for Source_Dirs use ("include");
for Source_Files use
("sf-audio.ads",
"sf-audio-listener.ads",
"sf-audio-music.adb",
"sf-audio-music.ads",
"sf-audio-sound.ads",
"sf-audio-soundbuffer.adb",
"sf-audio-soundbuffer.ads",
"sf-audio-soundbufferrecorder.adb",
"sf-audio-soundbufferrecorder.ads",
"sf-audio-soundrecorder.adb",
"sf-audio-soundrecorder.ads",
"sf-audio-soundstatus.ads",
"sf-audio-soundstream.ads",
"sf-audio-types.ads");
for Object_Dir use "obj";

for Library_Name use "asfml-audio";

for Library_Dir use "lib/audio";
for Library_ALI_Dir use "lib/audio";
for Library_Kind use "static";


package Linker is
case V_OS is
when "Windows_NT" =>
for Linker_Options use
("-LD:\Libraries\CSFML-2.5\lib\gcc",
"-lcsfml-audio",
"-lasfml-audio");
when others =>
for Linker_Options use
("-lcsfml-audio",
"-lasfml-audio");
end case;
end Linker;


package Documentation is
for Documentation_Dir use "doc";
for Doc_Pattern use "^/ |^/< ";
-- This considers comments beginning with "--/ " to be documentation
for Custom_Tags_Definition use "tools/sfml-doc-tags.py";
-- GNATdoc loads provided file on startup to process custom tags
end Documentation;

end ASFML_Audio;
27 changes: 27 additions & 0 deletions asfml_doc.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- This project is only for generating documentation, not for building.
-- When using gnatdoc (Ubuntu 18.04) with asfml.gpr there are errors.

library project ASFML_doc is

for Languages use ("Ada");

for Create_Missing_Dirs use "True";

for Source_Dirs use ("include");
for Object_Dir use "obj";

for Library_Name use "asfml";

for Library_Dir use "lib";
for Library_ALI_Dir use "lib";
for Library_Kind use "static";

package Documentation is
for Documentation_Dir use "doc";
for Doc_Pattern use "^/ |^/< ";
-- This considers comments beginning with "--/ " to be documentation
for Custom_Tags_Definition use "tools/sfml-doc-tags.py";
-- GNATdoc loads provided file on startup to process custom tags
end Documentation;

end ASFML_doc;
79 changes: 79 additions & 0 deletions asfml_graphics.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
with "asfml_system.gpr";
with "asfml_window.gpr";

library project ASFML_Graphics is

type T_OS is ("Windows_NT", "Linux");
V_OS : T_OS := external ("OS", "Linux");

for Languages use ("Ada");

for Create_Missing_Dirs use "True";

for Source_Dirs use ("include");
for Source_Files use
("sf-graphics.ads",
"sf-graphics-blendmode.ads",
"sf-graphics-circleshape.ads",
"sf-graphics-color.ads",
"sf-graphics-convexshape.ads",
"sf-graphics-font.adb",
"sf-graphics-font.ads",
"sf-graphics-fontinfo.ads",
"sf-graphics-glsl.ads",
"sf-graphics-glyph.ads",
"sf-graphics-image.adb",
"sf-graphics-image.ads",
"sf-graphics-primitivetype.ads",
"sf-graphics-rect.ads",
"sf-graphics-rectangleshape.ads",
"sf-graphics-renderstates.ads",
"sf-graphics-rendertexture.ads",
"sf-graphics-renderwindow.adb",
"sf-graphics-renderwindow.ads",
"sf-graphics-shader.ads",
"sf-graphics-shape.ads",
"sf-graphics-sprite.ads",
"sf-graphics-text.adb",
"sf-graphics-text.ads",
"sf-graphics-texture.adb",
"sf-graphics-texture.ads",
"sf-graphics-transformable.ads",
"sf-graphics-transform.ads",
"sf-graphics-types.ads",
"sf-graphics-vertex.ads",
"sf-graphics-vertexarray.ads",
"sf-graphics-view.ads");
for Object_Dir use "obj";

for Library_Name use "asfml-graphics";

for Library_Dir use "lib/graphics";
for Library_ALI_Dir use "lib/graphics";
for Library_Kind use "static";


package Linker is
case V_OS is
when "Windows_NT" =>
for Linker_Options use
("-LD:\Libraries\CSFML-2.5\lib\gcc",
"-lcsfml-graphics",
"-lasfml-graphics");
when others =>
for Linker_Options use
("-lcsfml-graphics",
"-lasfml-graphics");
end case;
end Linker;


package Documentation is
for Documentation_Dir use "doc";
for Doc_Pattern use "^/ |^/< ";
-- This considers comments beginning with "--/ " to be documentation
for Custom_Tags_Definition use "tools/sfml-doc-tags.py";
-- GNATdoc loads provided file on startup to process custom tags
end Documentation;

end ASFML_Graphics;
61 changes: 61 additions & 0 deletions asfml_network.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
with "asfml_system.gpr";

library project ASFML_Network is

type T_OS is ("Windows_NT", "Linux");
V_OS : T_OS := external ("OS", "Linux");

for Languages use ("Ada");

for Create_Missing_Dirs use "True";

for Source_Dirs use ("include");
for Source_Files use
("sf-network.ads",
"sf-network-ftp.adb",
"sf-network-ftp.ads",
"sf-network-http.adb",
"sf-network-http.ads",
"sf-network-ipaddress.adb",
"sf-network-ipaddress.ads",
"sf-network-packet.adb",
"sf-network-packet.ads",
"sf-network-socketselector.ads",
"sf-network-socketstatus.ads",
"sf-network-tcplistener.ads",
"sf-network-tcpsocket.ads",
"sf-network-types.ads",
"sf-network-udpsocket.ads");
for Object_Dir use "obj";

for Library_Name use "asfml-network";

for Library_Dir use "lib";
for Library_ALI_Dir use "lib";
for Library_Kind use "static";


package Linker is
case V_OS is
when "Windows_NT" =>
for Linker_Options use
("-LD:\Libraries\CSFML-2.5\lib\gcc",
"-lcsfml-network",
"-lasfml-network");
when others =>
for Linker_Options use
("-lcsfml-network",
"-lasfml-network");
end case;
end Linker;


package Documentation is
for Documentation_Dir use "doc";
for Doc_Pattern use "^/ |^/< ";
-- This considers comments beginning with "--/ " to be documentation
for Custom_Tags_Definition use "tools/sfml-doc-tags.py";
-- GNATdoc loads provided file on startup to process custom tags
end Documentation;

end ASFML_Network;
58 changes: 58 additions & 0 deletions asfml_system.gpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

library project ASFML_System is

type T_OS is ("Windows_NT", "Linux");
V_OS : T_OS := external ("OS", "Linux");

for Languages use ("Ada");

for Create_Missing_Dirs use "True";

for Source_Dirs use ("include");
for Source_Files use
("sf.ads",
"sf-config.ads",
"sf-system.ads",
"sf-system-clock.ads",
"sf-system-inputstream.ads",
"sf-system-mutex.ads",
"sf-system-sleep.adb",
"sf-system-sleep.ads",
"sf-system-thread.ads",
"sf-system-time.ads",
"sf-system-types.ads",
"sf-system-vector2.ads",
"sf-system-vector3.ads");
for Object_Dir use "obj";

for Library_Name use "asfml-system";

for Library_Dir use "lib/system";
for Library_ALI_Dir use "lib/system";
for Library_Kind use "static";


package Linker is
case V_OS is
when "Windows_NT" =>
for Linker_Options use
("-LD:\Libraries\CSFML-2.5\lib\gcc",
"-lcsfml-system",
"-lasfml-system");
when others =>
for Linker_Options use
("-lcsfml-system",
"-lasfml-system");
end case;
end Linker;


package Documentation is
for Documentation_Dir use "doc";
for Doc_Pattern use "^/ |^/< ";
-- This considers comments beginning with "--/ " to be documentation
for Custom_Tags_Definition use "tools/sfml-doc-tags.py";
-- GNATdoc loads provided file on startup to process custom tags
end Documentation;

end ASFML_System;
Loading

0 comments on commit 2734942

Please sign in to comment.