Files
gnatstudio/shared.gpr.in
Nicolas Setton 513438ffd6 Call the build mode "Coverage" rather than "cov"
For homogeneity with other modes.
2025-04-25 09:42:14 +00:00

138 lines
4.0 KiB
Plaintext

with "gnatcoll";
project Shared is
type OS_Type is ("unix", "osx", "Windows_NT");
OS : OS_Type := External ("OS", "unix");
type Build_Type is ("Debug", "Production", "AddressSanitizer", "Coverage");
Build : Build_Type := External ("BUILD", "Debug");
type Boolean_Type is ("true", "false");
Enable_LTO : Boolean_Type := "false";
-- Whether to enable link-time-optimization, and removal of
-- unused subprograms
Enable_Gperftools : Boolean_Type := "false";
-- Whether to enable profilling
-- gperftools sould be installed
Global_Objects_Root := External("GPS_OBJECTS_ROOT", "");
for Source_Dirs use ();
for Object_Dir use Global_Objects_Root & "obj";
for Library_Dir use "lib";
package Documentation is
for Documentation_Dir use Project'Object_Dir & "/html";
end Documentation;
package Compiler is
for Driver ("Python") use "";
Common := ("-g", "-gnatX");
Optimize := ();
case OS is
when "osx" | "Windows_NT" => null;
when "unix" =>
case Enable_LTO is
when "true" =>
Optimize := ("-fdata-sections", "-ffunction-sections",
"-flto");
when "false" =>
null;
end case;
end case;
case Build is
when "Debug" | "Coverage" =>
for Switches ("Ada") use Common &
("-O0", "-gnata", "-gnatVa", "-gnatQ", "-gnatygO",
"-gnatwaCJe", "-gnateE", "-Wtrampolines");
for Switches ("C") use ("-g", "-O1");
when "Production" =>
for Switches ("Ada") use Common & Optimize &
("-O2", "-gnatn",
"-gnatT3", -- Temporary, L403-023.
"-gnatws",
"-gnatwaCJ",
"-gnatygO",
"-Wtrampolines"
);
for Switches ("C") use Optimize & ("-g", "-O2");
when "AddressSanitizer" =>
for Switches ("Ada") use Common &
("-O0", "-gnata", "-gnatVa", "-gnatQ", "-gnatygO",
"-gnatwaCJ", "-gnateE", "-fsanitize=address");
for Switches ("C") use ("-g", "-O1", "-fsanitize=address");
end case;
end Compiler;
package Binder is
for Switches ("Ada") use ("-E", "-shared");
end Binder;
Gtk_Cflags := (@GTK_GCC_FLAGS_GPR@);
Pygobject_Include := (@PYGOBJECT_INCLUDE_GPR@);
Python_cflags := (@PYTHON_CFLAGS_GPR@);
Python_shared_libs := (@PYTHON_SHARED_LIBS_GPR@);
package Linker is
-- ??? missing hack to force libiconv first (working around
-- a faulty libiconv in macports)
for Switches ("Ada") use Python_shared_libs;
case OS is
when "osx" =>
-- This ensure that location in which GNAT Studio looks for its
-- shared libraries can be changed.
for Switches ("Ada") use Linker'Switches ("Ada")
& ("-Wl,-headerpad_max_install_names");
when others =>
null;
end case;
case Enable_LTO is
when "true" =>
case OS is
when "osx" =>
for Switches ("Ada") use Linker'Switches ("Ada")
& ("-Wl,-dead_strip");
when "unix" =>
for Switches ("Ada") use Linker'Switches ("Ada")
& ("-Wl,--gc-sections", "-Wl,--print-gc-sections");
when others =>
null;
end case;
when "false" =>
null;
end case;
case Enable_Gperftools is
when "true" =>
for Switches ("Ada") use Linker'Switches ("Ada") &
("-lprofiler");
when "false" =>
null;
end case;
case Build is
when "AddressSanitizer" =>
for Switches ("Ada") use Linker'Switches ("Ada")
& ("-fsanitize=address");
when others =>
null;
end case;
end Linker;
package IDE is
for VCS_Kind use "git";
end IDE;
end Shared;