Browse Source

Add the source directory of all units into UnitPath of APackage for build unit compilation

Pierre Muller 2 months ago
parent
commit
d18812b32f
1 changed files with 6 additions and 1 deletions
  1. 6 1
      packages/fpmkunit/src/fpmkunit.pp

+ 6 - 1
packages/fpmkunit/src/fpmkunit.pp

@@ -8679,7 +8679,7 @@ Var
     L: TStrings;
     F: Text;
     Dep : TDependency;
-    aUnitName : string;
+    aUnitName, aUnitSourceDir : string;
     CompilationFailed: Boolean;
 
   begin
@@ -8698,8 +8698,13 @@ Var
               write(F,',');
             Dep:=APackage.FBUTarget.Dependencies.Dependencies[i];
             aUnitName:=Dep.Value;
+	    aUnitSourceDir:=ExtractFileDir(Dep.TargetFileName);
             if aUnitName='' then
               Writeln('Aloha2');
+            if aUnitSourceDir='' then
+              APackage.UnitPath.Add('.')
+            else
+              APackage.UnitPath.Add(aUnitSourceDir);
             writeln(F,aUnitName);
           end;
         writeln(F,';');