mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-18 20:19:31 +02:00
IDE: when no TargetOS or TargetCPU is empty, use default of compiler instead of IDE
git-svn-id: branches/fixes_1_4@48290 -
This commit is contained in:
parent
cc0a3054d5
commit
be48e0892a
@ -59,7 +59,7 @@ type
|
|||||||
function GetLCLWidgetType: string; virtual; abstract;
|
function GetLCLWidgetType: string; virtual; abstract;
|
||||||
function GetRunCommandLine: string; virtual; abstract;
|
function GetRunCommandLine: string; virtual; abstract;
|
||||||
|
|
||||||
function GetFPCompilerFilename: string; virtual; abstract;
|
function GetFPCompilerFilename(ApplyProjectMacros: boolean = true): string; virtual; abstract;
|
||||||
function GetFPCFrontEndOptions: string; virtual; abstract;
|
function GetFPCFrontEndOptions: string; virtual; abstract;
|
||||||
function GetProjectPublishDir: string; virtual; abstract;
|
function GetProjectPublishDir: string; virtual; abstract;
|
||||||
function GetProjectTargetFilename(aProject: TProject): string; virtual; abstract;
|
function GetProjectTargetFilename(aProject: TProject): string; virtual; abstract;
|
||||||
|
@ -597,8 +597,8 @@ begin
|
|||||||
fTargetOS:=fProfile.FPCTargetOS;
|
fTargetOS:=fProfile.FPCTargetOS;
|
||||||
fTargetCPU:=fProfile.FPCTargetCPU;
|
fTargetCPU:=fProfile.FPCTargetCPU;
|
||||||
TargetLCLPlatform:=LCLPlatformDirNames[fProfile.TargetPlatform];
|
TargetLCLPlatform:=LCLPlatformDirNames[fProfile.TargetPlatform];
|
||||||
if fTargetOS='' then fTargetOS:=GetCompiledTargetOS;
|
if fTargetOS='' then fTargetOS:=fCompilerTargetOS;
|
||||||
if fTargetCPU='' then fTargetCPU:=GetCompiledTargetCPU;
|
if fTargetCPU='' then fTargetCPU:=fCompilerTargetCPU;
|
||||||
LazDir:=EnvironmentOptions.GetParsedLazarusDirectory;
|
LazDir:=EnvironmentOptions.GetParsedLazarusDirectory;
|
||||||
|
|
||||||
if fTargetOS<>fCompilerTargetOS then
|
if fTargetOS<>fCompilerTargetOS then
|
||||||
|
@ -182,7 +182,7 @@ type
|
|||||||
function GetLCLWidgetType: string; override;
|
function GetLCLWidgetType: string; override;
|
||||||
function GetRunCommandLine: string; override;
|
function GetRunCommandLine: string; override;
|
||||||
|
|
||||||
function GetFPCompilerFilename: string; override;
|
function GetFPCompilerFilename(ApplyProjectMacros: boolean = true): string; override;
|
||||||
function GetFPCFrontEndOptions: string; override;
|
function GetFPCFrontEndOptions: string; override;
|
||||||
function GetProjectPublishDir: string; override;
|
function GetProjectPublishDir: string; override;
|
||||||
function GetProjectTargetFilename(aProject: TProject): string; override;
|
function GetProjectTargetFilename(aProject: TProject): string; override;
|
||||||
@ -606,7 +606,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildManager.GetFPCompilerFilename: string;
|
function TBuildManager.GetFPCompilerFilename(ApplyProjectMacros: boolean
|
||||||
|
): string;
|
||||||
var
|
var
|
||||||
s: string;
|
s: string;
|
||||||
Opts: TProjectCompilerOptions;
|
Opts: TProjectCompilerOptions;
|
||||||
@ -617,9 +618,15 @@ begin
|
|||||||
Opts:=FBuildTarget.CompilerOptions;
|
Opts:=FBuildTarget.CompilerOptions;
|
||||||
if ([crCompile,crBuild]*Opts.CompileReasons<>[])
|
if ([crCompile,crBuild]*Opts.CompileReasons<>[])
|
||||||
and (Opts.CompilerPath<>'')
|
and (Opts.CompilerPath<>'')
|
||||||
and (not Opts.ParsedOpts.Values[pcosCompilerPath].Parsing)
|
|
||||||
then begin
|
then begin
|
||||||
Result:=FBuildTarget.GetCompilerFilename;
|
if ApplyProjectMacros then
|
||||||
|
begin
|
||||||
|
if (not Opts.ParsedOpts.Values[pcosCompilerPath].Parsing) then
|
||||||
|
Result:=FBuildTarget.GetCompilerFilename;
|
||||||
|
end else begin
|
||||||
|
Result:=Opts.CompilerPath;
|
||||||
|
if not IDEMacros.SubstituteMacros(Result) then Result:='';
|
||||||
|
end;
|
||||||
//debugln(['TBuildManager.GetFPCompilerFilename project compiler="',Result,'"']);
|
//debugln(['TBuildManager.GetFPCompilerFilename project compiler="',Result,'"']);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2369,7 +2376,7 @@ function TBuildManager.OnGetBuildMacroValues(Options: TBaseCompilerOptions;
|
|||||||
if FBuildTarget<>nil then
|
if FBuildTarget<>nil then
|
||||||
s:=FBuildTarget.CompilerOptions.TargetOS;
|
s:=FBuildTarget.CompilerOptions.TargetOS;
|
||||||
if s='' then
|
if s='' then
|
||||||
s:=GetCompiledTargetOS;
|
s:=fTargetOS;
|
||||||
Values.Values['TargetOS']:=s;
|
Values.Values['TargetOS']:=s;
|
||||||
end;
|
end;
|
||||||
// SrcOS
|
// SrcOS
|
||||||
@ -2388,7 +2395,7 @@ function TBuildManager.OnGetBuildMacroValues(Options: TBaseCompilerOptions;
|
|||||||
if FBuildTarget<>nil then
|
if FBuildTarget<>nil then
|
||||||
s:=FBuildTarget.CompilerOptions.TargetCPU;
|
s:=FBuildTarget.CompilerOptions.TargetCPU;
|
||||||
if s='' then
|
if s='' then
|
||||||
s:=GetCompiledTargetCPU;
|
s:=fTargetCPU;
|
||||||
Values.Values['TargetCPU']:=s;
|
Values.Values['TargetCPU']:=s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2592,6 +2599,9 @@ var
|
|||||||
OldLCLWidgetType: String;
|
OldLCLWidgetType: String;
|
||||||
FPCTargetChanged: Boolean;
|
FPCTargetChanged: Boolean;
|
||||||
LCLTargetChanged: Boolean;
|
LCLTargetChanged: Boolean;
|
||||||
|
CompilerTargetOS: string;
|
||||||
|
CompilerTargetCPU: string;
|
||||||
|
CompQueryOptions: String;
|
||||||
begin
|
begin
|
||||||
//debugln(['TBuildManager.SetBuildTarget TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" LCLWidgetType="',LCLWidgetType,'"']);
|
//debugln(['TBuildManager.SetBuildTarget TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" LCLWidgetType="',LCLWidgetType,'"']);
|
||||||
OldTargetOS:=fTargetOS;
|
OldTargetOS:=fTargetOS;
|
||||||
@ -2601,6 +2611,9 @@ begin
|
|||||||
OverrideTargetCPU:=GetFPCTargetCPU(TargetCPU);
|
OverrideTargetCPU:=GetFPCTargetCPU(TargetCPU);
|
||||||
OverrideLCLWidgetType:=lowercase(LCLWidgetType);
|
OverrideLCLWidgetType:=lowercase(LCLWidgetType);
|
||||||
|
|
||||||
|
CodeToolBoss.FPCDefinesCache.ConfigCaches.GetDefaultCompilerTarget(
|
||||||
|
EnvironmentOptions.GetParsedCompilerFilename,'',CompilerTargetOS,CompilerTargetCPU);
|
||||||
|
|
||||||
// compute new TargetOS
|
// compute new TargetOS
|
||||||
if OverrideTargetOS<>'' then
|
if OverrideTargetOS<>'' then
|
||||||
fTargetOS:=OverrideTargetOS
|
fTargetOS:=OverrideTargetOS
|
||||||
@ -2608,9 +2621,8 @@ begin
|
|||||||
fTargetOS:=TProject(FBuildTarget).CompilerOptions.TargetOS
|
fTargetOS:=TProject(FBuildTarget).CompilerOptions.TargetOS
|
||||||
else
|
else
|
||||||
fTargetOS:='';
|
fTargetOS:='';
|
||||||
if (fTargetOS='') or (SysUtils.CompareText(fTargetOS,'default')=0) then
|
if SysUtils.CompareText(fTargetOS,'default')=0 then
|
||||||
fTargetOS:=GetCompiledTargetOS;
|
fTargetOS:='';
|
||||||
fTargetOS:=GetFPCTargetOS(fTargetOS);
|
|
||||||
|
|
||||||
// compute new TargetCPU
|
// compute new TargetCPU
|
||||||
if OverrideTargetCPU<>'' then
|
if OverrideTargetCPU<>'' then
|
||||||
@ -2619,8 +2631,32 @@ begin
|
|||||||
fTargetCPU:=TProject(FBuildTarget).CompilerOptions.TargetCPU
|
fTargetCPU:=TProject(FBuildTarget).CompilerOptions.TargetCPU
|
||||||
else
|
else
|
||||||
fTargetCPU:='';
|
fTargetCPU:='';
|
||||||
if (fTargetCPU='') or (SysUtils.CompareText(fTargetCPU,'default')=0) then
|
if SysUtils.CompareText(fTargetCPU,'default')=0 then
|
||||||
fTargetCPU:=GetCompiledTargetCPU;
|
fTargetCPU:='';
|
||||||
|
|
||||||
|
if (fTargetOS='') or (fTargetCPU='') then
|
||||||
|
begin
|
||||||
|
// use compiler default target
|
||||||
|
CompQueryOptions:='';
|
||||||
|
if fTargetCPU<>'' then
|
||||||
|
CompQueryOptions:='-P'+GetFPCTargetCPU(fTargetCPU)
|
||||||
|
else if fTargetOS<>'' then
|
||||||
|
CompQueryOptions:='-T'+GetFPCTargetOS(fTargetOS);
|
||||||
|
CodeToolBoss.FPCDefinesCache.ConfigCaches.GetDefaultCompilerTarget(
|
||||||
|
GetFPCompilerFilename(false),CompQueryOptions,CompilerTargetOS,CompilerTargetCPU);
|
||||||
|
if ConsoleVerbosity>0 then
|
||||||
|
debugln(['TBuildManager.SetBuildTarget OS=',fTargetOS,' CPU=',fTargetCPU,' CompQueryOptions=',CompQueryOptions,' DefaultOS=',CompilerTargetOS,' DefaultCPU=',CompilerTargetCPU]);
|
||||||
|
if fTargetOS='' then
|
||||||
|
fTargetOS:=CompilerTargetOS;
|
||||||
|
if fTargetOS='' then
|
||||||
|
fTargetOS:=GetCompiledTargetOS;
|
||||||
|
if fTargetCPU='' then
|
||||||
|
fTargetCPU:=CompilerTargetCPU;
|
||||||
|
if fTargetCPU='' then
|
||||||
|
fTargetCPU:=GetCompiledTargetCPU;
|
||||||
|
end;
|
||||||
|
|
||||||
|
fTargetOS:=GetFPCTargetOS(fTargetOS);
|
||||||
fTargetCPU:=GetFPCTargetCPU(fTargetCPU);
|
fTargetCPU:=GetFPCTargetCPU(fTargetCPU);
|
||||||
|
|
||||||
FPCTargetChanged:=(OldTargetOS<>fTargetOS)
|
FPCTargetChanged:=(OldTargetOS<>fTargetOS)
|
||||||
|
Loading…
Reference in New Issue
Block a user