|
@@ -4462,6 +4462,7 @@ end;
|
|
|
function TBuildEngine.CheckExternalPackage(Const APackageName : String):TPackage;
|
|
|
var
|
|
|
S : String;
|
|
|
+ F : String;
|
|
|
I : Integer;
|
|
|
begin
|
|
|
// Already checked?
|
|
@@ -4481,11 +4482,25 @@ begin
|
|
|
Log(vldebug, SDbgExternalDependency, [APackageName,S]);
|
|
|
Result.FTargetState:=tsInstalled;
|
|
|
// Load unit config if it exists
|
|
|
- S:=IncludeTrailingPathDelimiter(S)+UnitConfigFile;
|
|
|
- if FileExists(S) then
|
|
|
+ F:=IncludeTrailingPathDelimiter(S)+UnitConfigFile;
|
|
|
+ if FileExists(F) then
|
|
|
begin
|
|
|
- Log(vlDebug, Format(SDbgLoading, [S]));
|
|
|
- Result.LoadUnitConfigFromFile(S);
|
|
|
+ Log(vlDebug, Format(SDbgLoading, [F]));
|
|
|
+ Result.LoadUnitConfigFromFile(F);
|
|
|
+ end
|
|
|
+ else if FileExists(IncludeTrailingPathDelimiter(S)+FPMakePPFile) then
|
|
|
+ begin
|
|
|
+ // The package is not installed, but the source-path is given.
|
|
|
+ // It is an external package so it is impossible to compile it, so
|
|
|
+ // assume that it has been compiled earlier.
|
|
|
+ F := IncludeTrailingPathDelimiter(Result.UnitDir) + Result.GetUnitsOutputDir(Defaults.CPU,Defaults.OS);
|
|
|
+ // If the unit-directory does not exist, you know for sure that
|
|
|
+ // the package is not compiled
|
|
|
+ if DirectoryExists(F) then
|
|
|
+ begin
|
|
|
+ Result.UnitDir := F;
|
|
|
+ Result.FTargetState:=tsCompiled;
|
|
|
+ end;
|
|
|
end;
|
|
|
// Check recursive implicit dependencies
|
|
|
CompileDependencies(Result);
|