codetools: always pass the -T and -P option to the compiler to get the macro values

git-svn-id: trunk@31158 -
This commit is contained in:
mattias 2011-06-10 15:58:03 +00:00
parent dcbf3f1a58
commit 68d8948e3c

View File

@ -7576,14 +7576,23 @@ end;
function TFPCTargetConfigCache.GetFPCInfoCmdLineOptions(ExtraOptions: string function TFPCTargetConfigCache.GetFPCInfoCmdLineOptions(ExtraOptions: string
): string; ): string;
var
CurTargetCPU: String;
CurTargetOS: String;
begin begin
Result:=CompilerOptions; Result:=CompilerOptions;
if TargetCPU<>'' then // Note: always pass the -P and -T options so that the compiler writes the
Result:=Result+' -P'+LowerCase(TargetCPU); // target macros with -va
if TargetOS<>'' then CurTargetCPU:=TargetCPU;
Result:=Result+' -T'+LowerCase(TargetOS); 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; Result:=Result+' '+ExtraOptions;
Result:=Trim(ExtraOptions); Result:=Trim(Result);
end; end;
procedure TFPCTargetConfigCache.IncreaseChangeStamp; procedure TFPCTargetConfigCache.IncreaseChangeStamp;