Browse Source

* Include package name in warning when file is not found
* Do not try to compile files that do not exist, but raise an error

git-svn-id: trunk@15144 -

joost 15 years ago
parent
commit
df76e4eeb2
1 changed files with 9 additions and 5 deletions
  1. 9 5
      packages/fpmkunit/src/fpmkunit.pp

+ 9 - 5
packages/fpmkunit/src/fpmkunit.pp

@@ -980,6 +980,7 @@ ResourceString
   SErrDependencyNotFound = 'Could not find unit directory for dependency package "%s"';
   SErrDependencyNotFound = 'Could not find unit directory for dependency package "%s"';
   SErrAlreadyInitialized = 'Installer can only be initialized once';
   SErrAlreadyInitialized = 'Installer can only be initialized once';
   SErrInvalidState      = 'Invalid state for target %s';
   SErrInvalidState      = 'Invalid state for target %s';
+  SErrCouldNotCompile   = 'Could not compile target %s from package %s';
 
 
   SWarnCircularTargetDependency = 'Warning: Circular dependency detected when compiling target %s with target %s';
   SWarnCircularTargetDependency = 'Warning: Circular dependency detected when compiling target %s with target %s';
   SWarnCircularPackageDependency = 'Warning: Circular dependency detected when compiling package %s with package %s';
   SWarnCircularPackageDependency = 'Warning: Circular dependency detected when compiling package %s with package %s';
@@ -987,8 +988,8 @@ ResourceString
   SWarnFailedToGetTime    = 'Warning: Failed to get timestamp from file "%s"';
   SWarnFailedToGetTime    = 'Warning: Failed to get timestamp from file "%s"';
   SWarnFileDoesNotExist   = 'Warning: File "%s" does not exist';
   SWarnFileDoesNotExist   = 'Warning: File "%s" does not exist';
   SWarnAttemptingToCompileNonNeutralTarget = 'Warning: Attempting to compile non-neutral target %s';
   SWarnAttemptingToCompileNonNeutralTarget = 'Warning: Attempting to compile non-neutral target %s';
-  SWarnSourceFileNotFound  = 'Warning: Source file "%s" not found for %s';
-  SWarnIncludeFileNotFound = 'Warning: Include file "%s" not found for %s';
+  SWarnSourceFileNotFound  = 'Warning: Source file "%s" from package %s not found for %s';
+  SWarnIncludeFileNotFound = 'Warning: Include file "%s" from package %s not found for %s';
   SWarnDepUnitNotFound     = 'Warning: Dependency on unit %s is not supported for %s';
   SWarnDepUnitNotFound     = 'Warning: Dependency on unit %s is not supported for %s';
 
 
   SInfoCompilingPackage   = 'Compiling package %s';
   SInfoCompilingPackage   = 'Compiling package %s';
@@ -3406,7 +3407,7 @@ Procedure TBuildEngine.ResolveFileNames(APackage : TPackage; ACPU:TCPU;AOS:TOS;D
       Log(vlDebug,SDbgResolvedSourceFile,[T.SourceFileName,T.TargetSourceFileName])
       Log(vlDebug,SDbgResolvedSourceFile,[T.SourceFileName,T.TargetSourceFileName])
     else
     else
       begin
       begin
-        Log(vlWarning,SWarnSourceFileNotFound,[T.SourceFileName,MakeTargetString(ACPU,AOS)]);
+        Log(vlWarning,SWarnSourceFileNotFound,[T.SourceFileName,APackage.Name,MakeTargetString(ACPU,AOS)]);
         T.FTargetSourceFileName:='';
         T.FTargetSourceFileName:='';
       end;
       end;
   end;
   end;
@@ -3444,7 +3445,7 @@ Procedure TBuildEngine.ResolveFileNames(APackage : TPackage; ACPU:TCPU;AOS:TOS;D
                   Log(vlDebug,SDbgResolvedIncludeFile,[D.Value,D.TargetFileName])
                   Log(vlDebug,SDbgResolvedIncludeFile,[D.Value,D.TargetFileName])
                 else
                 else
                   begin
                   begin
-                    Log(vlWarning,SWarnIncludeFileNotFound,[D.Value,MakeTargetString(ACPU,AOS)]);
+                    Log(vlWarning,SWarnIncludeFileNotFound,[D.Value, APackage.Name, MakeTargetString(ACPU,AOS)]);
                     D.TargetFileName:='';
                     D.TargetFileName:='';
                   end;
                   end;
               end;
               end;
@@ -3468,7 +3469,7 @@ Procedure TBuildEngine.ResolveFileNames(APackage : TPackage; ACPU:TCPU;AOS:TOS;D
       Log(vlDebug,SDbgResolvedSourceFile,[T.SourceFileName,T.TargetSourceFileName])
       Log(vlDebug,SDbgResolvedSourceFile,[T.SourceFileName,T.TargetSourceFileName])
     else
     else
       begin
       begin
-        Log(vlWarning,SWarnSourceFileNotFound,[T.SourceFileName,MakeTargetString(ACPU,AOS)]);
+        Log(vlWarning,SWarnSourceFileNotFound,[T.SourceFileName, APackage.Name, MakeTargetString(ACPU,AOS)]);
         T.FTargetSourceFileName:='';
         T.FTargetSourceFileName:='';
       end;
       end;
   end;
   end;
@@ -3607,6 +3608,9 @@ Var
   L,Args : TStringList;
   L,Args : TStringList;
   i : Integer;
   i : Integer;
 begin
 begin
+  if ATarget.TargetSourceFileName = '' then
+    Error(SErrCouldNotCompile,[ATarget.Name, APackage.Name]);
+
   Args:=TStringList.Create;
   Args:=TStringList.Create;
   Args.Duplicates:=dupIgnore;
   Args.Duplicates:=dupIgnore;