2
0
Эх сурвалжийг харах

* If a found package seems to contain the source of the package, check if the
package is compiled earlier and when that's the case include it's unit
output directory. Usefull if more packages are being compiled manually,
without installing each package.

git-svn-id: trunk@17213 -

joost 14 жил өмнө
parent
commit
103867412a

+ 19 - 4
packages/fpmkunit/src/fpmkunit.pp

@@ -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);