aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/libghdlsynth.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-04 18:20:41 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-04 18:20:41 +0200
commit490a0195485d547f1ac07e2d7fbb15eed6dbfc68 (patch)
treed52c1b86f11f2aaa591dc73639497a6b8bdd3dc2 /src/synth/libghdlsynth.adb
parent688173587e76ee89b67b0c0aeb93385c0db08b22 (diff)
downloadghdl-490a0195485d547f1ac07e2d7fbb15eed6dbfc68.tar.gz
ghdl-490a0195485d547f1ac07e2d7fbb15eed6dbfc68.tar.bz2
ghdl-490a0195485d547f1ac07e2d7fbb15eed6dbfc68.zip
libghdlsynth: decode options.
Diffstat (limited to 'src/synth/libghdlsynth.adb')
-rw-r--r--src/synth/libghdlsynth.adb9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/synth/libghdlsynth.adb b/src/synth/libghdlsynth.adb
index 37f5a8e30..d9d844de1 100644
--- a/src/synth/libghdlsynth.adb
+++ b/src/synth/libghdlsynth.adb
@@ -20,6 +20,7 @@
with GNAT.OS_Lib; use GNAT.OS_Lib;
+with Ghdlmain; use Ghdlmain;
with Ghdlsynth;
with Options; use Options;
with Errorout.Console;
@@ -29,6 +30,8 @@ package body Libghdlsynth is
is
Args : Argument_List (1 .. Argc);
Res : Module;
+ Cmd : Command_Acc;
+ First_Arg : Natural;
begin
-- Create arguments list.
for I in 0 .. Argc - 1 loop
@@ -39,8 +42,11 @@ package body Libghdlsynth is
end;
end loop;
+ -- Find the command. This is a little bit convoluted...
+ Decode_Command_Options ("--synth", Cmd, Args, First_Arg);
+
-- Do the real work!
- Res := Ghdlsynth.Ghdl_Synth (Args);
+ Res := Ghdlsynth.Ghdl_Synth (Args (First_Arg .. Args'Last));
return Res;
exception
@@ -51,6 +57,7 @@ package body Libghdlsynth is
Gnat_Version : constant String := "unknown compiler version" & ASCII.NUL;
pragma Export (C, Gnat_Version, "__gnat_version");
begin
+ Ghdlsynth.Register_Commands;
Options.Initialize;
Errorout.Console.Install_Handler;
end Libghdlsynth;