From d14afe5e1d354b4ec77d38a7514ad06ff9db8ff0 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 2 Feb 2019 14:18:27 +0100 Subject: [PATCH] under win64 delete the default `-m64` if `-m32` is on the shebang line --- src/u_main.pas | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/u_main.pas b/src/u_main.pas index f5423a81..16c6c0f7 100644 --- a/src/u_main.pas +++ b/src/u_main.pas @@ -3118,6 +3118,16 @@ begin dmdproc.Parameters.AddStrings(fRunnablesOptions.staticSwitches); if lst.isNotNil and (lst.Count <> 0) then dmdproc.Parameters.AddStrings(lst); + {$ifdef WINDOWS} + {$ifdef CPUX86_64} + if lst.isNotNil and (lst.IndexOf('-m32') <> -1) then + begin + i := dmdproc.Parameters.IndexOf('-m64'); + if i <> -1 then + dmdproc.Parameters.Delete(i); + end; + {$endif} + {$endif} if fRunnablesOptions.detectMain then begin hasMain := fDoc.implementMain;