aboutsummaryrefslogtreecommitdiffstats
path: root/src/ghdldrv
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-06-09 21:08:55 +0200
committerTristan Gingold <tgingold@free.fr>2020-06-09 21:12:10 +0200
commit47547a132eb132778117ca5c4eb3394df0500898 (patch)
tree0a0b2fb9686978b1ba85d6c35285ae51dcdcb0e2 /src/ghdldrv
parent288764bb1dfe19c83e119d89009e1d9a47f682b7 (diff)
downloadghdl-47547a132eb132778117ca5c4eb3394df0500898.tar.gz
ghdl-47547a132eb132778117ca5c4eb3394df0500898.tar.bz2
ghdl-47547a132eb132778117ca5c4eb3394df0500898.zip
vhdl: allows --work between files for -c. Fix #1362
Diffstat (limited to 'src/ghdldrv')
-rw-r--r--src/ghdldrv/ghdlcomp.adb9
-rw-r--r--src/ghdldrv/ghdldrv.adb1
-rw-r--r--src/ghdldrv/ghdlsynth.adb7
3 files changed, 13 insertions, 4 deletions
diff --git a/src/ghdldrv/ghdlcomp.adb b/src/ghdldrv/ghdlcomp.adb
index a07fe0599..560a5ffd2 100644
--- a/src/ghdldrv/ghdlcomp.adb
+++ b/src/ghdldrv/ghdlcomp.adb
@@ -155,7 +155,7 @@ package body Ghdlcomp is
end Perform_Action;
- -- Command -c xx -r
+ -- Command -c xx -r/-e
type Command_Compile is new Command_Comp with null record;
function Decode_Command (Cmd : Command_Compile; Name : String)
return Boolean;
@@ -371,6 +371,13 @@ package body Ghdlcomp is
if Arg = "-r" or else Arg = "-e" then
Elab_Arg := I + 1;
exit;
+ elsif Arg'Last > 7 and then Arg (1 .. 7) = "--work=" then
+ Libraries.Work_Library_Name :=
+ Libraries.Decode_Work_Option (Arg);
+ if Libraries.Work_Library_Name = Null_Identifier then
+ raise Compilation_Error;
+ end if;
+ Libraries.Load_Work_Library (True);
else
Compile_Load_File (Arg);
end if;
diff --git a/src/ghdldrv/ghdldrv.adb b/src/ghdldrv/ghdldrv.adb
index 90a64dc54..bac182572 100644
--- a/src/ghdldrv/ghdldrv.adb
+++ b/src/ghdldrv/ghdldrv.adb
@@ -1420,6 +1420,7 @@ package body Ghdldrv is
end if;
end loop;
if Elab_Index < 0 then
+ -- No elaboration.
Analyze_Files (Args, True, Error);
if Error then
raise Errorout.Compilation_Error;
diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb
index 08d980581..8ca51b81e 100644
--- a/src/ghdldrv/ghdlsynth.adb
+++ b/src/ghdldrv/ghdlsynth.adb
@@ -251,13 +251,14 @@ package body Ghdlsynth is
declare
Arg : String renames Args (I).all;
pragma Assert (Arg'First = 1);
+ Id : Name_Id;
begin
if Arg'Last > 7 and then Arg (1 .. 7) = "--work=" then
- if Libraries.Decode_Work_Option (Arg) then
- Libraries.Load_Work_Library (True);
- else
+ Id := Libraries.Decode_Work_Option (Arg);
+ if Id = Null_Identifier then
return Null_Iir;
end if;
+ Libraries.Load_Work_Library (True);
else
Ghdlcomp.Compile_Load_File (Arg);
end if;