mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 02:52:29 +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;
|
||||
LazarusSrcDefines: TDefineTemplate;
|
||||
ATestPascalFile: String;
|
||||
CurFPCOptions: String;
|
||||
|
||||
procedure AddFPCOption(s: string);
|
||||
begin
|
||||
if s='' then exit;
|
||||
if CurFPCOptions<>'' then
|
||||
CurFPCOptions:=CurFPCOptions+' ';
|
||||
CurFPCOptions:=CurFPCOptions+s;
|
||||
end;
|
||||
|
||||
begin
|
||||
// set global values
|
||||
with GlobalValues do begin
|
||||
@ -866,10 +876,17 @@ begin
|
||||
ATestPascalFile:=Config.TestPascalFile;
|
||||
if ATestPascalFile='' then
|
||||
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,
|
||||
FPCUnitPath, TargetOS, TargetProcessor,
|
||||
nil);
|
||||
if Config.TargetOS='' then
|
||||
Config.TargetOS:=TargetOS;
|
||||
if Config.TargetProcessor='' then
|
||||
Config.TargetProcessor:=TargetProcessor;
|
||||
if FPCDefines=nil then begin
|
||||
raise Exception.Create('TCodeToolManager.Init: Unable to execute '+Config.FPCPath+' to get compiler values');
|
||||
end;
|
||||
|
@ -2971,7 +2971,7 @@ var CmdLine: string;
|
||||
Step: String;
|
||||
begin
|
||||
Result:=nil;
|
||||
//DebugLn('TDefinePool.CreateFPCTemplate PPC386Path="',CompilerPath,'" PPCOptions="',CompilerOptions,'"');
|
||||
DebugLn('TDefinePool.CreateFPCTemplate PPC386Path="',CompilerPath,'" FPCOptions="',CompilerOptions,'"');
|
||||
if TestPascalFile='' then begin
|
||||
DebugLn(['WARNING: TDefinePool.CreateFPCTemplate TestPascalFile empty']);
|
||||
end;
|
||||
|
@ -17,6 +17,7 @@ var
|
||||
begin
|
||||
// setup the Options
|
||||
CodeToolBoss.SimpleInit(ConfigFilename);
|
||||
writeln('AAA ',CodeToolBoss.GetIncludePathForDirectory('/home/mattias/pascal/fpc_sources/23/fpc/rtl/win32'));
|
||||
|
||||
// Example: find declaration of 'TObject'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user