diff options
-rw-r--r-- | src/ghdldrv/ghdldrv.adb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ghdldrv/ghdldrv.adb b/src/ghdldrv/ghdldrv.adb index 3aacf728f..3442ba157 100644 --- a/src/ghdldrv/ghdldrv.adb +++ b/src/ghdldrv/ghdldrv.adb @@ -624,7 +624,13 @@ package body Ghdldrv is Add_Argument (Compiler_Args, new String'("--mb-comments")); Res := Option_Ok; elsif Options.Parse_Option (Opt) then - Add_Argument (Compiler_Args, new String'(Opt)); + if Opt'Length > 2 and then Opt (1 .. 2) = "-P" then + -- Discard -Pxxx switches, as they are already added to + -- compiler_args. + null; + else + Add_Argument (Compiler_Args, new String'(Opt)); + end if; Res := Option_Ok; elsif Opt'Length >= 2 and then (Opt (2) = 'O' or Opt (2) = 'f') |