mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 16:19:28 +02:00
lazbuild: fixed compile and fixed compile file.lpi, issue #35832
git-svn-id: trunk@61573 -
This commit is contained in:
parent
f425014164
commit
9fc9ecc3a0
@ -49,7 +49,7 @@ uses
|
|||||||
ProjectIntf, ObjectInspector, IDEWindowIntf, IDEOptionsIntf, IDEOptEditorIntf,
|
ProjectIntf, ObjectInspector, IDEWindowIntf, IDEOptionsIntf, IDEOptEditorIntf,
|
||||||
ComponentReg, IDEExternToolIntf, MacroDefIntf, SrcEditorIntf,
|
ComponentReg, IDEExternToolIntf, MacroDefIntf, SrcEditorIntf,
|
||||||
// DebuggerIntf
|
// DebuggerIntf
|
||||||
DbgIntfDebuggerBase, GDBMIDebugger,
|
DbgIntfDebuggerBase,
|
||||||
// IDE
|
// IDE
|
||||||
IDEProcs, DialogProcs, LazarusIDEStrConsts, IDETranslations, LazConf,
|
IDEProcs, DialogProcs, LazarusIDEStrConsts, IDETranslations, LazConf,
|
||||||
IDEOptionDefs, TransferMacros, ModeMatrixOpts, Debugger,
|
IDEOptionDefs, TransferMacros, ModeMatrixOpts, Debugger,
|
||||||
|
@ -368,43 +368,44 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
OriginalFilename:=FileName;
|
OriginalFilename:=FileName;
|
||||||
|
|
||||||
// Check for packages if the specified name is a valid identifier
|
|
||||||
debugln(['TLazBuildApplication.BuildFile ',OriginalFilename]);
|
|
||||||
if IsValidPkgName(OriginalFileName) then begin
|
|
||||||
if PackageAction=lpaAddPkgLinks then begin
|
|
||||||
Error(ErrorFileNotFound,'lpk file expected, but '+OriginalFilename+' found');
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
// Initialize package graph with base packages etc:
|
|
||||||
if not Init then exit;
|
|
||||||
// Could be a known but not installed package
|
|
||||||
// so try and get package filename from all other known packages
|
|
||||||
Package:=TLazPackageLink(LazPackageLinks.FindLinkWithPkgName(OriginalFileName));
|
|
||||||
if Package=nil then begin
|
|
||||||
// Not found after everything we tried
|
|
||||||
if CompareFileExt(Filename,'.lpi')=0 then
|
|
||||||
Error(ErrorFileNotFound,'file not found: '+OriginalFilename)
|
|
||||||
else
|
|
||||||
Error(ErrorFileNotFound,'package not found: '+OriginalFilename);
|
|
||||||
end
|
|
||||||
else begin
|
|
||||||
// We found a package link
|
|
||||||
case PackageAction of
|
|
||||||
lpaBuild:
|
|
||||||
begin
|
|
||||||
Result:=BuildPackage(Package.LPKFilename);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
lpaInstall:
|
|
||||||
exit(true); // this is handled in AddPackagesToInstallList
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
Filename:=CleanAndExpandFilename(Filename);
|
Filename:=CleanAndExpandFilename(Filename);
|
||||||
if not FileExistsUTF8(Filename) then
|
if not FileExistsUTF8(Filename) then
|
||||||
begin
|
begin
|
||||||
// File is not an identifier and doesn't exist.
|
// File doesn't exist.
|
||||||
|
|
||||||
|
// Check for packages if the specified name is a valid identifier
|
||||||
|
//debugln(['TLazBuildApplication.BuildFile ',OriginalFilename]);
|
||||||
|
if IsValidPkgName(OriginalFileName) then begin
|
||||||
|
if PackageAction=lpaAddPkgLinks then begin
|
||||||
|
Error(ErrorFileNotFound,'lpk file expected, but '+OriginalFilename+' found');
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
// Initialize package graph with base packages etc:
|
||||||
|
if not Init then exit;
|
||||||
|
// Could be a known but not installed package
|
||||||
|
// so try and get package filename from all other known packages
|
||||||
|
Package:=TLazPackageLink(LazPackageLinks.FindLinkWithPkgName(OriginalFileName));
|
||||||
|
if Package=nil then begin
|
||||||
|
// Not found after everything we tried
|
||||||
|
if CompareFileExt(Filename,'.lpi')=0 then
|
||||||
|
Error(ErrorFileNotFound,'file not found: '+OriginalFilename)
|
||||||
|
else
|
||||||
|
Error(ErrorFileNotFound,'package not found: '+OriginalFilename);
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
// We found a package link
|
||||||
|
case PackageAction of
|
||||||
|
lpaBuild:
|
||||||
|
begin
|
||||||
|
Result:=BuildPackage(Package.LPKFilename);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
lpaInstall:
|
||||||
|
exit(true); // this is handled in AddPackagesToInstallList
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Error(ErrorFileNotFound, 'file not found: '+OriginalFilename);
|
Error(ErrorFileNotFound, 'file not found: '+OriginalFilename);
|
||||||
Exit;
|
Exit;
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user