Skip to content

Commit

Permalink
Merge pull request #696 from rcla/fix_pas2js_rtl
Browse files Browse the repository at this point in the history
Fix installation of pas2js_rtl
  • Loading branch information
LongDirtyAnimAlf authored Jul 17, 2024
2 parents 1fc0197 + e41c1ed commit a18d348
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sources/installeruniversal.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2538,7 +2538,7 @@ function TAWGGInstaller.BuildModule(ModuleName: string): boolean;

function TPas2jsInstaller.BuildModule(ModuleName: string): boolean;
var
Workingdir,FilePath:string;
Workingdir,FilePath,OldPathFPCD:string;
idx:integer;
sl:TStringList;
{$ifndef FPCONLY}
Expand Down Expand Up @@ -2578,11 +2578,16 @@ function TPas2jsInstaller.BuildModule(ModuleName: string): boolean;
Processor.Process.Parameters.Clear;
Processor.Executable:=Make;
Processor.Process.CurrentDirectory := ExcludeTrailingPathDelimiter(Workingdir);

//Store the FPCDIR environment variable
OldPathFPCD:=Processor.Environment.GetVar('FPCDIR');

//Processor.SetParamNamePathData('FPC',FCompiler);
Processor.SetParamNamePathData('PP',FCompiler);
//Processor.SetParamNamePathData('PP',ExtractFilePath(FCompiler)+GetCompilerName(GetSourceCPU));
//Processor.SetParamNamePathData('FPCDIR',IncludeTrailingPathDelimiter(Workingdir)+'compiler');

Processor.Environment.SetVar('FPCDIR',FFPCSourceDir);

Processor.SetParamData('clean');
Processor.SetParamData('all');

Expand All @@ -2591,6 +2596,9 @@ function TPas2jsInstaller.BuildModule(ModuleName: string): boolean;
try
ProcessorResult:=Processor.ExecuteAndWait;
result := (ProcessorResult=0);

//Restore FPCDIR environment variable
Processor.Environment.SetVar('FPCDIR',OldPathFPCD);

if (NOT result) then
begin
Expand Down

0 comments on commit a18d348

Please sign in to comment.