Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support: allow override of ADAFLAGS, LDFLAGS, library soversion #585

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions langkit/support/langkit_support.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ library project Langkit_Support is
Library_Standalone : Library_Standalone_Type := external
("LANGKIT_SUPPORT_STANDALONE", external ("STANDALONE", "standard"));

SO_Name := External ("LANGKIT_SUPPORT_SONAME", "");
Ada_Flags := External_As_List ("ADAFLAGS", " ");
Ld_Flags := External_As_List ("LDFLAGS", " ");

for Languages use ("Ada");
for Source_Dirs use (".");
for Object_Dir use "obj/" & Build_Mode;
Expand Down Expand Up @@ -82,6 +86,19 @@ library project Langkit_Support is
for Library_Kind use Library_Kind_Param;
for Library_Dir use "lib/" & Library_Kind_Param & "/" & Build_Mode;

case Library_Kind_Param is
when "relocatable" =>
case SO_Name is
when "" =>
null;
when others =>
for Library_Version use SO_Name;
end case;
for Leading_Library_Options use Ld_Flags;
when "static" | "static-pic" =>
null;
end case;

Common_Ada_Cargs := ("-gnatwa", "-gnatyg", "-fPIC");

package Compiler is
Expand All @@ -102,6 +119,7 @@ library project Langkit_Support is
for Default_Switches ("Ada") use
("-Og", "-ggdb", "-g3", "-fno-omit-frame-pointer");
end case;
for Default_Switches ("Ada") use Default_Switches ("Ada") & Adaflags;
end Compiler;

end Langkit_Support;