diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-15 06:41:36 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-15 06:41:36 +0200 |
commit | acf68c6a935edaf9cd3f575a5606e8fc6bd0fecb (patch) | |
tree | 9bc90b9c564e3bc20cadf8516f4854de0587ed70 /src/ghdldrv | |
parent | 2485c247d5eae5f88c37708c2346c015caf22dbc (diff) | |
download | ghdl-acf68c6a935edaf9cd3f575a5606e8fc6bd0fecb.tar.gz ghdl-acf68c6a935edaf9cd3f575a5606e8fc6bd0fecb.tar.bz2 ghdl-acf68c6a935edaf9cd3f575a5606e8fc6bd0fecb.zip |
ghdlsynth: allow --work= option in the middle of files.
Diffstat (limited to 'src/ghdldrv')
-rw-r--r-- | src/ghdldrv/ghdlsynth.adb | 14 |
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); |