From fd4fbfea4aa99b325fbb9fb4d1568dd5f15881df Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 19 Mar 2016 08:23:37 +0100 Subject: ghdldrv: avoid to pass -P options two times. --- src/ghdldrv/ghdldrv.adb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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') -- cgit v1.2.3