Browse Source

Add -sp option to skip compilation of programs even for native compilation

Pierre Muller 1 month ago
parent
commit
9b984980d5
1 changed files with 14 additions and 3 deletions
  1. 14 3
      packages/fpmkunit/src/fpmkunit.pp

+ 14 - 3
packages/fpmkunit/src/fpmkunit.pp

@@ -1186,6 +1186,7 @@ Type
     FExamplesInstallDir : String;
     FSingleFPDocFile: Boolean;
     FSearchPath: TStrings;
+    FSkipPrograms: boolean;
     FSkipCrossPrograms: boolean;
     FThreadsAmount: integer;
     FRemoveTree: String;
@@ -1319,6 +1320,7 @@ Type
     // Installation optioms
     Property InstallExamples: Boolean read FInstallExamples write FInstallExamples;
     Property SkipCrossPrograms: boolean read FSkipCrossPrograms write FSkipCrossPrograms;
+    Property SkipPrograms: boolean read FSkipPrograms write FSkipPrograms;
   end;
 
   { TBasicDefaults }
@@ -2049,6 +2051,7 @@ ResourceString
   SHelpInteractive    = 'Allow to interact with child processes';
   SHelpInstExamples   = 'Install the example-sources.';
   SHelpSkipCrossProgs = 'Skip programs when cross-compiling/installing';
+  SHelpSkipProgs      = 'Skip programs even if native-compiling/installing';
   SHelpIgnoreInvOpt   = 'Ignore further invalid options.';
   sHelpFpdocOutputDir = 'Use indicated directory as fpdoc output folder.';
   sHelpSingleFpdocFile = 'Create a single fpdoc project file for all projects';
@@ -2098,6 +2101,7 @@ Const
   KeyExamplesInstallDir = 'ExamplesInstallDir';
   KeyInstallExamples    = 'InstallExamples';
   KeySkipCrossProdrams  = 'SkipCrossPrograms';
+  KeySkipProdrams       = 'SkipPrograms';
   // Keys for unit config
   KeyName     = 'Name';
   KeyVersion  = 'Version';
@@ -5855,6 +5859,8 @@ begin
           Values[KeyInstallExamples]:='Y';
       if FSkipCrossPrograms then
         Values[KeySkipCrossProdrams]:='Y';
+      if FSkipPrograms then
+        Values[KeySkipProdrams]:='Y';
       end;
     L.SaveToStream(S);
   Finally
@@ -5914,6 +5920,7 @@ begin
       FExamplesInstallDir:=Values[KeyExamplesInstallDir];
       FInstallExamples:=(Upcase(Values[KeyInstallExamples])='Y');
       FSkipCrossPrograms:=(Upcase(Values[KeySkipCrossProdrams])='Y');
+      FSkipPrograms:=(Upcase(Values[KeySkipProdrams])='Y');
       FNoFPCCfg:=(Upcase(Values[KeyNoFPCCfg])='Y');
       FUseEnvironment:=(Upcase(Values[KeyUseEnv])='Y');
 
@@ -6370,6 +6377,8 @@ begin
       DefaultsFileName:=OptionArg(I)
     else if CheckOption(I,'ie','installexamples') then
       Defaults.InstallExamples:=true
+    else if CheckOption(I,'sp','skipprograms') then
+      Defaults.SkipPrograms:=true
     else if CheckOption(I,'scp','skipcrossprograms') then
       Defaults.SkipCrossPrograms:=true
     else if CheckOption(I,'bu','buildunit') then
@@ -6457,6 +6466,7 @@ begin
 {$endif}
   LogOption('ie','installexamples',SHelpInstExamples);
   LogOption('bu','buildunit',SHelpUseBuildUnit);
+  LogOption('sp','skipprograms',SHelpSkipProgs);
   LogOption('scp','skipcrossprograms',SHelpSkipCrossProgs);
   LogOption('io','ignoreinvalidoption',SHelpIgnoreInvOpt);
   LogArgOption('C','cpu',SHelpCPU);
@@ -8189,9 +8199,10 @@ function TBuildEngine.TargetOK(ATarget: TTarget; const aCompileTarget : TCompile
 
 
 begin
-  if Defaults.SkipCrossPrograms and
-     (ATarget.TargetType in ProgramTargets) and
-     IsDifferentFromBuild(aCOmpileTarget.CPU, aCOmpileTarget.OS) then
+  if (ATarget.TargetType in ProgramTargets) and
+     (Defaults.SkipPrograms or
+      (Defaults.SkipCrossPrograms and
+       IsDifferentFromBuild(aCOmpileTarget.CPU, aCOmpileTarget.OS))) then
     result := False
   else
     Result:=(aCompileTarget.CPU in ATarget.CPUs)