diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index b5d134c666..56cca286f6 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -7137,22 +7137,14 @@ end; function TFPCTargetConfigCache.GetFPCInfoCmdLineOptions(ExtraOptions: string ): string; -var - CurTargetCPU: String; - CurTargetOS: String; begin Result:=CompilerOptions; - // Note: always pass the -P and -T options so that the compiler writes the - // target macros with -va - CurTargetCPU:=TargetCPU; - if CurTargetCPU='' then - CurTargetCPU:=GetCompiledTargetCPU; - Result:=Result+' -P'+LowerCase(CurTargetCPU); - CurTargetOS:=TargetOS; - if CurTargetOS='' then - CurTargetOS:=GetCompiledTargetOS; - Result:=Result+' -T'+LowerCase(CurTargetOS); - Result:=Result+' '+ExtraOptions; + if TargetCPU<>'' then + Result:=Result+' -P'+LowerCase(TargetCPU); + if TargetOS<>'' then + Result:=Result+' -T'+LowerCase(TargetOS); + if ExtraOptions<>'' then + Result:=Result+' '+ExtraOptions; Result:=Trim(Result); end;