IDE: parse namespaces from custom compiler options

git-svn-id: trunk@54751 -
This commit is contained in:
mattias 2017-04-26 19:41:08 +00:00
parent a067dd3411
commit b382175cfb
2 changed files with 13 additions and 33 deletions

View File

@ -100,6 +100,7 @@ const
FPCUnitPathMacro = '$('+FPCUnitPathMacroName+')';
TargetOSMacro = '$('+TargetOSMacroName+')';
TargetCPUMacro = '$('+TargetCPUMacroName+')';
NamespacesMacro = '$('+NamespacesMacroName+')';
// virtual directories
@ -7874,7 +7875,7 @@ var
IncPath: String;
Params: TStrings;
i: Integer;
Param: String;
Param, Namespaces: String;
p: PChar;
begin
Result:=nil;
@ -7883,6 +7884,7 @@ begin
CompilerMode:='';
UnitPath:='';
IncPath:='';
Namespaces:='';
Params:=TStringList.Create;
try
SplitCmdLineParams(CmdLine,Params);
@ -7935,6 +7937,11 @@ begin
CompilerMode:=copy(Param,3,255);
end;
'N':
case p[2] of
'S': Namespaces:=Namespaces+copy(Param,4,length(Param))
end;
'W':
case p[2] of
'p':
@ -7960,10 +7967,12 @@ begin
end;
if AddPaths then begin
if UnitPath<>'' then
AddDefine('UnitPath','UnitPath addition',UnitPathMacroName,UnitPathMacro+UnitPath);
AddDefine('UnitPath','UnitPath addition',UnitPathMacroName,UnitPathMacro+';'+UnitPath);
if IncPath<>'' then
AddDefine('IncPath','IncPath addition',IncludePathMacroName,IncludePathMacro+IncPath);
AddDefine('IncPath','IncPath addition',IncludePathMacroName,IncludePathMacro+';'+IncPath);
end;
if Namespaces<>'' then
AddDefine('Namespaces','Namespaces addition',NamespacesMacroName,NamespacesMacro+';'+Namespaces);
Result.SetDefineOwner(Owner,true);
end;

View File

@ -3170,37 +3170,8 @@ function TBaseCompilerOptions.GetSyntaxOptionsString: string;
var
tempsw: String;
begin
{ Syntax Options
-S<x> Syntax options:
-Sc Support operators like C (*=,+=,/= and -=)
-Sa Turn on assertions
-Se<x> Error options. <x> is a combination of the following:
<n> : Compiler halts after the <n> errors (default is 1)
w : Compiler also halts after warnings
n : Compiler also halts after notes
h : Compiler also halts after hints
-Sg Enable LABEL and GOTO (default in -Mtp and -Mdelphi)
-Sh Use ansistrings by default instead of shortstrings
-Si Turn on inlining of procedures/functions declared as "inline"
-Sk Load fpcylix unit
-SI<x> Set interface style to <x>
-SIcom COM compatible interface (default)
-SIcorba CORBA compatible interface
-Sm Support macros like C (global)
-Ss Constructor name must be init (destructor must be done)
-St Allow static keyword in objects
-Sx Enable exception keywords (default in Delphi/ObjFPC modes)
-M<x> Set language mode to <x>
-Mfpc Free Pascal dialect (default)
-Mobjfpc FPC mode with Object Pascal support
-Mdelphi Delphi 7 compatibility mode
-Mtp TP/BP 7.0 compatibility mode
-Mmacpas Macintosh Pascal dialects compatibility mode
}
if SyntaxMode<>'' then
Result:='-M'+SyntaxMode
Result:='-M'+SyntaxMode // -M<x> Set language mode to <x>
else
Result:='';