mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 03:56:12 +02:00
codetools: SImpleInit: allow overriding TargetOS
git-svn-id: trunk@17715 -
This commit is contained in:
parent
991a580e12
commit
ef52dfede9
@ -849,6 +849,16 @@ var
|
|||||||
FPCSrcDefines: TDefineTemplate;
|
FPCSrcDefines: TDefineTemplate;
|
||||||
LazarusSrcDefines: TDefineTemplate;
|
LazarusSrcDefines: TDefineTemplate;
|
||||||
ATestPascalFile: String;
|
ATestPascalFile: String;
|
||||||
|
CurFPCOptions: String;
|
||||||
|
|
||||||
|
procedure AddFPCOption(s: string);
|
||||||
|
begin
|
||||||
|
if s='' then exit;
|
||||||
|
if CurFPCOptions<>'' then
|
||||||
|
CurFPCOptions:=CurFPCOptions+' ';
|
||||||
|
CurFPCOptions:=CurFPCOptions+s;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// set global values
|
// set global values
|
||||||
with GlobalValues do begin
|
with GlobalValues do begin
|
||||||
@ -866,10 +876,17 @@ begin
|
|||||||
ATestPascalFile:=Config.TestPascalFile;
|
ATestPascalFile:=Config.TestPascalFile;
|
||||||
if ATestPascalFile='' then
|
if ATestPascalFile='' then
|
||||||
ATestPascalFile:=GetTempFilename('fpctest.pas','');
|
ATestPascalFile:=GetTempFilename('fpctest.pas','');
|
||||||
FPCDefines:=CreateFPCTemplate(Config.FPCPath, Config.FPCOptions,
|
CurFPCOptions:=Config.FPCOptions;
|
||||||
|
if TargetOS<>'' then AddFPCOption('-T'+TargetOS);
|
||||||
|
if TargetProcessor<>'' then AddFPCOption('-Op'+TargetProcessor);
|
||||||
|
FPCDefines:=CreateFPCTemplate(Config.FPCPath, CurFPCOptions,
|
||||||
ATestPascalFile,
|
ATestPascalFile,
|
||||||
FPCUnitPath, TargetOS, TargetProcessor,
|
FPCUnitPath, TargetOS, TargetProcessor,
|
||||||
nil);
|
nil);
|
||||||
|
if Config.TargetOS='' then
|
||||||
|
Config.TargetOS:=TargetOS;
|
||||||
|
if Config.TargetProcessor='' then
|
||||||
|
Config.TargetProcessor:=TargetProcessor;
|
||||||
if FPCDefines=nil then begin
|
if FPCDefines=nil then begin
|
||||||
raise Exception.Create('TCodeToolManager.Init: Unable to execute '+Config.FPCPath+' to get compiler values');
|
raise Exception.Create('TCodeToolManager.Init: Unable to execute '+Config.FPCPath+' to get compiler values');
|
||||||
end;
|
end;
|
||||||
|
@ -2971,7 +2971,7 @@ var CmdLine: string;
|
|||||||
Step: String;
|
Step: String;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
//DebugLn('TDefinePool.CreateFPCTemplate PPC386Path="',CompilerPath,'" PPCOptions="',CompilerOptions,'"');
|
DebugLn('TDefinePool.CreateFPCTemplate PPC386Path="',CompilerPath,'" FPCOptions="',CompilerOptions,'"');
|
||||||
if TestPascalFile='' then begin
|
if TestPascalFile='' then begin
|
||||||
DebugLn(['WARNING: TDefinePool.CreateFPCTemplate TestPascalFile empty']);
|
DebugLn(['WARNING: TDefinePool.CreateFPCTemplate TestPascalFile empty']);
|
||||||
end;
|
end;
|
||||||
|
@ -17,6 +17,7 @@ var
|
|||||||
begin
|
begin
|
||||||
// setup the Options
|
// setup the Options
|
||||||
CodeToolBoss.SimpleInit(ConfigFilename);
|
CodeToolBoss.SimpleInit(ConfigFilename);
|
||||||
|
writeln('AAA ',CodeToolBoss.GetIncludePathForDirectory('/home/mattias/pascal/fpc_sources/23/fpc/rtl/win32'));
|
||||||
|
|
||||||
// Example: find declaration of 'TObject'
|
// Example: find declaration of 'TObject'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user