mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 07:59:28 +02:00
ide+codetools: added fpc subtarget to caches
This commit is contained in:
parent
52586f02ec
commit
977c3d1383
@ -153,6 +153,7 @@ type
|
|||||||
private
|
private
|
||||||
FOnModified: TNotifyEvent;
|
FOnModified: TNotifyEvent;
|
||||||
fOwner: TObject;
|
fOwner: TObject;
|
||||||
|
FSubTarget: string;
|
||||||
SetEmulatedFloatOpcodes: boolean;
|
SetEmulatedFloatOpcodes: boolean;
|
||||||
function GetDebugInfoTypeStr: String;
|
function GetDebugInfoTypeStr: String;
|
||||||
procedure SetAllowLabel(const AValue: Boolean);
|
procedure SetAllowLabel(const AValue: Boolean);
|
||||||
@ -195,6 +196,7 @@ type
|
|||||||
procedure SetSmartLinkUnit(const AValue: Boolean);
|
procedure SetSmartLinkUnit(const AValue: Boolean);
|
||||||
procedure SetStackChecks(const AValue: Boolean);
|
procedure SetStackChecks(const AValue: Boolean);
|
||||||
procedure SetStackSize(const AValue: Integer);
|
procedure SetStackSize(const AValue: Integer);
|
||||||
|
procedure SetSubTarget(AValue: string);
|
||||||
procedure SetTypedAddress(const AValue: Boolean);
|
procedure SetTypedAddress(const AValue: Boolean);
|
||||||
procedure SetStopAfterErrCount(const AValue: integer);
|
procedure SetStopAfterErrCount(const AValue: integer);
|
||||||
procedure SetStripSymbols(const AValue: Boolean);
|
procedure SetStripSymbols(const AValue: Boolean);
|
||||||
@ -416,6 +418,7 @@ type
|
|||||||
property TargetOS: string read fTargetOS write SetTargetOS;
|
property TargetOS: string read fTargetOS write SetTargetOS;
|
||||||
property TargetCPU: string read fTargetCPU write SetTargetCPU; // general type
|
property TargetCPU: string read fTargetCPU write SetTargetCPU; // general type
|
||||||
property TargetProcessor: String read fTargetProc write SetTargetProc; // specific
|
property TargetProcessor: String read fTargetProc write SetTargetProc; // specific
|
||||||
|
property SubTarget: string read FSubTarget write SetSubTarget;
|
||||||
property OptimizationLevel: Integer read fOptLevel write SetOptLevel;
|
property OptimizationLevel: Integer read fOptLevel write SetOptLevel;
|
||||||
property VariablesInRegisters: Boolean read fVarsInReg write SetVarsInReg;
|
property VariablesInRegisters: Boolean read fVarsInReg write SetVarsInReg;
|
||||||
property UncertainOptimizations: Boolean read fUncertainOpt write SetUncertainOpt;
|
property UncertainOptimizations: Boolean read fUncertainOpt write SetUncertainOpt;
|
||||||
@ -824,6 +827,13 @@ begin
|
|||||||
IncreaseChangeStamp;
|
IncreaseChangeStamp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TLazCompilerOptions.SetSubTarget(AValue: string);
|
||||||
|
begin
|
||||||
|
if FSubTarget=AValue then Exit;
|
||||||
|
FSubTarget:=AValue;
|
||||||
|
IncreaseChangeStamp;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TLazCompilerOptions.SetIncludeAssertionCode(const AValue: Boolean);
|
procedure TLazCompilerOptions.SetIncludeAssertionCode(const AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if fIncludeAssertionCode=AValue then exit;
|
if fIncludeAssertionCode=AValue then exit;
|
||||||
|
@ -1172,7 +1172,7 @@ begin
|
|||||||
CompilerDefinesCache.TestFilename:=GetTempFilename('fpctest.pas','');
|
CompilerDefinesCache.TestFilename:=GetTempFilename('fpctest.pas','');
|
||||||
|
|
||||||
UnitSetCache:=CompilerDefinesCache.FindUnitSet(Config.FPCPath,
|
UnitSetCache:=CompilerDefinesCache.FindUnitSet(Config.FPCPath,
|
||||||
Config.TargetOS,Config.TargetProcessor,Config.FPCOptions,Config.FPCSrcDir,
|
Config.TargetOS,Config.TargetProcessor,Config.SubTarget,Config.FPCOptions,Config.FPCSrcDir,
|
||||||
true);
|
true);
|
||||||
// parse compiler settings, fpc sources
|
// parse compiler settings, fpc sources
|
||||||
UnitSetCache.Init;
|
UnitSetCache.Init;
|
||||||
|
@ -94,6 +94,7 @@ type
|
|||||||
FPPUExt: string;
|
FPPUExt: string;
|
||||||
FProjectDir: string;
|
FProjectDir: string;
|
||||||
FSourceCaches: TFPCSourceCaches;
|
FSourceCaches: TFPCSourceCaches;
|
||||||
|
FSubTarget: string;
|
||||||
FTargetOS: string;
|
FTargetOS: string;
|
||||||
FTargetProcessor: string;
|
FTargetProcessor: string;
|
||||||
FTestPascalFile: string;
|
FTestPascalFile: string;
|
||||||
@ -106,6 +107,7 @@ type
|
|||||||
procedure SetModified(const AValue: boolean);
|
procedure SetModified(const AValue: boolean);
|
||||||
procedure SetPPUExt(const AValue: string);
|
procedure SetPPUExt(const AValue: string);
|
||||||
procedure SetProjectDir(const AValue: string);
|
procedure SetProjectDir(const AValue: string);
|
||||||
|
procedure SetSubTarget(AValue: string);
|
||||||
procedure SetTargetOS(const AValue: string);
|
procedure SetTargetOS(const AValue: string);
|
||||||
procedure SetTargetProcessor(const AValue: string);
|
procedure SetTargetProcessor(const AValue: string);
|
||||||
procedure SetTestPascalFile(const AValue: string);
|
procedure SetTestPascalFile(const AValue: string);
|
||||||
@ -128,6 +130,7 @@ type
|
|||||||
property FPCOptions: string read FFPCOptions write SetFPCOptions; // extra options for fpc
|
property FPCOptions: string read FFPCOptions write SetFPCOptions; // extra options for fpc
|
||||||
property TargetOS: string read FTargetOS write SetTargetOS;
|
property TargetOS: string read FTargetOS write SetTargetOS;
|
||||||
property TargetProcessor: string read FTargetProcessor write SetTargetProcessor;
|
property TargetProcessor: string read FTargetProcessor write SetTargetProcessor;
|
||||||
|
property SubTarget: string read FSubTarget write SetSubTarget;
|
||||||
property TestPascalFile: string read FTestPascalFile write SetTestPascalFile; // points to an empty unit
|
property TestPascalFile: string read FTestPascalFile write SetTestPascalFile; // points to an empty unit
|
||||||
property PPUExt: string read FPPUExt write SetPPUExt;
|
property PPUExt: string read FPPUExt write SetPPUExt;
|
||||||
property SourceCaches: TFPCSourceCaches read FSourceCaches;
|
property SourceCaches: TFPCSourceCaches read FSourceCaches;
|
||||||
@ -217,6 +220,13 @@ begin
|
|||||||
Modified:=true;
|
Modified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCodeToolsOptions.SetSubTarget(AValue: string);
|
||||||
|
begin
|
||||||
|
if FSubTarget=AValue then Exit;
|
||||||
|
FSubTarget:=AValue;
|
||||||
|
Modified:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCodeToolsOptions.SetTargetOS(const AValue: string);
|
procedure TCodeToolsOptions.SetTargetOS(const AValue: string);
|
||||||
begin
|
begin
|
||||||
if FTargetOS=AValue then exit;
|
if FTargetOS=AValue then exit;
|
||||||
@ -276,6 +286,8 @@ begin
|
|||||||
TargetOS:=GetEnvironmentVariableUTF8('FPCTARGET');
|
TargetOS:=GetEnvironmentVariableUTF8('FPCTARGET');
|
||||||
if GetEnvironmentVariableUTF8('FPCTARGETCPU')<>'' then
|
if GetEnvironmentVariableUTF8('FPCTARGETCPU')<>'' then
|
||||||
TargetProcessor:=GetEnvironmentVariableUTF8('FPCTARGETCPU');
|
TargetProcessor:=GetEnvironmentVariableUTF8('FPCTARGETCPU');
|
||||||
|
if GetEnvironmentVariableUTF8('FPCSUBTARGET')<>'' then
|
||||||
|
SubTarget:=GetEnvironmentVariableUTF8('FPCSUBTARGET');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCodeToolsOptions.FindDefaultCompilerFilename: string;
|
function TCodeToolsOptions.FindDefaultCompilerFilename: string;
|
||||||
@ -292,6 +304,7 @@ begin
|
|||||||
XMLConfig.SetDeleteValue(Path+'FPC/SrcDir/Value',FPCSrcDir,'');
|
XMLConfig.SetDeleteValue(Path+'FPC/SrcDir/Value',FPCSrcDir,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'FPC/TargetOS/Value',TargetOS,'');
|
XMLConfig.SetDeleteValue(Path+'FPC/TargetOS/Value',TargetOS,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'FPC/TargetProcessor/Value',TargetProcessor,'');
|
XMLConfig.SetDeleteValue(Path+'FPC/TargetProcessor/Value',TargetProcessor,'');
|
||||||
|
XMLConfig.SetDeleteValue(Path+'FPC/SubTarget/Value',SubTarget,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'FPC/PPUExt/Value',PPUExt,'.ppu');
|
XMLConfig.SetDeleteValue(Path+'FPC/PPUExt/Value',PPUExt,'.ppu');
|
||||||
XMLConfig.SetDeleteValue(Path+'FPC/TestPascalFile/Value',TestPascalFile,'');
|
XMLConfig.SetDeleteValue(Path+'FPC/TestPascalFile/Value',TestPascalFile,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'Lazarus/SrcDir/Value',LazarusSrcDir,'');
|
XMLConfig.SetDeleteValue(Path+'Lazarus/SrcDir/Value',LazarusSrcDir,'');
|
||||||
@ -311,6 +324,7 @@ begin
|
|||||||
FPCSrcDir:=XMLConfig.GetValue(Path+'FPC/SrcDir/Value','');
|
FPCSrcDir:=XMLConfig.GetValue(Path+'FPC/SrcDir/Value','');
|
||||||
TargetOS:=XMLConfig.GetValue(Path+'FPC/TargetOS/Value','');
|
TargetOS:=XMLConfig.GetValue(Path+'FPC/TargetOS/Value','');
|
||||||
TargetProcessor:=XMLConfig.GetValue(Path+'FPC/TargetProcessor/Value','');
|
TargetProcessor:=XMLConfig.GetValue(Path+'FPC/TargetProcessor/Value','');
|
||||||
|
SubTarget:=XMLConfig.GetValue(Path+'FPC/SubTarget/Value','');
|
||||||
PPUExt:=XMLConfig.GetValue(Path+'FPC/PPUExt/Value','.ppu');
|
PPUExt:=XMLConfig.GetValue(Path+'FPC/PPUExt/Value','.ppu');
|
||||||
TestPascalFile:=XMLConfig.GetValue(Path+'FPC/TestPascalFile/Value','');
|
TestPascalFile:=XMLConfig.GetValue(Path+'FPC/TestPascalFile/Value','');
|
||||||
FConfigCaches.LoadFromXMLConfig(XMLConfig,Path+'FPCConfigCaches/');
|
FConfigCaches.LoadFromXMLConfig(XMLConfig,Path+'FPCConfigCaches/');
|
||||||
|
@ -837,6 +837,7 @@ type
|
|||||||
// key
|
// key
|
||||||
TargetOS: string; // will be passed lowercase
|
TargetOS: string; // will be passed lowercase
|
||||||
TargetCPU: string; // will be passed lowercase
|
TargetCPU: string; // will be passed lowercase
|
||||||
|
SubTarget: string; // will be passed lowercase
|
||||||
Compiler: string; // full file name
|
Compiler: string; // full file name
|
||||||
CompilerOptions: string; // e.g. -V<version> -Xp<path>
|
CompilerOptions: string; // e.g. -V<version> -Xp<path>
|
||||||
// values
|
// values
|
||||||
@ -907,8 +908,12 @@ type
|
|||||||
procedure SaveToFile(Filename: string);
|
procedure SaveToFile(Filename: string);
|
||||||
procedure IncreaseChangeStamp;
|
procedure IncreaseChangeStamp;
|
||||||
property ChangeStamp: integer read FChangeStamp;
|
property ChangeStamp: integer read FChangeStamp;
|
||||||
|
function Find(CompilerFilename: string;
|
||||||
|
CreateIfNotExists: boolean): TPCTargetConfigCache;
|
||||||
function Find(CompilerFilename, CompilerOptions, TargetOS, TargetCPU: string;
|
function Find(CompilerFilename, CompilerOptions, TargetOS, TargetCPU: string;
|
||||||
CreateIfNotExists: boolean): TPCTargetConfigCache;
|
CreateIfNotExists: boolean): TPCTargetConfigCache;
|
||||||
|
function Find(CompilerFilename, CompilerOptions, TargetOS, TargetCPU, SubTarget: string;
|
||||||
|
CreateIfNotExists: boolean): TPCTargetConfigCache;
|
||||||
procedure GetDefaultCompilerTarget(const CompilerFilename,CompilerOptions: string;
|
procedure GetDefaultCompilerTarget(const CompilerFilename,CompilerOptions: string;
|
||||||
out TargetOS, TargetCPU: string);
|
out TargetOS, TargetCPU: string);
|
||||||
function GetListing: string;
|
function GetListing: string;
|
||||||
@ -984,22 +989,24 @@ type
|
|||||||
FChangeStamp: integer;
|
FChangeStamp: integer;
|
||||||
FCompilerFilename: string;
|
FCompilerFilename: string;
|
||||||
FCompilerOptions: string;
|
FCompilerOptions: string;
|
||||||
FFPCSourceDirectory: string;
|
|
||||||
FTargetCPU: string;
|
|
||||||
FTargetOS: string;
|
|
||||||
FConfigCache: TPCTargetConfigCache;
|
FConfigCache: TPCTargetConfigCache;
|
||||||
|
fFlags: TFPCUnitToSrcCacheFlags;
|
||||||
|
FFPCSourceDirectory: string;
|
||||||
|
fRulesStampOfConfig: integer; // fSourceCache.ChangeStamp while creation of fFPCSourceRules
|
||||||
fSourceCache: TFPCSourceCache;
|
fSourceCache: TFPCSourceCache;
|
||||||
fSourceRules: TFPCSourceRules;
|
fSourceRules: TFPCSourceRules;
|
||||||
fRulesStampOfConfig: integer; // fSourceCache.ChangeStamp while creation of fFPCSourceRules
|
|
||||||
fUnitToSourceTree: TStringToStringTree; // unit name to file name (maybe relative)
|
|
||||||
fUnitStampOfFPC: integer; // FConfigCache.ChangeStamp at creation of fUnitToSourceTree
|
|
||||||
fUnitStampOfFiles: integer; // fSourceCache.ChangeStamp at creation of fUnitToSourceTree
|
|
||||||
fUnitStampOfRules: integer; // fSourceRules.ChangeStamp at creation of fUnitToSourceTree
|
|
||||||
fSrcDuplicates: TStringToStringTree; // unit to list of files (semicolon separated)
|
fSrcDuplicates: TStringToStringTree; // unit to list of files (semicolon separated)
|
||||||
fFlags: TFPCUnitToSrcCacheFlags;
|
FSubTarget: string;
|
||||||
|
FTargetCPU: string;
|
||||||
|
FTargetOS: string;
|
||||||
|
fUnitStampOfFiles: integer; // fSourceCache.ChangeStamp at creation of fUnitToSourceTree
|
||||||
|
fUnitStampOfFPC: integer; // FConfigCache.ChangeStamp at creation of fUnitToSourceTree
|
||||||
|
fUnitStampOfRules: integer; // fSourceRules.ChangeStamp at creation of fUnitToSourceTree
|
||||||
|
fUnitToSourceTree: TStringToStringTree; // unit name to file name (maybe relative)
|
||||||
procedure SetCompilerFilename(const AValue: string);
|
procedure SetCompilerFilename(const AValue: string);
|
||||||
procedure SetCompilerOptions(const AValue: string);
|
procedure SetCompilerOptions(const AValue: string);
|
||||||
procedure SetFPCSourceDirectory(const AValue: string);
|
procedure SetFPCSourceDirectory(const AValue: string);
|
||||||
|
procedure SetSubTarget(AValue: string);
|
||||||
procedure SetTargetCPU(const AValue: string);
|
procedure SetTargetCPU(const AValue: string);
|
||||||
procedure SetTargetOS(const AValue: string);
|
procedure SetTargetOS(const AValue: string);
|
||||||
procedure ClearConfigCache;
|
procedure ClearConfigCache;
|
||||||
@ -1017,6 +1024,7 @@ type
|
|||||||
property CompilerOptions: string read FCompilerOptions write SetCompilerOptions;
|
property CompilerOptions: string read FCompilerOptions write SetCompilerOptions;
|
||||||
property TargetOS: string read FTargetOS write SetTargetOS; // case insensitive, will be passed lowercase
|
property TargetOS: string read FTargetOS write SetTargetOS; // case insensitive, will be passed lowercase
|
||||||
property TargetCPU: string read FTargetCPU write SetTargetCPU; // case insensitive, will be passed lowercase
|
property TargetCPU: string read FTargetCPU write SetTargetCPU; // case insensitive, will be passed lowercase
|
||||||
|
property SubTarget: string read FSubTarget write SetSubTarget; // case insensitive, will be passed lowercase
|
||||||
property FPCSourceDirectory: string read FFPCSourceDirectory write SetFPCSourceDirectory;
|
property FPCSourceDirectory: string read FFPCSourceDirectory write SetFPCSourceDirectory;
|
||||||
function GetConfigCache(AutoUpdate: boolean): TPCTargetConfigCache;
|
function GetConfigCache(AutoUpdate: boolean): TPCTargetConfigCache;
|
||||||
function GetSourceCache(AutoUpdate: boolean): TFPCSourceCache;
|
function GetSourceCache(AutoUpdate: boolean): TFPCSourceCache;
|
||||||
@ -1070,15 +1078,15 @@ type
|
|||||||
function GetPCVersion(const CompilerFilename, TargetOS, TargetCPU: string;
|
function GetPCVersion(const CompilerFilename, TargetOS, TargetCPU: string;
|
||||||
UseCompiledVersionAsDefault: boolean;
|
UseCompiledVersionAsDefault: boolean;
|
||||||
out Kind: TPascalCompiler): string;
|
out Kind: TPascalCompiler): string;
|
||||||
function FindUnitSet(const CompilerFilename, TargetOS, TargetCPU,
|
function FindUnitSet(const CompilerFilename, TargetOS, TargetCPU, SubTarget,
|
||||||
Options, FPCSrcDir: string;
|
Options, FPCSrcDir: string;
|
||||||
CreateIfNotExists: boolean): TFPCUnitSetCache;
|
CreateIfNotExists: boolean): TFPCUnitSetCache;
|
||||||
function FindUnitSetWithID(const UnitSetID: string; out Changed: boolean;
|
function FindUnitSetWithID(const UnitSetID: string; out Changed: boolean;
|
||||||
CreateIfNotExists: boolean): TFPCUnitSetCache;
|
CreateIfNotExists: boolean): TFPCUnitSetCache;
|
||||||
function GetUnitSetID(CompilerFilename, TargetOS, TargetCPU, Options,
|
function GetUnitSetID(CompilerFilename, TargetOS, TargetCPU, SubTarget, Options,
|
||||||
FPCSrcDir: string; ChangeStamp: integer): string;
|
FPCSrcDir: string; ChangeStamp: integer): string;
|
||||||
procedure ParseUnitSetID(const ID: string; out CompilerFilename,
|
procedure ParseUnitSetID(const ID: string; out CompilerFilename,
|
||||||
TargetOS, TargetCPU, Options, FPCSrcDir: string;
|
TargetOS, TargetCPU, SubTarget, Options, FPCSrcDir: string;
|
||||||
out ChangeStamp: integer);
|
out ChangeStamp: integer);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1098,6 +1106,7 @@ function GetDefaultCompilerFilename(const TargetCPU: string = ''; Cross: boolean
|
|||||||
procedure GetTargetProcessors(const TargetCPU: string; aList: TStrings);
|
procedure GetTargetProcessors(const TargetCPU: string; aList: TStrings);
|
||||||
function GetFPCTargetOS(TargetOS: string): string; // normalize
|
function GetFPCTargetOS(TargetOS: string): string; // normalize
|
||||||
function GetFPCTargetCPU(TargetCPU: string): string; // normalize
|
function GetFPCTargetCPU(TargetCPU: string): string; // normalize
|
||||||
|
function GetFPCSubTarget(SubTarget: string): string; // normalize
|
||||||
function IsPas2jsTargetOS(TargetOS: string): boolean;
|
function IsPas2jsTargetOS(TargetOS: string): boolean;
|
||||||
function IsPas2jsTargetCPU(TargetCPU: string): boolean;
|
function IsPas2jsTargetCPU(TargetCPU: string): boolean;
|
||||||
|
|
||||||
@ -3578,9 +3587,11 @@ var
|
|||||||
Item1: TPCTargetConfigCache absolute CacheItem1;
|
Item1: TPCTargetConfigCache absolute CacheItem1;
|
||||||
Item2: TPCTargetConfigCache absolute CacheItem2;
|
Item2: TPCTargetConfigCache absolute CacheItem2;
|
||||||
begin
|
begin
|
||||||
Result:=CompareStr(Item1.TargetOS,Item2.TargetOS);
|
Result:=CompareText(Item1.TargetOS,Item2.TargetOS);
|
||||||
if Result<>0 then exit;
|
if Result<>0 then exit;
|
||||||
Result:=CompareStr(Item1.TargetCPU,Item2.TargetCPU);
|
Result:=CompareText(Item1.TargetCPU,Item2.TargetCPU);
|
||||||
|
if Result<>0 then exit;
|
||||||
|
Result:=CompareText(Item1.SubTarget,Item2.SubTarget);
|
||||||
if Result<>0 then exit;
|
if Result<>0 then exit;
|
||||||
Result:=CompareFilenames(Item1.Compiler,Item2.Compiler);
|
Result:=CompareFilenames(Item1.Compiler,Item2.Compiler);
|
||||||
if Result<>0 then exit;
|
if Result<>0 then exit;
|
||||||
@ -3939,6 +3950,11 @@ begin
|
|||||||
Result:=LowerCase(TargetCPU);
|
Result:=LowerCase(TargetCPU);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetFPCSubTarget(SubTarget: string): string;
|
||||||
|
begin
|
||||||
|
Result:=LowerCase(SubTarget);
|
||||||
|
end;
|
||||||
|
|
||||||
function IsPas2jsTargetOS(TargetOS: string): boolean;
|
function IsPas2jsTargetOS(TargetOS: string): boolean;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -9748,8 +9764,9 @@ var
|
|||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if CompareKey then begin
|
if CompareKey then begin
|
||||||
if (TargetOS<>Item.TargetOS)
|
if (not SameText(TargetOS,Item.TargetOS))
|
||||||
or (TargetCPU<>Item.TargetCPU)
|
or (not SameText(TargetCPU,Item.TargetCPU))
|
||||||
|
or (not SameText(SubTarget,Item.SubTarget))
|
||||||
or (Compiler<>Item.Compiler)
|
or (Compiler<>Item.Compiler)
|
||||||
or (CompilerOptions<>Item.CompilerOptions)
|
or (CompilerOptions<>Item.CompilerOptions)
|
||||||
then
|
then
|
||||||
@ -9845,6 +9862,7 @@ begin
|
|||||||
// keys
|
// keys
|
||||||
TargetOS:=Item.TargetOS;
|
TargetOS:=Item.TargetOS;
|
||||||
TargetCPU:=Item.TargetCPU;
|
TargetCPU:=Item.TargetCPU;
|
||||||
|
SubTarget:=Item.SubTarget;
|
||||||
Compiler:=Item.Compiler;
|
Compiler:=Item.Compiler;
|
||||||
CompilerOptions:=Item.CompilerOptions;
|
CompilerOptions:=Item.CompilerOptions;
|
||||||
// values
|
// values
|
||||||
@ -9996,6 +10014,7 @@ begin
|
|||||||
Kind:=StrToPascalCompiler(XMLConfig.GetValue(Path+'Kind',PascalCompilerNames[pcFPC]));
|
Kind:=StrToPascalCompiler(XMLConfig.GetValue(Path+'Kind',PascalCompilerNames[pcFPC]));
|
||||||
TargetOS:=XMLConfig.GetValue(Path+'TargetOS','');
|
TargetOS:=XMLConfig.GetValue(Path+'TargetOS','');
|
||||||
TargetCPU:=XMLConfig.GetValue(Path+'TargetCPU','');
|
TargetCPU:=XMLConfig.GetValue(Path+'TargetCPU','');
|
||||||
|
SubTarget:=XMLConfig.GetValue(Path+'SubTarget','');
|
||||||
Compiler:=XMLConfig.GetValue(Path+'Compiler/File','');
|
Compiler:=XMLConfig.GetValue(Path+'Compiler/File','');
|
||||||
CompilerOptions:=XMLConfig.GetValue(Path+'Compiler/Options','');
|
CompilerOptions:=XMLConfig.GetValue(Path+'Compiler/Options','');
|
||||||
CompilerDate:=XMLConfig.GetValue(Path+'Compiler/Date',0);
|
CompilerDate:=XMLConfig.GetValue(Path+'Compiler/Date',0);
|
||||||
@ -10181,6 +10200,7 @@ begin
|
|||||||
XMLConfig.SetDeleteValue(Path+'Kind',PascalCompilerNames[Kind],PascalCompilerNames[pcFPC]);
|
XMLConfig.SetDeleteValue(Path+'Kind',PascalCompilerNames[Kind],PascalCompilerNames[pcFPC]);
|
||||||
XMLConfig.SetDeleteValue(Path+'TargetOS',TargetOS,'');
|
XMLConfig.SetDeleteValue(Path+'TargetOS',TargetOS,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'TargetCPU',TargetCPU,'');
|
XMLConfig.SetDeleteValue(Path+'TargetCPU',TargetCPU,'');
|
||||||
|
XMLConfig.SetDeleteValue(Path+'SubTarget',SubTarget,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'Compiler/File',Compiler,'');
|
XMLConfig.SetDeleteValue(Path+'Compiler/File',Compiler,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'Compiler/Options',CompilerOptions,'');
|
XMLConfig.SetDeleteValue(Path+'Compiler/Options',CompilerOptions,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'Compiler/Date',CompilerDate,0);
|
XMLConfig.SetDeleteValue(Path+'Compiler/Date',CompilerDate,0);
|
||||||
@ -10295,6 +10315,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TPCTargetConfigCache.NeedsUpdate: boolean;
|
function TPCTargetConfigCache.NeedsUpdate: boolean;
|
||||||
|
|
||||||
|
procedure DebugMissing(const Msg: string);
|
||||||
|
begin
|
||||||
|
if CTConsoleVerbosity>0 then
|
||||||
|
debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" SubTarget="',SubTarget,'" Options="',CompilerOptions,'" ',Msg]);
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
Cfg: TPCConfigFileState;
|
Cfg: TPCConfigFileState;
|
||||||
@ -10303,21 +10330,18 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
|
|
||||||
if (not FileExistsCached(Compiler)) then begin
|
if (not FileExistsCached(Compiler)) then begin
|
||||||
if CTConsoleVerbosity>0 then
|
DebugMissing('compiler file missing "'+Compiler+'"');
|
||||||
debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" compiler file missing "',Compiler,'"']);
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if (FileAgeCached(Compiler)<>CompilerDate) then begin
|
if (FileAgeCached(Compiler)<>CompilerDate) then begin
|
||||||
if CTConsoleVerbosity>0 then
|
DebugMissing('compiler file changed "'+Compiler+'" FileAge='+dbgs(FileAgeCached(Compiler))+' StoredAge='+dbgs(CompilerDate));
|
||||||
debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" compiler file changed "',Compiler,'" FileAge=',FileAgeCached(Compiler),' StoredAge=',CompilerDate]);
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if (RealCompiler<>'') and (CompareFilenames(RealCompiler,Compiler)<>0)
|
if (RealCompiler<>'') and (CompareFilenames(RealCompiler,Compiler)<>0)
|
||||||
then begin
|
then begin
|
||||||
if (not FileExistsCached(RealCompiler))
|
if (not FileExistsCached(RealCompiler))
|
||||||
or (FileAgeCached(RealCompiler)<>RealCompilerDate) then begin
|
or (FileAgeCached(RealCompiler)<>RealCompilerDate) then begin
|
||||||
if CTConsoleVerbosity>0 then
|
DebugMissing('real compiler file changed "'+RealCompiler+'"');
|
||||||
debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" real compiler file changed "',RealCompiler,'"']);
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -10325,21 +10349,18 @@ begin
|
|||||||
// and that is the RealCompiler
|
// and that is the RealCompiler
|
||||||
AFilename:=FindDefaultTargetCPUCompiler(TargetCPU,true);
|
AFilename:=FindDefaultTargetCPUCompiler(TargetCPU,true);
|
||||||
if RealTargetCPUCompiler<>AFilename then begin
|
if RealTargetCPUCompiler<>AFilename then begin
|
||||||
if CTConsoleVerbosity>0 then
|
DebugMissing('real compiler in PATH changed from "'+RealTargetCPUCompiler+'" to "'+AFilename+'"');
|
||||||
debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" real compiler in PATH changed from "',RealTargetCPUCompiler,'" to "',AFilename,'"']);
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
for i:=0 to ConfigFiles.Count-1 do begin
|
for i:=0 to ConfigFiles.Count-1 do begin
|
||||||
Cfg:=ConfigFiles[i];
|
Cfg:=ConfigFiles[i];
|
||||||
if (Cfg.Filename='') or (not FilenameIsAbsolute(Cfg.Filename)) then continue;
|
if (Cfg.Filename='') or (not FilenameIsAbsolute(Cfg.Filename)) then continue;
|
||||||
if FileExistsCached(Cfg.Filename)<>Cfg.FileExists then begin
|
if FileExistsCached(Cfg.Filename)<>Cfg.FileExists then begin
|
||||||
if CTConsoleVerbosity>0 then
|
DebugMissing('config fileexists changed "'+Cfg.Filename+'"');
|
||||||
debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" config fileexists changed "',Cfg.Filename,'"']);
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if Cfg.FileExists and (FileAgeCached(Cfg.Filename)<>Cfg.FileDate) then begin
|
if Cfg.FileExists and (FileAgeCached(Cfg.Filename)<>Cfg.FileDate) then begin
|
||||||
if CTConsoleVerbosity>0 then
|
DebugMissing('config file changed "'+Cfg.Filename+'"');
|
||||||
debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" config file changed "',Cfg.Filename,'"']);
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -10354,6 +10375,8 @@ begin
|
|||||||
Result:=Result+' -P'+LowerCase(TargetCPU);
|
Result:=Result+' -P'+LowerCase(TargetCPU);
|
||||||
if TargetOS<>'' then
|
if TargetOS<>'' then
|
||||||
Result:=Result+' -T'+LowerCase(TargetOS);
|
Result:=Result+' -T'+LowerCase(TargetOS);
|
||||||
|
if SubTarget<>'' then
|
||||||
|
Result:=Result+' -t'+LowerCase(SubTarget);
|
||||||
if ExtraOptions<>'' then
|
if ExtraOptions<>'' then
|
||||||
Result:=Result+' '+ExtraOptions;
|
Result:=Result+' '+ExtraOptions;
|
||||||
Result:=Trim(Result);
|
Result:=Trim(Result);
|
||||||
@ -10399,11 +10422,11 @@ begin
|
|||||||
Clear;
|
Clear;
|
||||||
|
|
||||||
if CTConsoleVerbosity>0 then
|
if CTConsoleVerbosity>0 then
|
||||||
debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] ',Compiler,' TargetOS=',TargetOS,' TargetCPU=',TargetCPU,' CompilerOptions=',CompilerOptions,' ExtraOptions=',ExtraOptions,' PATH=',GetEnvironmentVariableUTF8('PATH')]);
|
debugln(['Hint: [TPCTargetConfigCache.Update] ',Compiler,' TargetOS=',TargetOS,' TargetCPU=',TargetCPU,' SubTarget=',SubTarget,' CompilerOptions=',CompilerOptions,' ExtraOptions=',ExtraOptions,' PATH=',GetEnvironmentVariableUTF8('PATH')]);
|
||||||
CompilerDate:=-1;
|
CompilerDate:=-1;
|
||||||
if FileExistsCached(Compiler) then begin
|
if FileExistsCached(Compiler) then begin
|
||||||
CompilerDate:=FileAgeCached(Compiler);
|
CompilerDate:=FileAgeCached(Compiler);
|
||||||
ExtraOptions:=GetFPCInfoCmdLineOptions(ExtraOptions);// add -TTargetOS and -PTargetCPU
|
ExtraOptions:=GetFPCInfoCmdLineOptions(ExtraOptions);// add -PTargetCPU -TTargetOS -tSubTarget
|
||||||
BaseDir:='';
|
BaseDir:='';
|
||||||
|
|
||||||
// check if this is a FPC compatible compiler and get version, OS and CPU
|
// check if this is a FPC compatible compiler and get version, OS and CPU
|
||||||
@ -10771,9 +10794,22 @@ begin
|
|||||||
CTIncreaseChangeStamp(FChangeStamp);
|
CTIncreaseChangeStamp(FChangeStamp);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPCTargetConfigCaches.Find(CompilerFilename: string;
|
||||||
|
CreateIfNotExists: boolean): TPCTargetConfigCache;
|
||||||
|
begin
|
||||||
|
Result:=Find(CompilerFilename,'','','','',CreateIfNotExists);
|
||||||
|
end;
|
||||||
|
|
||||||
function TPCTargetConfigCaches.Find(CompilerFilename, CompilerOptions,
|
function TPCTargetConfigCaches.Find(CompilerFilename, CompilerOptions,
|
||||||
TargetOS, TargetCPU: string; CreateIfNotExists: boolean
|
TargetOS, TargetCPU: string; CreateIfNotExists: boolean
|
||||||
): TPCTargetConfigCache;
|
): TPCTargetConfigCache;
|
||||||
|
begin
|
||||||
|
Result:=Find(CompilerFilename,CompilerOptions,TargetOS,TargetCPU,'',CreateIfNotExists);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TPCTargetConfigCaches.Find(CompilerFilename, CompilerOptions,
|
||||||
|
TargetOS, TargetCPU, SubTarget: string; CreateIfNotExists: boolean
|
||||||
|
): TPCTargetConfigCache;
|
||||||
var
|
var
|
||||||
Node: TAVLTreeNode;
|
Node: TAVLTreeNode;
|
||||||
Cmp: TPCTargetConfigCache;
|
Cmp: TPCTargetConfigCache;
|
||||||
@ -10784,6 +10820,7 @@ begin
|
|||||||
Cmp.CompilerOptions:=CompilerOptions;
|
Cmp.CompilerOptions:=CompilerOptions;
|
||||||
Cmp.TargetOS:=TargetOS;
|
Cmp.TargetOS:=TargetOS;
|
||||||
Cmp.TargetCPU:=TargetCPU;
|
Cmp.TargetCPU:=TargetCPU;
|
||||||
|
Cmp.SubTarget:=SubTarget;
|
||||||
Node:=fItems.Find(cmp);
|
Node:=fItems.Find(cmp);
|
||||||
if Node<>nil then begin
|
if Node<>nil then begin
|
||||||
Result:=TPCTargetConfigCache(Node.Data);
|
Result:=TPCTargetConfigCache(Node.Data);
|
||||||
@ -11438,7 +11475,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TCompilerDefinesCache.FindUnitSet(const CompilerFilename, TargetOS,
|
function TCompilerDefinesCache.FindUnitSet(const CompilerFilename, TargetOS,
|
||||||
TargetCPU, Options, FPCSrcDir: string; CreateIfNotExists: boolean
|
TargetCPU, SubTarget, Options, FPCSrcDir: string; CreateIfNotExists: boolean
|
||||||
): TFPCUnitSetCache;
|
): TFPCUnitSetCache;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -11448,6 +11485,7 @@ begin
|
|||||||
if (CompareFilenames(Result.CompilerFilename,CompilerFilename)=0)
|
if (CompareFilenames(Result.CompilerFilename,CompilerFilename)=0)
|
||||||
and (SysUtils.CompareText(Result.TargetOS,TargetOS)=0)
|
and (SysUtils.CompareText(Result.TargetOS,TargetOS)=0)
|
||||||
and (SysUtils.CompareText(Result.TargetCPU,TargetCPU)=0)
|
and (SysUtils.CompareText(Result.TargetCPU,TargetCPU)=0)
|
||||||
|
and (SysUtils.CompareText(Result.SubTarget,SubTarget)=0)
|
||||||
and (CompareFilenames(Result.FPCSourceDirectory,FPCSrcDir)=0)
|
and (CompareFilenames(Result.FPCSourceDirectory,FPCSrcDir)=0)
|
||||||
and (Result.CompilerOptions=Options)
|
and (Result.CompilerOptions=Options)
|
||||||
then
|
then
|
||||||
@ -11459,6 +11497,7 @@ begin
|
|||||||
Result.CompilerOptions:=Options;
|
Result.CompilerOptions:=Options;
|
||||||
Result.TargetOS:=TargetOS;
|
Result.TargetOS:=TargetOS;
|
||||||
Result.TargetCPU:=TargetCPU;
|
Result.TargetCPU:=TargetCPU;
|
||||||
|
Result.SubTarget:=SubTarget;
|
||||||
Result.FPCSourceDirectory:=FPCSrcDir;
|
Result.FPCSourceDirectory:=FPCSrcDir;
|
||||||
fUnitToSrcCaches.Add(Result);
|
fUnitToSrcCaches.Add(Result);
|
||||||
end else
|
end else
|
||||||
@ -11468,37 +11507,47 @@ end;
|
|||||||
function TCompilerDefinesCache.FindUnitSetWithID(const UnitSetID: string; out
|
function TCompilerDefinesCache.FindUnitSetWithID(const UnitSetID: string; out
|
||||||
Changed: boolean; CreateIfNotExists: boolean): TFPCUnitSetCache;
|
Changed: boolean; CreateIfNotExists: boolean): TFPCUnitSetCache;
|
||||||
var
|
var
|
||||||
CompilerFilename, TargetOS, TargetCPU, Options, FPCSrcDir: string;
|
CompilerFilename, TargetOS, TargetCPU, SubTarget, Options, FPCSrcDir: string;
|
||||||
ChangeStamp: integer;
|
ChangeStamp: integer;
|
||||||
begin
|
begin
|
||||||
ParseUnitSetID(UnitSetID,CompilerFilename, TargetOS, TargetCPU,
|
ParseUnitSetID(UnitSetID,CompilerFilename, TargetOS, TargetCPU, SubTarget,
|
||||||
Options, FPCSrcDir, ChangeStamp);
|
Options, FPCSrcDir, ChangeStamp);
|
||||||
//debugln(['TCompilerDefinesCache.FindUnitToSrcCache UnitSetID="',dbgstr(UnitSetID),'" CompilerFilename="',CompilerFilename,'" TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',Options,'" FPCSrcDir="',FPCSrcDir,'" ChangeStamp=',ChangeStamp,' exists=',FindUnitToSrcCache(CompilerFilename, TargetOS, TargetCPU,Options, FPCSrcDir,false)<>nil]);
|
//debugln(['TCompilerDefinesCache.FindUnitToSrcCache UnitSetID="',dbgstr(UnitSetID),'" CompilerFilename="',CompilerFilename,'" TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',Options,'" FPCSrcDir="',FPCSrcDir,'" ChangeStamp=',ChangeStamp,' exists=',FindUnitToSrcCache(CompilerFilename, TargetOS, TargetCPU,Options, FPCSrcDir,false)<>nil]);
|
||||||
Result:=FindUnitSet(CompilerFilename, TargetOS, TargetCPU,
|
Result:=FindUnitSet(CompilerFilename, TargetOS, TargetCPU, SubTarget,
|
||||||
Options, FPCSrcDir, false);
|
Options, FPCSrcDir, false);
|
||||||
if Result<>nil then begin
|
if Result<>nil then begin
|
||||||
Changed:=ChangeStamp<>Result.ChangeStamp;
|
Changed:=ChangeStamp<>Result.ChangeStamp;
|
||||||
end else if CreateIfNotExists then begin
|
end else if CreateIfNotExists then begin
|
||||||
Changed:=true;
|
Changed:=true;
|
||||||
Result:=FindUnitSet(CompilerFilename, TargetOS, TargetCPU,
|
Result:=FindUnitSet(CompilerFilename, TargetOS, TargetCPU, SubTarget,
|
||||||
Options, FPCSrcDir, true);
|
Options, FPCSrcDir, true);
|
||||||
end else
|
end else
|
||||||
Changed:=false;
|
Changed:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCompilerDefinesCache.GetUnitSetID(CompilerFilename, TargetOS, TargetCPU,
|
function TCompilerDefinesCache.GetUnitSetID(CompilerFilename, TargetOS,
|
||||||
Options, FPCSrcDir: string; ChangeStamp: integer): string;
|
TargetCPU, SubTarget, Options, FPCSrcDir: string; ChangeStamp: integer
|
||||||
|
): string;
|
||||||
|
|
||||||
|
procedure Add(const aName, aValue: string);
|
||||||
|
begin
|
||||||
|
if aValue='' then exit;
|
||||||
|
Result+=aName+'='+aValue+LineEnding;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:='CompilerFilename='+CompilerFilename+LineEnding
|
Result:='';
|
||||||
+'TargetOS='+TargetOS+LineEnding
|
Add('CompilerFilename',CompilerFilename);
|
||||||
+'TargetCPU='+TargetCPU+LineEnding
|
Add('TargetOS',TargetOS);
|
||||||
+'Options='+Options+LineEnding
|
Add('TargetCPU',TargetCPU);
|
||||||
+'FPCSrcDir='+FPCSrcDir+LineEnding
|
Add('SubTarget',SubTarget);
|
||||||
+'Stamp='+IntToStr(ChangeStamp);
|
Add('Options',Options);
|
||||||
|
Add('FPCSrcDir',FPCSrcDir);
|
||||||
|
Add('Stamp',IntToStr(ChangeStamp));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCompilerDefinesCache.ParseUnitSetID(const ID: string;
|
procedure TCompilerDefinesCache.ParseUnitSetID(const ID: string; out
|
||||||
out CompilerFilename, TargetOS, TargetCPU, Options, FPCSrcDir: string;
|
CompilerFilename, TargetOS, TargetCPU, SubTarget, Options, FPCSrcDir: string;
|
||||||
out ChangeStamp: integer);
|
out ChangeStamp: integer);
|
||||||
var
|
var
|
||||||
NameStartPos: PChar;
|
NameStartPos: PChar;
|
||||||
@ -11523,6 +11572,7 @@ begin
|
|||||||
CompilerFilename:='';
|
CompilerFilename:='';
|
||||||
TargetCPU:='';
|
TargetCPU:='';
|
||||||
TargetOS:='';
|
TargetOS:='';
|
||||||
|
SubTarget:='';
|
||||||
Options:='';
|
Options:='';
|
||||||
FPCSrcDir:='';
|
FPCSrcDir:='';
|
||||||
ChangeStamp:=0;
|
ChangeStamp:=0;
|
||||||
@ -11551,7 +11601,9 @@ begin
|
|||||||
Options:=Value;
|
Options:=Value;
|
||||||
's','S':
|
's','S':
|
||||||
if NameFits('Stamp') then
|
if NameFits('Stamp') then
|
||||||
ChangeStamp:=StrToIntDef(Value,0);
|
ChangeStamp:=StrToIntDef(Value,0)
|
||||||
|
else if NameFits('SubTarget') then
|
||||||
|
SubTarget:=Value;
|
||||||
't','T':
|
't','T':
|
||||||
if NameFits('TargetOS') then
|
if NameFits('TargetOS') then
|
||||||
TargetOS:=Value
|
TargetOS:=Value
|
||||||
@ -11591,6 +11643,13 @@ begin
|
|||||||
ClearSourceCache;
|
ClearSourceCache;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFPCUnitSetCache.SetSubTarget(AValue: string);
|
||||||
|
begin
|
||||||
|
if FSubTarget=AValue then Exit;
|
||||||
|
FSubTarget:=AValue;
|
||||||
|
ClearConfigCache;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TFPCUnitSetCache.SetTargetCPU(const AValue: string);
|
procedure TFPCUnitSetCache.SetTargetCPU(const AValue: string);
|
||||||
begin
|
begin
|
||||||
if FTargetCPU=AValue then exit;
|
if FTargetCPU=AValue then exit;
|
||||||
@ -11869,7 +11928,7 @@ end;
|
|||||||
|
|
||||||
function TFPCUnitSetCache.GetUnitSetID: string;
|
function TFPCUnitSetCache.GetUnitSetID: string;
|
||||||
begin
|
begin
|
||||||
Result:=Caches.GetUnitSetID(CompilerFilename,TargetOS,TargetCPU,
|
Result:=Caches.GetUnitSetID(CompilerFilename,TargetOS,TargetCPU,SubTarget,
|
||||||
CompilerOptions,FPCSourceDirectory,ChangeStamp);
|
CompilerOptions,FPCSourceDirectory,ChangeStamp);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ type
|
|||||||
function GetBuildMacroOverrides: TStrings; virtual; abstract;
|
function GetBuildMacroOverrides: TStrings; virtual; abstract;
|
||||||
function GetTargetOS: string; virtual; abstract;
|
function GetTargetOS: string; virtual; abstract;
|
||||||
function GetTargetCPU: string; virtual; abstract;
|
function GetTargetCPU: string; virtual; abstract;
|
||||||
|
function GetSubTarget: string; virtual; abstract;
|
||||||
function GetLCLWidgetType: string; virtual; abstract;
|
function GetLCLWidgetType: string; virtual; abstract;
|
||||||
function GetRunCommandLine: string; virtual; abstract;
|
function GetRunCommandLine: string; virtual; abstract;
|
||||||
function GetRunWorkingDir: string; virtual; abstract;
|
function GetRunWorkingDir: string; virtual; abstract;
|
||||||
|
@ -86,6 +86,7 @@ type
|
|||||||
// current target
|
// current target
|
||||||
fTargetOS: string;
|
fTargetOS: string;
|
||||||
fTargetCPU: string;
|
fTargetCPU: string;
|
||||||
|
fSubTarget: string;
|
||||||
fLCLWidgetType: string;
|
fLCLWidgetType: string;
|
||||||
// cache
|
// cache
|
||||||
FFPCompilerFilename: string;
|
FFPCompilerFilename: string;
|
||||||
@ -148,16 +149,18 @@ type
|
|||||||
var {%H-}Abort: boolean): string;
|
var {%H-}Abort: boolean): string;
|
||||||
function MacroFuncSrcOS(const {%H-}Param: string; const Data: PtrInt;
|
function MacroFuncSrcOS(const {%H-}Param: string; const Data: PtrInt;
|
||||||
var {%H-}Abort: boolean): string;
|
var {%H-}Abort: boolean): string;
|
||||||
|
function MacroFuncSubTarget(const {%H-}Param: string; const Data: PtrInt;
|
||||||
|
var {%H-}Abort: boolean): string;
|
||||||
function MacroFuncTargetCmdLine(const {%H-}Param: string; const {%H-}Data: PtrInt;
|
function MacroFuncTargetCmdLine(const {%H-}Param: string; const {%H-}Data: PtrInt;
|
||||||
var {%H-}Abort: boolean): string;
|
var {%H-}Abort: boolean): string;
|
||||||
function MacroFuncTargetCPU(const {%H-}Param: string; const Data: PtrInt;
|
function MacroFuncTargetCPU(const {%H-}Param: string; const Data: PtrInt;
|
||||||
var {%H-}Abort: boolean): string;
|
var {%H-}Abort: boolean): string;
|
||||||
function MacroFuncTargetFile(const {%H-}Param: string; const {%H-}Data: PtrInt;
|
function MacroFuncTargetFile(const {%H-}Param: string; const {%H-}Data: PtrInt;
|
||||||
var {%H-}Abort: boolean): string;
|
var {%H-}Abort: boolean): string;
|
||||||
function MacroFuncOutputFile(const {%H-}Param: string; const {%H-}Data: PtrInt;
|
|
||||||
var {%H-}Abort: boolean): string;
|
|
||||||
function MacroFuncTargetOS(const {%H-}Param: string; const Data: PtrInt;
|
function MacroFuncTargetOS(const {%H-}Param: string; const Data: PtrInt;
|
||||||
var {%H-}Abort: boolean): string;
|
var {%H-}Abort: boolean): string;
|
||||||
|
function MacroFuncOutputFile(const {%H-}Param: string; const {%H-}Data: PtrInt;
|
||||||
|
var {%H-}Abort: boolean): string;
|
||||||
function MacroFuncIDEBuildOptions(const {%H-}Param: string; const Data: PtrInt;
|
function MacroFuncIDEBuildOptions(const {%H-}Param: string; const Data: PtrInt;
|
||||||
var {%H-}Abort: boolean): string;
|
var {%H-}Abort: boolean): string;
|
||||||
function MacroFuncPrimaryConfigPath(const {%H-}Param: string; const {%H-}Data: PtrInt;
|
function MacroFuncPrimaryConfigPath(const {%H-}Param: string; const {%H-}Data: PtrInt;
|
||||||
@ -178,6 +181,7 @@ type
|
|||||||
// command line overrides
|
// command line overrides
|
||||||
OverrideTargetOS: string;
|
OverrideTargetOS: string;
|
||||||
OverrideTargetCPU: string;
|
OverrideTargetCPU: string;
|
||||||
|
OverrideSubTarget: string;
|
||||||
OverrideLCLWidgetType: string;
|
OverrideLCLWidgetType: string;
|
||||||
DefaultCfgVars: TCTCfgScriptVariables;
|
DefaultCfgVars: TCTCfgScriptVariables;
|
||||||
DefaultCfgVarsBuildMacroStamp: integer;
|
DefaultCfgVarsBuildMacroStamp: integer;
|
||||||
@ -206,6 +210,7 @@ type
|
|||||||
function GetBuildMacroOverrides: TStrings; override;
|
function GetBuildMacroOverrides: TStrings; override;
|
||||||
function GetTargetOS: string; override;
|
function GetTargetOS: string; override;
|
||||||
function GetTargetCPU: string; override;
|
function GetTargetCPU: string; override;
|
||||||
|
function GetSubTarget: string; override;
|
||||||
function GetLCLWidgetType: string; override;
|
function GetLCLWidgetType: string; override;
|
||||||
function GetRunCommandLine: string; override;
|
function GetRunCommandLine: string; override;
|
||||||
function GetRunWorkingDir: string; override;
|
function GetRunWorkingDir: string; override;
|
||||||
@ -250,7 +255,7 @@ type
|
|||||||
function UpdateProjectAutomaticFiles(TestDir: string): TModalResult; override;
|
function UpdateProjectAutomaticFiles(TestDir: string): TModalResult; override;
|
||||||
|
|
||||||
// methods for building IDE (will be changed when project groups are there)
|
// methods for building IDE (will be changed when project groups are there)
|
||||||
procedure SetBuildTarget(const TargetOS, TargetCPU, LCLWidgetType: string;
|
procedure SetBuildTarget(const TargetOS, TargetCPU, SubTarget, LCLWidgetType: string;
|
||||||
ScanFPCSrc: TScanModeFPCSources; Quiet: boolean);
|
ScanFPCSrc: TScanModeFPCSources; Quiet: boolean);
|
||||||
procedure SetBuildTargetProject1; override; overload;
|
procedure SetBuildTargetProject1; override; overload;
|
||||||
procedure SetBuildTargetProject1(Quiet: boolean; ScanFPCSrc: TScanModeFPCSources = smsfsBackground); overload;
|
procedure SetBuildTargetProject1(Quiet: boolean; ScanFPCSrc: TScanModeFPCSources = smsfsBackground); overload;
|
||||||
@ -444,6 +449,8 @@ begin
|
|||||||
lisTargetCPU,@MacroFuncTargetCPU,[]));
|
lisTargetCPU,@MacroFuncTargetCPU,[]));
|
||||||
GlobalMacroList.Add(TTransferMacro.Create('TargetOS','',
|
GlobalMacroList.Add(TTransferMacro.Create('TargetOS','',
|
||||||
lisTargetOS,@MacroFuncTargetOS,[]));
|
lisTargetOS,@MacroFuncTargetOS,[]));
|
||||||
|
GlobalMacroList.Add(TTransferMacro.Create('SubTarget','',
|
||||||
|
lisTargetCPU,@MacroFuncSubTarget,[]));
|
||||||
GlobalMacroList.Add(TTransferMacro.Create('SrcOS','',
|
GlobalMacroList.Add(TTransferMacro.Create('SrcOS','',
|
||||||
lisSrcOS,@MacroFuncSrcOS,[]));
|
lisSrcOS,@MacroFuncSrcOS,[]));
|
||||||
GlobalMacroList.Add(TTransferMacro.Create('CompPath','',
|
GlobalMacroList.Add(TTransferMacro.Create('CompPath','',
|
||||||
@ -645,6 +652,11 @@ begin
|
|||||||
//debugln(['TBuildManager.GetTargetCPU ',Result]);
|
//debugln(['TBuildManager.GetTargetCPU ',Result]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBuildManager.GetSubTarget: string;
|
||||||
|
begin
|
||||||
|
Result:=fSubTarget;
|
||||||
|
end;
|
||||||
|
|
||||||
function TBuildManager.GetLCLWidgetType: string;
|
function TBuildManager.GetLCLWidgetType: string;
|
||||||
begin
|
begin
|
||||||
Result:=fLCLWidgetType;
|
Result:=fLCLWidgetType;
|
||||||
@ -980,7 +992,7 @@ procedure TBuildManager.RescanCompilerDefines(ResetBuildTarget,
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
TargetOS, TargetCPU, FPCOptions: string;
|
TargetOS, TargetCPU, SubTarget, FPCOptions: string;
|
||||||
CompilerFilename: String;
|
CompilerFilename: String;
|
||||||
FPCSrcDir: string;
|
FPCSrcDir: string;
|
||||||
ADefTempl: TDefineTemplate;
|
ADefTempl: TDefineTemplate;
|
||||||
@ -1004,7 +1016,7 @@ begin
|
|||||||
CodeToolBoss.CompilerDefinesCache.SourceCaches.Clear;
|
CodeToolBoss.CompilerDefinesCache.SourceCaches.Clear;
|
||||||
end;
|
end;
|
||||||
if ResetBuildTarget then
|
if ResetBuildTarget then
|
||||||
SetBuildTarget('','','',smsfsSkip,true);
|
SetBuildTarget('','','','',smsfsSkip,true);
|
||||||
|
|
||||||
// start the compiler and ask for his settings
|
// start the compiler and ask for his settings
|
||||||
// provide an english message file
|
// provide an english message file
|
||||||
@ -1013,6 +1025,7 @@ begin
|
|||||||
// use current TargetOS, TargetCPU, compilerfilename and FPC source dir
|
// use current TargetOS, TargetCPU, compilerfilename and FPC source dir
|
||||||
TargetOS:=GetTargetOS;
|
TargetOS:=GetTargetOS;
|
||||||
TargetCPU:=GetTargetCPU;
|
TargetCPU:=GetTargetCPU;
|
||||||
|
SubTarget:=GetSubTarget;
|
||||||
{$IFDEF VerboseFPCSrcScan}
|
{$IFDEF VerboseFPCSrcScan}
|
||||||
debugln(['TBuildManager.RescanCompilerDefines GetParsedFPCSourceDirectory needs FPCVer...']);
|
debugln(['TBuildManager.RescanCompilerDefines GetParsedFPCSourceDirectory needs FPCVer...']);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -1027,6 +1040,7 @@ begin
|
|||||||
' Kind=',PascalCompilerNames[CompilerKind],
|
' Kind=',PascalCompilerNames[CompilerKind],
|
||||||
' TargetOS=',TargetOS,
|
' TargetOS=',TargetOS,
|
||||||
' TargetCPU=',TargetCPU,
|
' TargetCPU=',TargetCPU,
|
||||||
|
' SubTarget=',SubTarget,
|
||||||
' FPCOptions="',FPCOptions,'"',
|
' FPCOptions="',FPCOptions,'"',
|
||||||
' EnvFPCSrcDir=',EnvironmentOptions.FPCSourceDirectory,
|
' EnvFPCSrcDir=',EnvironmentOptions.FPCSourceDirectory,
|
||||||
' FPCSrcDir=',FPCSrcDir,
|
' FPCSrcDir=',FPCSrcDir,
|
||||||
@ -1044,7 +1058,7 @@ begin
|
|||||||
debugln(['TBuildManager.RescanCompilerDefines reading default compiler settings']);
|
debugln(['TBuildManager.RescanCompilerDefines reading default compiler settings']);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
UnitSetCache:=CodeToolBoss.CompilerDefinesCache.FindUnitSet(
|
UnitSetCache:=CodeToolBoss.CompilerDefinesCache.FindUnitSet(
|
||||||
DefCompilerFilename,'','','',FPCSrcDir,true);
|
DefCompilerFilename,'','','','',FPCSrcDir,true);
|
||||||
UnitSetCache.GetConfigCache(true);
|
UnitSetCache.GetConfigCache(true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1087,9 +1101,9 @@ begin
|
|||||||
{$IFDEF VerboseFPCSrcScan}
|
{$IFDEF VerboseFPCSrcScan}
|
||||||
debugln(['TBuildManager.RescanCompilerDefines reading active compiler settings']);
|
debugln(['TBuildManager.RescanCompilerDefines reading active compiler settings']);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
//debugln(['TBuildManager.RescanCompilerDefines ',CompilerFilename,' OS=',TargetOS,' CPU=',TargetCPU,' Options="',FPCOptions,'"']);
|
//debugln(['TBuildManager.RescanCompilerDefines ',CompilerFilename,' OS=',TargetOS,' CPU=',TargetCPU,' SubTarget=',SubTarget,' Options="',FPCOptions,'"']);
|
||||||
UnitSetCache:=CodeToolBoss.CompilerDefinesCache.FindUnitSet(
|
UnitSetCache:=CodeToolBoss.CompilerDefinesCache.FindUnitSet(
|
||||||
CompilerFilename,TargetOS,TargetCPU,FPCOptions,FPCSrcDir,true);
|
CompilerFilename,TargetOS,TargetCPU,SubTarget,FPCOptions,FPCSrcDir,true);
|
||||||
|
|
||||||
NeedUpdateFPCSrcCache:=false;
|
NeedUpdateFPCSrcCache:=false;
|
||||||
//debugln(['TBuildManager.RescanCompilerDefines ',DirectoryExistsUTF8(FPCSrcDir),' ',(not WaitTillDone),' ',(not HasGUI)]);
|
//debugln(['TBuildManager.RescanCompilerDefines ',DirectoryExistsUTF8(FPCSrcDir),' ',(not WaitTillDone),' ',(not HasGUI)]);
|
||||||
@ -1124,6 +1138,7 @@ begin
|
|||||||
' CompilerFilename=',CompilerFilename,
|
' CompilerFilename=',CompilerFilename,
|
||||||
' TargetOS=',TargetOS,
|
' TargetOS=',TargetOS,
|
||||||
' TargetCPU=',TargetCPU,
|
' TargetCPU=',TargetCPU,
|
||||||
|
' SubTarget=',SubTarget,
|
||||||
' FPCOptions="',FPCOptions,'"',
|
' FPCOptions="',FPCOptions,'"',
|
||||||
' RealCompiler=',UnitSetCache.GetConfigCache(false).RealCompiler,
|
' RealCompiler=',UnitSetCache.GetConfigCache(false).RealCompiler,
|
||||||
' EnvFPCSrcDir=',EnvironmentOptions.FPCSourceDirectory,
|
' EnvFPCSrcDir=',EnvironmentOptions.FPCSourceDirectory,
|
||||||
@ -1203,6 +1218,8 @@ begin
|
|||||||
// check if at least one fpc config is there
|
// check if at least one fpc config is there
|
||||||
if (UnitSetCache.GetFirstFPCCfg='') then begin
|
if (UnitSetCache.GetFirstFPCCfg='') then begin
|
||||||
IgnorePath:='MissingFPCCfg_'+TargetOS+'-'+TargetCPU;
|
IgnorePath:='MissingFPCCfg_'+TargetOS+'-'+TargetCPU;
|
||||||
|
if SubTarget<>'' then
|
||||||
|
IgnorePath+='-'+SubTarget;
|
||||||
if (InputHistories<>nil) and (InputHistories.Ignores.Find(IgnorePath)=nil)
|
if (InputHistories<>nil) and (InputHistories.Ignores.Find(IgnorePath)=nil)
|
||||||
then begin
|
then begin
|
||||||
MsgResult:=IDEMessageDialog(lisCCOWarningCaption,
|
MsgResult:=IDEMessageDialog(lisCCOWarningCaption,
|
||||||
@ -2283,6 +2300,17 @@ begin
|
|||||||
Result:=GetDefaultSrcOSForTargetOS(GetTargetOS);
|
Result:=GetDefaultSrcOSForTargetOS(GetTargetOS);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBuildManager.MacroFuncSubTarget(const Param: string;
|
||||||
|
const Data: PtrInt; var Abort: boolean): string;
|
||||||
|
begin
|
||||||
|
if Data=CompilerOptionMacroPlatformIndependent then
|
||||||
|
Result:='%(FPC_SUBTARGET)'
|
||||||
|
else if SysUtils.CompareText(Param,'IDE')=0 then
|
||||||
|
Result:=''
|
||||||
|
else
|
||||||
|
Result:=GetSubTarget;
|
||||||
|
end;
|
||||||
|
|
||||||
function TBuildManager.MacroFuncFPCVer(const Param: string; const Data: PtrInt;
|
function TBuildManager.MacroFuncFPCVer(const Param: string; const Data: PtrInt;
|
||||||
var Abort: boolean): string;
|
var Abort: boolean): string;
|
||||||
|
|
||||||
@ -2913,7 +2941,7 @@ begin
|
|||||||
Result:=not Project1.BuildModes.IsSessionMode(Identifier);
|
Result:=not Project1.BuildModes.IsSessionMode(Identifier);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildManager.SetBuildTarget(const TargetOS, TargetCPU,
|
procedure TBuildManager.SetBuildTarget(const TargetOS, TargetCPU, SubTarget,
|
||||||
LCLWidgetType: string; ScanFPCSrc: TScanModeFPCSources; Quiet: boolean);
|
LCLWidgetType: string; ScanFPCSrc: TScanModeFPCSources; Quiet: boolean);
|
||||||
|
|
||||||
function GetEffectiveLCLWidgetType: string;
|
function GetEffectiveLCLWidgetType: string;
|
||||||
@ -2932,6 +2960,7 @@ procedure TBuildManager.SetBuildTarget(const TargetOS, TargetCPU,
|
|||||||
var
|
var
|
||||||
OldTargetOS: String;
|
OldTargetOS: String;
|
||||||
OldTargetCPU: String;
|
OldTargetCPU: String;
|
||||||
|
OldSubTarget: String;
|
||||||
OldLCLWidgetType: String;
|
OldLCLWidgetType: String;
|
||||||
PCTargetChanged: Boolean;
|
PCTargetChanged: Boolean;
|
||||||
LCLTargetChanged: Boolean;
|
LCLTargetChanged: Boolean;
|
||||||
@ -2940,13 +2969,15 @@ var
|
|||||||
CompQueryOptions, CompilerFilename: String;
|
CompQueryOptions, CompilerFilename: String;
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerboseDefaultCompilerTarget}
|
{$IFDEF VerboseDefaultCompilerTarget}
|
||||||
debugln(['TBuildManager.SetBuildTarget TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" LCLWidgetType="',LCLWidgetType,'"']);
|
debugln(['TBuildManager.SetBuildTarget TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" SubTarget="',SubTarget,'" LCLWidgetType="',LCLWidgetType,'"']);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
OldTargetOS:=fTargetOS;
|
OldTargetOS:=fTargetOS;
|
||||||
OldTargetCPU:=fTargetCPU;
|
OldTargetCPU:=fTargetCPU;
|
||||||
|
OldSubTarget:=fSubTarget;
|
||||||
OldLCLWidgetType:=fLCLWidgetType;
|
OldLCLWidgetType:=fLCLWidgetType;
|
||||||
OverrideTargetOS:=GetFPCTargetOS(TargetOS);
|
OverrideTargetOS:=GetFPCTargetOS(TargetOS);
|
||||||
OverrideTargetCPU:=GetFPCTargetCPU(TargetCPU);
|
OverrideTargetCPU:=GetFPCTargetCPU(TargetCPU);
|
||||||
|
OverrideSubTarget:=GetFPCSubTarget(SubTarget);
|
||||||
OverrideLCLWidgetType:=lowercase(LCLWidgetType);
|
OverrideLCLWidgetType:=lowercase(LCLWidgetType);
|
||||||
|
|
||||||
// compute new TargetOS
|
// compute new TargetOS
|
||||||
@ -2969,6 +3000,16 @@ begin
|
|||||||
if SysUtils.CompareText(fTargetCPU,'default')=0 then
|
if SysUtils.CompareText(fTargetCPU,'default')=0 then
|
||||||
fTargetCPU:='';
|
fTargetCPU:='';
|
||||||
|
|
||||||
|
// compute new SubTarget
|
||||||
|
if OverrideSubTarget<>'' then
|
||||||
|
fSubTarget:=OverrideSubTarget
|
||||||
|
else if FBuildTarget<>nil then
|
||||||
|
fSubTarget:=FBuildTarget.CompilerOptions.SubTarget
|
||||||
|
else
|
||||||
|
fSubTarget:='';
|
||||||
|
if SysUtils.CompareText(fSubTarget,'default')=0 then
|
||||||
|
fSubTarget:='';
|
||||||
|
|
||||||
if (fTargetOS='') or (fTargetCPU='') then
|
if (fTargetOS='') or (fTargetCPU='') then
|
||||||
begin
|
begin
|
||||||
// use compiler default target
|
// use compiler default target
|
||||||
@ -3004,6 +3045,7 @@ begin
|
|||||||
|
|
||||||
PCTargetChanged:=(OldTargetOS<>fTargetOS)
|
PCTargetChanged:=(OldTargetOS<>fTargetOS)
|
||||||
or (OldTargetCPU<>fTargetCPU)
|
or (OldTargetCPU<>fTargetCPU)
|
||||||
|
or (OldSubTarget<>fSubTarget)
|
||||||
or (CodeToolBoss.DefineTree.FindDefineTemplateByName(
|
or (CodeToolBoss.DefineTree.FindDefineTemplateByName(
|
||||||
StdDefTemplLazarusSources,true)=nil);
|
StdDefTemplLazarusSources,true)=nil);
|
||||||
if PCTargetChanged then
|
if PCTargetChanged then
|
||||||
@ -3018,9 +3060,10 @@ begin
|
|||||||
|
|
||||||
if PCTargetChanged or LCLTargetChanged then begin
|
if PCTargetChanged or LCLTargetChanged then begin
|
||||||
if ConsoleVerbosity>=0 then
|
if ConsoleVerbosity>=0 then
|
||||||
DebugLn(['Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=',OldTargetCPU,
|
DebugLn(['Hint: (lazarus) [TBuildManager.SetBuildTarget]',
|
||||||
'-',OldTargetOS,'-',OldLCLWidgetType,' New=',fTargetCPU,'-',fTargetOS,
|
' Old=',OldTargetCPU,'-',OldTargetOS,'-',OldSubTarget,'-',OldLCLWidgetType,
|
||||||
'-',fLCLWidgetType,' Changed: OS/CPU=',PCTargetChanged,' LCL=',LCLTargetChanged]);
|
' New=',fTargetCPU,'-',fTargetOS,'-',fSubTarget,'-',fLCLWidgetType,
|
||||||
|
' Changed: OS/CPU=',PCTargetChanged,' LCL=',LCLTargetChanged]);
|
||||||
end;
|
end;
|
||||||
if LCLTargetChanged then
|
if LCLTargetChanged then
|
||||||
CodeToolBoss.SetGlobalValue(ExternalMacroStart+'LCLWidgetType',fLCLWidgetType);
|
CodeToolBoss.SetGlobalValue(ExternalMacroStart+'LCLWidgetType',fLCLWidgetType);
|
||||||
@ -3043,25 +3086,26 @@ begin
|
|||||||
FBuildTarget:=Project1;
|
FBuildTarget:=Project1;
|
||||||
if FBuildTarget<>nil then
|
if FBuildTarget<>nil then
|
||||||
FBuildTarget.IDEOptions.AddHandlerDestroy(@OnProjectDestroy);
|
FBuildTarget.IDEOptions.AddHandlerDestroy(@OnProjectDestroy);
|
||||||
SetBuildTarget('','','',ScanFPCSrc,Quiet);
|
SetBuildTarget('','','','',ScanFPCSrc,Quiet);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBuildManager.SetBuildTargetIDE(aQuiet: boolean);
|
procedure TBuildManager.SetBuildTargetIDE(aQuiet: boolean);
|
||||||
var
|
var
|
||||||
NewTargetOS: String;
|
NewTargetOS: String;
|
||||||
NewTargetCPU: String;
|
NewTargetCPU: String;
|
||||||
NewLCLWidgetSet: String;
|
NewLCLWidgetSet, NewSubTarget: String;
|
||||||
begin
|
begin
|
||||||
//debugln(['TBuildManager.SetBuildTargetIDE START']);
|
//debugln(['TBuildManager.SetBuildTargetIDE START']);
|
||||||
FBuildTarget:=nil;
|
FBuildTarget:=nil;
|
||||||
with MiscellaneousOptions do begin
|
with MiscellaneousOptions do begin
|
||||||
NewTargetOS:=BuildLazOpts.TargetOS;
|
NewTargetOS:=BuildLazOpts.TargetOS;
|
||||||
NewTargetCPU:=BuildLazOpts.TargetCPU;
|
NewTargetCPU:=BuildLazOpts.TargetCPU;
|
||||||
|
NewSubTarget:=BuildLazOpts.SubTarget;
|
||||||
NewLCLWidgetSet:=LCLPlatformDirNames[BuildLazOpts.TargetPlatform];
|
NewLCLWidgetSet:=LCLPlatformDirNames[BuildLazOpts.TargetPlatform];
|
||||||
end;
|
end;
|
||||||
if ConsoleVerbosity>=1 then
|
if ConsoleVerbosity>=1 then
|
||||||
debugln(['Hint: (lazarus) [TBuildManager.SetBuildTargetIDE] OS=',NewTargetOS,' CPU=',NewTargetCPU,' WS=',NewLCLWidgetSet]);
|
debugln(['Hint: (lazarus) [TBuildManager.SetBuildTargetIDE] OS=',NewTargetOS,' CPU=',NewTargetCPU,' SubTarget=',NewSubTarget,' WS=',NewLCLWidgetSet]);
|
||||||
SetBuildTarget(NewTargetOS,NewTargetCPU,NewLCLWidgetSet,smsfsBackground,aQuiet);
|
SetBuildTarget(NewTargetOS,NewTargetCPU,NewSubTarget,NewLCLWidgetSet,smsfsBackground,aQuiet);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildManager.BuildTargetIDEIsDefault: boolean;
|
function TBuildManager.BuildTargetIDEIsDefault: boolean;
|
||||||
|
@ -63,6 +63,7 @@ type
|
|||||||
FCleanOnce: boolean;
|
FCleanOnce: boolean;
|
||||||
fOwnerCnt: TBuildLazarusProfiles;
|
fOwnerCnt: TBuildLazarusProfiles;
|
||||||
fName: string;
|
fName: string;
|
||||||
|
FSubTarget: string;
|
||||||
fTargetOS: string;
|
fTargetOS: string;
|
||||||
fTargetDirectory: string;
|
fTargetDirectory: string;
|
||||||
fTargetCPU: string;
|
fTargetCPU: string;
|
||||||
@ -89,6 +90,7 @@ type
|
|||||||
property TargetOS: string read fTargetOS write fTargetOS;
|
property TargetOS: string read fTargetOS write fTargetOS;
|
||||||
property TargetDirectory: string read fTargetDirectory write fTargetDirectory;
|
property TargetDirectory: string read fTargetDirectory write fTargetDirectory;
|
||||||
property TargetCPU: string read fTargetCPU write fTargetCPU;
|
property TargetCPU: string read fTargetCPU write fTargetCPU;
|
||||||
|
property SubTarget: string read FSubTarget write FSubTarget;
|
||||||
property TargetPlatform: TLCLPlatform read fTargetPlatform write fTargetPlatform;
|
property TargetPlatform: TLCLPlatform read fTargetPlatform write fTargetPlatform;
|
||||||
property IdeBuildMode: TIdeBuildMode read fIdeBuildMode write fIdeBuildMode;
|
property IdeBuildMode: TIdeBuildMode read fIdeBuildMode write fIdeBuildMode;
|
||||||
property CleanOnce: boolean read FCleanOnce write FCleanOnce;
|
property CleanOnce: boolean read FCleanOnce write FCleanOnce;
|
||||||
@ -219,6 +221,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TargetOS :=XMLConfig.GetValue(Path+'TargetOS/Value','');
|
TargetOS :=XMLConfig.GetValue(Path+'TargetOS/Value','');
|
||||||
TargetCPU :=XMLConfig.GetValue(Path+'TargetCPU/Value','');
|
TargetCPU :=XMLConfig.GetValue(Path+'TargetCPU/Value','');
|
||||||
|
SubTarget :=XMLConfig.GetValue(Path+'SubTarget/Value','');
|
||||||
LCLPlatformStr:=XMLConfig.GetValue(Path+'LCLPlatform/Value','');
|
LCLPlatformStr:=XMLConfig.GetValue(Path+'LCLPlatform/Value','');
|
||||||
if LCLPlatformStr='' then
|
if LCLPlatformStr='' then
|
||||||
fTargetPlatform:=GetDefaultLCLWidgetType
|
fTargetPlatform:=GetDefaultLCLWidgetType
|
||||||
@ -239,6 +242,7 @@ procedure TBuildLazarusProfile.Save(XMLConfig: TXMLConfig; const Path: string);
|
|||||||
begin
|
begin
|
||||||
XMLConfig.SetDeleteValue(Path+'TargetOS/Value',TargetOS,'');
|
XMLConfig.SetDeleteValue(Path+'TargetOS/Value',TargetOS,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'TargetCPU/Value',TargetCPU,'');
|
XMLConfig.SetDeleteValue(Path+'TargetCPU/Value',TargetCPU,'');
|
||||||
|
XMLConfig.SetDeleteValue(Path+'SubTarget/Value',SubTarget,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'LCLPlatform/Value',
|
XMLConfig.SetDeleteValue(Path+'LCLPlatform/Value',
|
||||||
LCLPlatformDirNames[fTargetPlatform],
|
LCLPlatformDirNames[fTargetPlatform],
|
||||||
'');
|
'');
|
||||||
@ -259,6 +263,7 @@ begin
|
|||||||
TargetOS :=Source.TargetOS;
|
TargetOS :=Source.TargetOS;
|
||||||
TargetDirectory :=Source.TargetDirectory;
|
TargetDirectory :=Source.TargetDirectory;
|
||||||
TargetCPU :=Source.TargetCPU;
|
TargetCPU :=Source.TargetCPU;
|
||||||
|
SubTarget :=Source.SubTarget;
|
||||||
TargetPlatform :=Source.TargetPlatform;
|
TargetPlatform :=Source.TargetPlatform;
|
||||||
IdeBuildMode :=Source.IdeBuildMode;
|
IdeBuildMode :=Source.IdeBuildMode;
|
||||||
CleanOnce :=Source.CleanOnce;
|
CleanOnce :=Source.CleanOnce;
|
||||||
|
@ -618,7 +618,7 @@ begin
|
|||||||
TargetProcessor:='';
|
TargetProcessor:='';
|
||||||
|
|
||||||
UnitSetCache:=Boss.CompilerDefinesCache.FindUnitSet(CompilerPath,
|
UnitSetCache:=Boss.CompilerDefinesCache.FindUnitSet(CompilerPath,
|
||||||
TargetOS,TargetProcessor,'',FPCSrcDir,true);
|
TargetOS,TargetProcessor,'','',FPCSrcDir,true);
|
||||||
|
|
||||||
// create directory defines
|
// create directory defines
|
||||||
DirTemplate:=TDefineTemplate.Create('FPC Project ('+FileNames[0]+')',
|
DirTemplate:=TDefineTemplate.Create('FPC Project ('+FileNames[0]+')',
|
||||||
@ -727,7 +727,7 @@ begin
|
|||||||
DebugLn(' FPCSrcDir="',FPCSrcDir,'"');
|
DebugLn(' FPCSrcDir="',FPCSrcDir,'"');
|
||||||
|
|
||||||
UnitSetCache:=Boss.CompilerDefinesCache.FindUnitSet(CompilerPath,
|
UnitSetCache:=Boss.CompilerDefinesCache.FindUnitSet(CompilerPath,
|
||||||
TargetOS,TargetProcessor,'',FPCSrcDir,true);
|
TargetOS,TargetProcessor,'','',FPCSrcDir,true);
|
||||||
// create FPC Source defines
|
// create FPC Source defines
|
||||||
FPCSrcTemplate:=CreateFPCSourceTemplate(UnitSetCache,CodeToolsOpts);
|
FPCSrcTemplate:=CreateFPCSourceTemplate(UnitSetCache,CodeToolsOpts);
|
||||||
if FPCSrcTemplate=nil then begin
|
if FPCSrcTemplate=nil then begin
|
||||||
|
@ -1625,6 +1625,7 @@ begin
|
|||||||
TargetProcessor := aXMLConfig.GetValue(p+'TargetProcessor/Value', '');
|
TargetProcessor := aXMLConfig.GetValue(p+'TargetProcessor/Value', '');
|
||||||
TargetCPU := aXMLConfig.GetValue(p+'TargetCPU/Value', '');
|
TargetCPU := aXMLConfig.GetValue(p+'TargetCPU/Value', '');
|
||||||
TargetOS := aXMLConfig.GetValue(p+'TargetOS/Value', '');
|
TargetOS := aXMLConfig.GetValue(p+'TargetOS/Value', '');
|
||||||
|
SubTarget := aXMLConfig.GetValue(p+'SubTarget/Value', '');
|
||||||
OptimizationLevel := aXMLConfig.GetValue(p+'Optimizations/OptimizationLevel/Value', 1);
|
OptimizationLevel := aXMLConfig.GetValue(p+'Optimizations/OptimizationLevel/Value', 1);
|
||||||
VariablesInRegisters := aXMLConfig.GetValue(p+'Optimizations/VariablesInRegisters/Value', false);
|
VariablesInRegisters := aXMLConfig.GetValue(p+'Optimizations/VariablesInRegisters/Value', false);
|
||||||
UncertainOptimizations := aXMLConfig.GetValue(p+'Optimizations/UncertainOptimizations/Value', false);
|
UncertainOptimizations := aXMLConfig.GetValue(p+'Optimizations/UncertainOptimizations/Value', false);
|
||||||
@ -1835,6 +1836,7 @@ begin
|
|||||||
aXMLConfig.SetDeleteValue(p+'TargetProcessor/Value', TargetProcessor,'');
|
aXMLConfig.SetDeleteValue(p+'TargetProcessor/Value', TargetProcessor,'');
|
||||||
aXMLConfig.SetDeleteValue(p+'TargetCPU/Value', TargetCPU,'');
|
aXMLConfig.SetDeleteValue(p+'TargetCPU/Value', TargetCPU,'');
|
||||||
aXMLConfig.SetDeleteValue(p+'TargetOS/Value', TargetOS,'');
|
aXMLConfig.SetDeleteValue(p+'TargetOS/Value', TargetOS,'');
|
||||||
|
aXMLConfig.SetDeleteValue(p+'SubTarget/Value', SubTarget,'');
|
||||||
aXMLConfig.SetDeleteValue(p+'Optimizations/OptimizationLevel/Value', OptimizationLevel,1);
|
aXMLConfig.SetDeleteValue(p+'Optimizations/OptimizationLevel/Value', OptimizationLevel,1);
|
||||||
aXMLConfig.SetDeleteValue(p+'Optimizations/VariablesInRegisters/Value', VariablesInRegisters,false);
|
aXMLConfig.SetDeleteValue(p+'Optimizations/VariablesInRegisters/Value', VariablesInRegisters,false);
|
||||||
aXMLConfig.SetDeleteValue(p+'Optimizations/UncertainOptimizations/Value', UncertainOptimizations,false);
|
aXMLConfig.SetDeleteValue(p+'Optimizations/UncertainOptimizations/Value', UncertainOptimizations,false);
|
||||||
@ -2645,6 +2647,9 @@ begin
|
|||||||
if (CurTargetCPU<>'')
|
if (CurTargetCPU<>'')
|
||||||
and ((TargetCPU<>'') or (CurTargetCPU<>DefaultTargetCPU)) then
|
and ((TargetCPU<>'') or (CurTargetCPU<>DefaultTargetCPU)) then
|
||||||
Result.Add('-P' + CurTargetCPU);
|
Result.Add('-P' + CurTargetCPU);
|
||||||
|
{ SubTarget }
|
||||||
|
if SubTarget<>'' then
|
||||||
|
Result.Add('-t'+SubTarget);
|
||||||
{ TargetProcessor }
|
{ TargetProcessor }
|
||||||
if TargetProcessor<>'' then
|
if TargetProcessor<>'' then
|
||||||
Result.Add('-Cp'+UpperCase(TargetProcessor));
|
Result.Add('-Cp'+UpperCase(TargetProcessor));
|
||||||
|
@ -108,8 +108,7 @@ end;
|
|||||||
procedure TIDEFPCInfoDialog.UpdateValuesMemo;
|
procedure TIDEFPCInfoDialog.UpdateValuesMemo;
|
||||||
var
|
var
|
||||||
sl: TStringList;
|
sl: TStringList;
|
||||||
TargetOS: String;
|
TargetOS, TargetCPU, SubTarget: String;
|
||||||
TargetCPU: String;
|
|
||||||
CompilerFilename: String;
|
CompilerFilename: String;
|
||||||
FPCSrcDir: String;
|
FPCSrcDir: String;
|
||||||
UnitSetCache: TFPCUnitSetCache;
|
UnitSetCache: TFPCUnitSetCache;
|
||||||
@ -124,10 +123,11 @@ begin
|
|||||||
|
|
||||||
TargetOS:=BuildBoss.GetTargetOS;
|
TargetOS:=BuildBoss.GetTargetOS;
|
||||||
TargetCPU:=BuildBoss.GetTargetCPU;
|
TargetCPU:=BuildBoss.GetTargetCPU;
|
||||||
|
SubTarget:=BuildBoss.GetSubTarget;
|
||||||
CompilerFilename:=LazarusIDE.GetCompilerFilename;
|
CompilerFilename:=LazarusIDE.GetCompilerFilename;
|
||||||
FPCSrcDir:=EnvironmentOptions.GetParsedFPCSourceDirectory; // needs FPCVer macro
|
FPCSrcDir:=EnvironmentOptions.GetParsedFPCSourceDirectory; // needs FPCVer macro
|
||||||
UnitSetCache:=CodeToolBoss.CompilerDefinesCache.FindUnitSet(
|
UnitSetCache:=CodeToolBoss.CompilerDefinesCache.FindUnitSet(
|
||||||
CompilerFilename,TargetOS,TargetCPU,'',FPCSrcDir,true);
|
CompilerFilename,TargetOS,TargetCPU,SubTarget,'',FPCSrcDir,true);
|
||||||
GatherFPCExecutable(UnitSetCache,sl);
|
GatherFPCExecutable(UnitSetCache,sl);
|
||||||
|
|
||||||
ValuesMemo.Lines.Assign(sl);
|
ValuesMemo.Lines.Assign(sl);
|
||||||
@ -138,10 +138,7 @@ end;
|
|||||||
|
|
||||||
procedure TIDEFPCInfoDialog.UpdateCmdLinePage;
|
procedure TIDEFPCInfoDialog.UpdateCmdLinePage;
|
||||||
var
|
var
|
||||||
TargetOS: String;
|
TargetOS, TargetCPU, SubTarget, CompilerFilename, CompilerOptions: String;
|
||||||
TargetCPU: String;
|
|
||||||
CompilerFilename: String;
|
|
||||||
CompilerOptions: String;
|
|
||||||
Cfg: TPCTargetConfigCache;
|
Cfg: TPCTargetConfigCache;
|
||||||
Params: String;
|
Params: String;
|
||||||
ExtraOptions: String;
|
ExtraOptions: String;
|
||||||
@ -191,8 +188,9 @@ begin
|
|||||||
// fpc -va
|
// fpc -va
|
||||||
TargetOS:=BuildBoss.GetTargetOS;
|
TargetOS:=BuildBoss.GetTargetOS;
|
||||||
TargetCPU:=BuildBoss.GetTargetCPU;
|
TargetCPU:=BuildBoss.GetTargetCPU;
|
||||||
|
SubTarget:=BuildBoss.GetSubTarget;
|
||||||
Cfg:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
Cfg:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
||||||
CompilerFilename,CompilerOptions,TargetOS,TargetCPU,true);
|
CompilerFilename,CompilerOptions,TargetOS,TargetCPU,SubTarget,true);
|
||||||
TestFilename:=CodeToolBoss.CompilerDefinesCache.TestFilename;
|
TestFilename:=CodeToolBoss.CompilerDefinesCache.TestFilename;
|
||||||
Filename:=ExtractFileName(TestFilename);
|
Filename:=ExtractFileName(TestFilename);
|
||||||
WorkDir:=ExtractFilePath(TestFilename);
|
WorkDir:=ExtractFilePath(TestFilename);
|
||||||
@ -293,6 +291,7 @@ begin
|
|||||||
sl.Add('Active target:');
|
sl.Add('Active target:');
|
||||||
sl.Add('TargetOS='+BuildBoss.GetTargetOS);
|
sl.Add('TargetOS='+BuildBoss.GetTargetOS);
|
||||||
sl.Add('TargetCPU='+BuildBoss.GetTargetCPU);
|
sl.Add('TargetCPU='+BuildBoss.GetTargetCPU);
|
||||||
|
sl.Add('SubTarget='+BuildBoss.GetSubTarget);
|
||||||
sl.Add('');
|
sl.Add('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ begin
|
|||||||
sl.Add('FPC source directory='+EnvironmentOptions.FPCSourceDirectory);
|
sl.Add('FPC source directory='+EnvironmentOptions.FPCSourceDirectory);
|
||||||
sl.Add('Real FPC source directory='+EnvironmentOptions.GetParsedFPCSourceDirectory);
|
sl.Add('Real FPC source directory='+EnvironmentOptions.GetParsedFPCSourceDirectory);
|
||||||
CfgCache:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
CfgCache:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
||||||
LazarusIDE.GetFPCompilerFilename,'','','',true);
|
LazarusIDE.GetFPCompilerFilename,true);
|
||||||
if CheckFPCSrcDirQuality(EnvironmentOptions.GetParsedFPCSourceDirectory,Note,
|
if CheckFPCSrcDirQuality(EnvironmentOptions.GetParsedFPCSourceDirectory,Note,
|
||||||
CfgCache.GetFPCVer)<>sddqCompatible
|
CfgCache.GetFPCVer)<>sddqCompatible
|
||||||
then
|
then
|
||||||
|
@ -949,7 +949,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// check compiler again
|
// check compiler again
|
||||||
CfgCache:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
CfgCache:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
||||||
fLastParsedCompiler,'','','',true);
|
fLastParsedCompiler,true);
|
||||||
CfgCache.CompilerDate:=0; // force update
|
CfgCache.CompilerDate:=0; // force update
|
||||||
if CfgCache.NeedsUpdate then
|
if CfgCache.NeedsUpdate then
|
||||||
CfgCache.Update(CodeToolBoss.CompilerDefinesCache.TestFilename);
|
CfgCache.Update(CodeToolBoss.CompilerDefinesCache.TestFilename);
|
||||||
|
@ -393,7 +393,7 @@ begin
|
|||||||
if TestSrcFilename<>'' then
|
if TestSrcFilename<>'' then
|
||||||
begin
|
begin
|
||||||
CfgCache:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
CfgCache:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
||||||
AFilename,'','','',true);
|
AFilename,true);
|
||||||
if CfgCache.NeedsUpdate then
|
if CfgCache.NeedsUpdate then
|
||||||
CfgCache.Update(TestSrcFilename);
|
CfgCache.Update(TestSrcFilename);
|
||||||
i:=CfgCache.IndexOfUsedCfgFile;
|
i:=CfgCache.IndexOfUsedCfgFile;
|
||||||
@ -700,7 +700,7 @@ begin
|
|||||||
if TestSrcFilename<>'' then
|
if TestSrcFilename<>'' then
|
||||||
begin
|
begin
|
||||||
CfgCache:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
CfgCache:=CodeToolBoss.CompilerDefinesCache.ConfigCaches.Find(
|
||||||
AFilename,'','','',true);
|
AFilename,true);
|
||||||
if CfgCache.NeedsUpdate then
|
if CfgCache.NeedsUpdate then
|
||||||
CfgCache.Update(TestSrcFilename);
|
CfgCache.Update(TestSrcFilename);
|
||||||
i:=CfgCache.IndexOfUsedCfgFile;
|
i:=CfgCache.IndexOfUsedCfgFile;
|
||||||
|
Loading…
Reference in New Issue
Block a user