aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-02 19:01:48 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-02 19:01:48 +0200
commit56f6228c42f05ca9079b0c62a32a45bf7d46f9c9 (patch)
tree8f5b79762c8c385ecceceb7bcd3c5992584e5917 /src
parente1383a2b110a43810f20d1d0b53569a1565f807b (diff)
downloadghdl-56f6228c42f05ca9079b0c62a32a45bf7d46f9c9.tar.gz
ghdl-56f6228c42f05ca9079b0c62a32a45bf7d46f9c9.tar.bz2
ghdl-56f6228c42f05ca9079b0c62a32a45bf7d46f9c9.zip
libghdlsynth: do not depend on ghdlsimul.
Diffstat (limited to 'src')
-rw-r--r--src/synth/libghdlsynth.adb13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/synth/libghdlsynth.adb b/src/synth/libghdlsynth.adb
index 3402cb0e1..37f5a8e30 100644
--- a/src/synth/libghdlsynth.adb
+++ b/src/synth/libghdlsynth.adb
@@ -18,9 +18,10 @@
-- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
-- MA 02110-1301, USA.
-with Ghdlsynth;
-with Ghdlsimul;
with GNAT.OS_Lib; use GNAT.OS_Lib;
+
+with Ghdlsynth;
+with Options; use Options;
with Errorout.Console;
package body Libghdlsynth is
@@ -29,6 +30,7 @@ package body Libghdlsynth is
Args : Argument_List (1 .. Argc);
Res : Module;
begin
+ -- Create arguments list.
for I in 0 .. Argc - 1 loop
declare
Arg : constant Ghdl_C_String := Argv (I);
@@ -36,14 +38,19 @@ package body Libghdlsynth is
Args (I + 1) := new String'(Arg (1 .. strlen (Arg)));
end;
end loop;
+
+ -- Do the real work!
Res := Ghdlsynth.Ghdl_Synth (Args);
return Res;
+ exception
+ when Option_Error =>
+ return No_Module;
end Synth;
Gnat_Version : constant String := "unknown compiler version" & ASCII.NUL;
pragma Export (C, Gnat_Version, "__gnat_version");
begin
+ Options.Initialize;
Errorout.Console.Install_Handler;
- Ghdlsimul.Compile_Init;
end Libghdlsynth;