mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 13:39:30 +02:00
pas2jsdsgn: using CompilerPath
git-svn-id: trunk@57911 -
This commit is contained in:
parent
ee7e7c077c
commit
f3fa5cd498
@ -5,7 +5,8 @@ unit pjsprojectoptions;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Forms, Controls, StdCtrls, ExtCtrls, Spin, projectintf, CompOptsIntf, IDEOptionsIntf;
|
Classes, SysUtils, Forms, Controls, StdCtrls, ExtCtrls, Spin, projectintf,
|
||||||
|
CompOptsIntf, IDEOptionsIntf, LazLoggerBase;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -77,31 +78,53 @@ begin
|
|||||||
RunParams.LaunchingApplicationPathPlusParams:='$(Pas2JSNodeJS) "$MakeDir($(ProjPath))$NameOnly($(ProjFile)).js"';
|
RunParams.LaunchingApplicationPathPlusParams:='$(Pas2JSNodeJS) "$MakeDir($(ProjPath))$NameOnly($(ProjFile)).js"';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure SetPasJSCompileOptions(CompOpts: TLazCompilerOptions; Opts : String);
|
Procedure SetPasJSCompileOptions(CompOpts: TLazCompilerOptions;
|
||||||
|
TargetOS, CustomOpts : String);
|
||||||
|
|
||||||
Var
|
Var
|
||||||
Compiler : String;
|
Compiler : String;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
CompOpts.Win32GraphicApp:=false;
|
DebugLn(['SetPasJSCompileOptions START']);
|
||||||
CompOpts.UnitOutputDirectory:='js';
|
CompOpts.UnitOutputDirectory:='js';
|
||||||
if Length(PJSOptions.CompilerFilename)=0 then
|
|
||||||
Compiler:='$MakeExe(pas2js)'
|
CompOpts.TargetFileExt:='.js';
|
||||||
|
CompOpts.TargetOS:=TargetOS;
|
||||||
|
|
||||||
|
CompOpts.AllowLabel:=false;
|
||||||
|
CompOpts.UseAnsiStrings:=false;
|
||||||
|
|
||||||
|
CompOpts.IOChecks:=false;
|
||||||
|
CompOpts.StackChecks:=false;
|
||||||
|
CompOpts.SmartLinkUnit:=false;
|
||||||
|
|
||||||
|
CompOpts.GenerateDebugInfo:=false;
|
||||||
|
CompOpts.DebugInfoType:=dsAuto;
|
||||||
|
CompOpts.UseLineInfoUnit:=false;
|
||||||
|
CompOpts.UseHeaptrc:=false;
|
||||||
|
CompOpts.Win32GraphicApp:=false;
|
||||||
|
|
||||||
|
CompOpts.WriteFPCLogo:=true;
|
||||||
|
CompOpts.CustomOptions:=CustomOpts;
|
||||||
|
|
||||||
|
if PJSOptions.CompilerFilename='' then
|
||||||
|
Compiler:='$MakeExe(pas2js)'
|
||||||
else
|
else
|
||||||
Compiler:=AnsiQuotedStr(PJSOptions.CompilerFilename, '"');
|
Compiler:=PJSOptions.CompilerFilename;
|
||||||
CompOpts.SetAlternativeCompile(Compiler+' '+Opts,true);
|
CompOpts.CompilerPath:=Compiler;
|
||||||
|
debugln(['Hint: (lazarus) [pjsprojectoptions.SetPasJSCompileOptions] Compiler=',CompOpts.CompilerPath,' TargetOS=',CompOpts.TargetOS,' Custom="',CompOpts.CustomOptions,'"']);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure SetDefaultWebCompileOptions(CompOpts: TLazCompilerOptions);
|
Procedure SetDefaultWebCompileOptions(CompOpts: TLazCompilerOptions);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
SetPasJSCompileOptions(CompOpts,'-Jirtl.js -Jc -Jminclude -Tbrowser "-Fu$(ProjUnitPath)" $Name($(ProjFile))');
|
SetPasJSCompileOptions(CompOpts,'browser','-Jeutf-8 -Jirtl.js -Jc -Jminclude');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure SetDefaultNodeJSCompileOptions(CompOpts: TLazCompilerOptions);
|
Procedure SetDefaultNodeJSCompileOptions(CompOpts: TLazCompilerOptions);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
SetPasJSCompileOptions(CompOpts,'-Jc -Jminclude -Tnodejs "-Fu$(ProjUnitPath)" $Name($(ProjFile))');
|
SetPasJSCompileOptions(CompOpts,'nodejs','-Jeutf-8 -Jminclude');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
Loading…
Reference in New Issue
Block a user