瀏覽代碼

pmodules.pas, proc_package:
* add all packages of loaded units as required packages

git-svn-id: branches/svenbarth/packages@32512 -

svenbarth 9 年之前
父節點
當前提交
5705ff44a2
共有 1 個文件被更改,包括 13 次插入2 次删除
  1. 13 2
      compiler/pmodules.pas

+ 13 - 2
compiler/pmodules.pas

@@ -1326,6 +1326,7 @@ type
         force_init_final : boolean;
         uu : tused_unit;
         module_name: ansistring;
+        pentry: ppackageentry;
       begin
          Status.IsPackage:=true;
          Status.IsExe:=true;
@@ -1663,8 +1664,18 @@ type
              hp:=tmodule(loaded_units.first);
              while assigned(hp) do
               begin
-                if (hp<>current_module) and not assigned(hp.package) then
-                  pkg.addunit(hp);
+                if (hp<>current_module) then
+                  begin
+                    if not assigned(hp.package) then
+                      pkg.addunit(hp)
+                    else
+                      begin
+                        pentry:=ppackageentry(packagelist.find(hp.package.packagename^));
+                        if not assigned(pentry) then
+                          internalerror(2015112301);
+                        pkg.add_required_package(hp.package);
+                      end;
+                  end;
                 hp:=tmodule(hp.next);
               end;