lazbuild: -q -q passes -vw-n-h-i-l-d-u-t-p-c-x- to the compiler

git-svn-id: trunk@48698 -
This commit is contained in:
mattias 2015-04-10 19:19:09 +00:00
parent 894fe3d7d4
commit a96cfe9231
2 changed files with 68 additions and 49 deletions

View File

@ -52,7 +52,7 @@ uses
IDEOptionsIntf, IDEOptionsIntf,
// IDE // IDE
LazarusIDEStrConsts, IDEProcs, LazConf, TransferMacros, etFPCMsgParser, LazarusIDEStrConsts, IDEProcs, LazConf, TransferMacros, etFPCMsgParser,
ModeMatrixOpts, CompOptsModes, EnvironmentOpts; IDECmdLine, ModeMatrixOpts, CompOptsModes, EnvironmentOpts;
const const
DefaultCompilerPath = '$(CompPath)'; DefaultCompilerPath = '$(CompPath)';
@ -2448,7 +2448,7 @@ end;
function TBaseCompilerOptions.MakeOptionsString( function TBaseCompilerOptions.MakeOptionsString(
Flags: TCompilerCmdLineOptions): String; Flags: TCompilerCmdLineOptions): String;
var var
switches, tempsw, t: String; switches, tempsw, quietsw, t: String;
InhLinkerOpts: String; InhLinkerOpts: String;
NewTargetFilename: String; NewTargetFilename: String;
NewTargetDirectory: String; NewTargetDirectory: String;
@ -2472,13 +2472,22 @@ var
FPCompilerFilename: String; FPCompilerFilename: String;
s: string; s: string;
CurFPCMsgFile: TFPCMsgFilePoolItem; CurFPCMsgFile: TFPCMsgFilePoolItem;
Quiet: Boolean;
procedure EnableDisableVerbosityFlag(Enable: boolean; c: char); procedure EnableDisableVerbosityFlag(Enable: boolean; c: char);
begin begin
if Enable then if Quiet or not Enable then
tempsw+=c quietsw+=c+'-'
else else
switches+=' -v'+c+'-'; tempsw+=c;
end;
procedure EnableVerbosityFlag(Enable: boolean; c: char);
begin
if Quiet then
quietsw+=c+'-'
else if Enable then
tempsw+=c;
end; end;
begin begin
@ -2734,7 +2743,7 @@ begin
Supported Microcontroller types: Supported Microcontroller types:
} }
Quiet:=ConsoleVerbosity<=-3; // lazbuild -q -q, lazarus -q -q -q
CurTargetOS:=''; CurTargetOS:='';
CurTargetCPU:=''; CurTargetCPU:='';
@ -2932,42 +2941,40 @@ begin
{ ---------------- Other Tab -------------------- } { ---------------- Other Tab -------------------- }
{ Verbosity } { Verbosity }
if (WriteFPCLogo) then if Quiet then
switches := switches + ' -l-'
else if WriteFPCLogo then
switches := switches + ' -l'; switches := switches + ' -l';
tempsw := ''; tempsw := '';
quietsw := '';
// the default fpc.cfg normally contains -viwn, if the user does not want // the default fpc.cfg normally contains -viwn, if the user does not want
// to see warning pass -vw- // to see warnings pass -vw-
tempsw := tempsw + 'e'; // always pass -ve, you cannot ignore errors tempsw := tempsw + 'e'; // always pass -ve, you cannot ignore errors
EnableDisableVerbosityFlag(ShowWarn,'w'); EnableDisableVerbosityFlag(ShowWarn,'w');
EnableDisableVerbosityFlag(ShowNotes,'n'); EnableDisableVerbosityFlag(ShowNotes,'n');
EnableDisableVerbosityFlag(ShowHints,'h'); EnableDisableVerbosityFlag(ShowHints,'h');
tempsw := tempsw + 'i'; // always pass -vi, (e.g. (3104) Compiling) needed to resolve filenames in fpc messages without path // always pass -vi for IDE, (e.g. (3104) Compiling) needed to resolve filenames in fpc messages without path
if ShowLineNum then EnableVerbosityFlag(true,'i');
tempsw := tempsw + 'l'; // optional verbosity flags, usually off in fpc.cfg, pass them only if wanted
if ShowDebugInfo then EnableVerbosityFlag(ShowLineNum,'l');
tempsw := tempsw + 'd'; EnableVerbosityFlag(ShowDebugInfo,'d');
if ShowUsedFiles then EnableVerbosityFlag(ShowUsedFiles,'u');
tempsw := tempsw + 'u'; EnableVerbosityFlag(ShowTriedFiles,'t');
if ShowTriedFiles then EnableVerbosityFlag(ShowCompProc,'p');
tempsw := tempsw + 't'; EnableVerbosityFlag(ShowCond,'c');
if ShowCompProc then EnableVerbosityFlag(ShowExecInfo,'x');
tempsw := tempsw + 'p';
if ShowCond then
tempsw := tempsw + 'c';
if ShowExecInfo then
tempsw := tempsw + 'x';
if ShowAll or (ccloAddVerboseAll in Flags) then if (ShowAll and not (Quiet)) or (ccloAddVerboseAll in Flags) then
tempsw := 'a'; tempsw := 'a';
tempsw := tempsw + 'bq'; // b = full file names, q = message ids tempsw := tempsw + 'bq'; // b = full file names, q = message ids
if (tempsw <> '') then begin if (tempsw <> '') then
tempsw := '-v' + tempsw; switches := switches + ' -v' + tempsw;
switches := switches + ' ' + tempsw; if (quietsw <> '') then
end; switches := switches + ' -v' + quietsw;
// -vm flags allow to enable/disable types of messages // -vm flags allow to enable/disable types of messages
// Passing a -vm ID, unknown by the current compiler will create an error // Passing a -vm ID, unknown by the current compiler will create an error
// => check the compiler message file // => check the compiler message file
if IDEMessageFlags.Count>0 then begin if IDEMessageFlags.Count>0 then begin
@ -2997,9 +3004,8 @@ begin
{ Use Custom Config File @ = yes and path } { Use Custom Config File @ = yes and path }
if not (ccloNoMacroParams in Flags) if not (ccloNoMacroParams in Flags)
and (CustomConfigFile) and (ConfigFilePath<>'') then begin and (CustomConfigFile) and (ConfigFilePath<>'') then
switches := switches + ' ' + PrepareCmdLineOption('@' + ConfigFilePath); switches := switches + ' ' + PrepareCmdLineOption('@' + ConfigFilePath);
end;
{ ------------- Search Paths ---------------- } { ------------- Search Paths ---------------- }
CurOutputDir:=''; CurOutputDir:='';

