Forráskód Böngészése

When compiling a package, handle only those units that are not yet part of a package.

pmodules.pas, proc_package:
  * only export units that are part of the package
  * only add units to the package if they are really part of the package
  * don't rewrite the PPU if the unit is not part of the package
  * don't link the unit's files if it is not part of the package

git-svn-id: branches/svenbarth/packages@29041 -
svenbarth 10 éve
szülő
commit
9887293bec
1 módosított fájl, 10 hozzáadás és 5 törlés
  1. 10 5
      compiler/pmodules.pas

+ 10 - 5
compiler/pmodules.pas

@@ -1516,7 +1516,8 @@ type
          uu:=tused_unit(usedunits.first);
          while assigned(uu) do
            begin
-             export_unit(uu.u);
+             if not assigned(uu.u.package) then
+               export_unit(uu.u);
 
              uu:=tused_unit(uu.next);
            end;
@@ -1574,7 +1575,8 @@ type
              uu:=tused_unit(current_module.used_units.first);
              while assigned(uu) do
                begin
-                 pkg.addunit(uu.u);
+                 if not assigned(uu.u.package) then
+                   pkg.addunit(uu.u);
                  uu:=tused_unit(uu.next);
                end;
 
@@ -1584,7 +1586,8 @@ type
              uu:=tused_unit(usedunits.first);
              while assigned(uu) do
                begin
-                 RewritePPU(uu.u.ppufilename,changefileext(uu.u.ppufilename,'.ppl.ppu'));
+                 if not assigned(uu.u.package) then
+                   RewritePPU(uu.u.ppufilename,changefileext(uu.u.ppufilename,'.ppl.ppu'));
                  uu:=tused_unit(uu.next);
                end;
 
@@ -1606,8 +1609,10 @@ type
                  hp:=tmodule(loaded_units.first);
                  while assigned(hp) do
                   begin
-                    { the package itself contains no code so far }
-                    linker.AddModuleFiles(hp);
+                    { only link in those units which should become part of this
+                      package }
+                    if not assigned(hp.package) then
+                      linker.AddModuleFiles(hp);
                     hp2:=tmodule(hp.next);
                     if (hp<>current_module) and
                        (not needsymbolinfo) then