aboutsummaryrefslogtreecommitdiffstats
path: root/src/ghdldrv/ghdlsynth.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/ghdldrv/ghdlsynth.adb')
-rw-r--r--src/ghdldrv/ghdlsynth.adb14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb
index 041b00528..448a248be 100644
--- a/src/ghdldrv/ghdlsynth.adb
+++ b/src/ghdldrv/ghdlsynth.adb
@@ -147,6 +147,7 @@ package body Ghdlsynth is
Flags.Flag_Elaborate_With_Outdated := E_Opt >= Args'First;
Flags.Flag_Only_Elab_Warnings := True;
+ -- Load content only if there are no files.
Libraries.Load_Work_Library (E_Opt >= Args'First);
-- Do not canon concurrent statements.
@@ -154,7 +155,18 @@ package body Ghdlsynth is
-- Analyze files (if any)
for I in Args'First .. E_Opt - 1 loop
- Design_File := Ghdlcomp.Compile_Analyze_File2 (Args (I).all);
+ declare
+ Arg : String renames Args (I).all;
+ pragma Assert (Arg'First = 1);
+ begin
+ if Arg'Last > 7 and then Arg (1 .. 7) = "--work=" then
+ if not Libraries.Decode_Work_Option (Arg, True, False) then
+ return Null_Iir;
+ end if;
+ else
+ Design_File := Ghdlcomp.Compile_Analyze_File2 (Arg);
+ end if;
+ end;
end loop;
pragma Unreferenced (Design_File);