View File

@ -1643,37 +1643,51 @@ const
begin begin
Result:=UTF8ToConsole(BreakString(s,75, length(space))) Result:=UTF8ToConsole(BreakString(s,75, length(space)))
end; end;
procedure w(Msg: string);
begin
writeln(LongToConsole(Msg));
end;
begin begin
TranslateResourceStrings(ProgramDirectory(true),''); TranslateResourceStrings(ProgramDirectory(true),'');
writeln(''); writeln('');
writeln('lazbuild [options] <project/package filename or package name>'); writeln('lazbuild [options] <project/package filename or package name>');
writeln(''); writeln('');
writeln(UTF8ToConsole(lisEdtExtToolParameters)); w(lisEdtExtToolParameters);
writeln(''); writeln('');
writeln('--help or -? ', UTF8ToConsole(listhisHelpMessage)); writeln('--help or -?');
writeln(''); w(space+listhisHelpMessage);
writeln('-B or --build-all ', UTF8ToConsole(lisBuildAllFilesOfProjectPackageIDE)); writeln('-B or --build-all');
writeln('-r or --recursive ', UTF8ToConsole(lisApplyBuildFlagsBToDependenciesToo)); w(space+lisBuildAllFilesOfProjectPackageIDE);
writeln('-d or --skip-dependencies ', UTF8ToConsole(lisDoNotCompileDependencies)); writeln('-r or --recursive');
writeln('--build-ide=<options> ', UTF8ToConsole(lisBuildIDEWithPackages)); w(space+lisApplyBuildFlagsBToDependenciesToo);
writeln('-v or --version ', UTF8ToConsole(lisShowVersionAndExit)); writeln('-d or --skip-dependencies');
writeln('-q or --quiet ', UTF8ToConsole(lisBeLessVerboseCanBeGivenMultipleTimes)); w(space+lisDoNotCompileDependencies);
writeln('--verbose ', UTF8ToConsole(lisBeMoreVerboseCanBeGivenMultipleTimes)); writeln('--build-ide=<options>');
w(space+lisBuildIDEWithPackages);
writeln('-v or --version');
w(space+lisShowVersionAndExit);
writeln('-q or --quiet');
w(space+lisBeLessVerboseCanBeGivenMultipleTimes);
w(space+'Passing quiet two times, will pass -vw-n-h-i-l-d-u-t-p-c-x- to the compiler');
writeln('--verbose');
w(space+lisBeMoreVerboseCanBeGivenMultipleTimes);
writeln(''); writeln('');
writeln('--add-package'); writeln('--add-package');
writeln(LongToConsole(space+lisAddPackageSToListOfInstalledPackagesCombineWithBui)); w(space+lisAddPackageSToListOfInstalledPackagesCombineWithBui);
writeln('--create-makefile'); writeln('--create-makefile');
writeln(LongToConsole(space+lisInsteadOfCompilePackageCreateASimpleMakefile)); w(space+lisInsteadOfCompilePackageCreateASimpleMakefile);
writeln(''); writeln('');
writeln(PrimaryConfPathOptLong,'<path>'); writeln(PrimaryConfPathOptLong,'<path>');
writeln('or ',PrimaryConfPathOptShort,'<path>'); writeln('or ',PrimaryConfPathOptShort,'<path>');
writeln(LongToConsole(space+lisprimaryConfigDirectoryWhereLazarusStoresItsConfig+LazConf.GetPrimaryConfigPath)); w(space+lisprimaryConfigDirectoryWhereLazarusStoresItsConfig+LazConf.GetPrimaryConfigPath);
writeln(''); writeln('');
writeln(SecondaryConfPathOptLong,'<path>'); writeln(SecondaryConfPathOptLong,'<path>');
writeln('or ',SecondaryConfPathOptShort,'<path>'); writeln('or ',SecondaryConfPathOptShort,'<path>');
writeln(LongToConsole(space+lissecondaryConfigDirectoryWhereLazarusSearchesFor+LazConf.GetSecondaryConfigPath)); w(space+lissecondaryConfigDirectoryWhereLazarusSearchesFor+LazConf.GetSecondaryConfigPath);
writeln(''); writeln('');
writeln('--operating-system=<operating-system>'); writeln('--operating-system=<operating-system>');
writeln('or --os=<operating-system>'); writeln('or --os=<operating-system>');
@ -1701,14 +1715,13 @@ begin
lisOverrideTheDefaultCompilerEGPpc386Ppcx64PpcppcEtcD, [space]))); lisOverrideTheDefaultCompilerEGPpc386Ppcx64PpcppcEtcD, [space])));
writeln(''); writeln('');
writeln(LanguageOpt); writeln(LanguageOpt);
writeln(LongToConsole(space+lisOverrideLanguage)); w(space+lisOverrideLanguage);
writeln(''); writeln('');
writeln('--lazarusdir=<Lazarus directory>'); writeln('--lazarusdir=<Lazarus directory>');
writeln(LongToConsole(space+lisLazarusDirOverride)); w(space+lisLazarusDirOverride);
writeln(''); writeln('');
writeln('--max-process-count=<count>'); writeln('--max-process-count=<count>');
writeln(LongToConsole(space+ w(space+lisMaximumNumberOfThreadsForCompilingInParallelDefaul);
lisMaximumNumberOfThreadsForCompilingInParallelDefaul));
writeln(''); writeln('');
end; end;