IDE: warn for macro cicles in project compiler options dialog, bug #18461

git-svn-id: trunk@29198 -
This commit is contained in:
mattias 2011-01-25 18:09:42 +00:00
parent 4a27b745a3
commit d9cc4dbb7f

View File

@ -7,7 +7,7 @@ interface
uses uses
Classes, SysUtils, LCLProc, FileUtil, Forms, Controls, Dialogs, Graphics, Classes, SysUtils, LCLProc, FileUtil, Forms, Controls, Dialogs, Graphics,
Buttons, StdCtrls, LCLType, InterfaceBase, Buttons, StdCtrls, LCLType, InterfaceBase,
IDEOptionsIntf, MacroIntf, IDEOptionsIntf, MacroIntf, IDEDialogs,
Project, CompilerOptions, LazarusIDEStrConsts, PathEditorDlg, LazConf, Project, CompilerOptions, LazarusIDEStrConsts, PathEditorDlg, LazConf,
IDEProcs, CheckCompilerOpts, ShowCompilerOpts, MainIntf; IDEProcs, CheckCompilerOpts, ShowCompilerOpts, MainIntf;
@ -131,9 +131,13 @@ var
NewParsedDebugPath:=FCompilerOpts.GetDebugPath(False,coptParsed,false); NewParsedDebugPath:=FCompilerOpts.GetDebugPath(False,coptParsed,false);
end; end;
var
o: TParsedCompilerOptString;
Msg: String;
begin begin
GetParsedPaths; Result:=false;
GetParsedPaths;
OldParsedIncludePath := NewParsedIncludePath; OldParsedIncludePath := NewParsedIncludePath;
OldUnparsedIncludePath := FCompilerOpts.IncludePath; OldUnparsedIncludePath := FCompilerOpts.IncludePath;
@ -146,7 +150,6 @@ begin
OldParsedDebugPath := NewParsedDebugPath; OldParsedDebugPath := NewParsedDebugPath;
OldUnparsedDebugPath := FCompilerOpts.DebugPath; OldUnparsedDebugPath := FCompilerOpts.DebugPath;
Result:=false;
try try
FCompilerOpts.IncludePath := IncludeFilesEdit.Text; FCompilerOpts.IncludePath := IncludeFilesEdit.Text;
FCompilerOpts.Libraries := LibrariesEdit.Text; FCompilerOpts.Libraries := LibrariesEdit.Text;
@ -155,6 +158,40 @@ begin
FCompilerOpts.DebugPath := DebugPathEdit.Text; FCompilerOpts.DebugPath := DebugPathEdit.Text;
GetParsedPaths; GetParsedPaths;
if FCompilerOpts.ParsedOpts.HasParsedError then begin
o:=FCompilerOpts.ParsedOpts.ParsedErrorOption;
case o of
pcosBaseDir:
Msg:='I wonder how you did that: Error in the base directory:';
pcosUnitPath:
Msg:='Error in the search path for "Other unit files":';
pcosIncludePath:
Msg:='Error in the search path for "Include files":';
pcosObjectPath:
Msg:='Error in the search path for "Object files":';
pcosLibraryPath:
Msg:='Error in the search path for "Libraries":';
pcosSrcPath:
Msg:='Error in the search path for "Other sources":';
pcosLinkerOptions:
Msg:='Error in the custom linker options (Linking / Pass options to linker):';
pcosCustomOptions:
Msg:='Error in the custom compiler options (Other):';
pcosOutputDir:
Msg:='Error in the "unit output directory":';
pcosCompilerPath:
Msg:='Error in the compiler file name:';
pcosDebugPath:
Msg:='Error in the "Debugger path addition":';
else
Msg:='I wonder how you did that. Error in the '+ParsedCompilerOptStringNames[o]+':';
end;
Msg:=Msg+#13+FCompilerOpts.ParsedOpts.ParsedErrorMsg+#13
+'Value: '+dbgstr(FCompilerOpts.ParsedOpts.UnparsedValues[o]);
IDEMessageDialog('Error',Msg,mtError,[mbCancel]);
exit;
end;
if not CheckPutSearchPath('include search path', OldParsedIncludePath, NewParsedIncludePath) then if not CheckPutSearchPath('include search path', OldParsedIncludePath, NewParsedIncludePath) then
Exit; Exit;
if not CheckPutSearchPath('library search path', OldParsedLibraryPath, NewParsedLibraries) then if not CheckPutSearchPath('library search path', OldParsedLibraryPath, NewParsedLibraries) then