mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 23:49:28 +02:00
IDE: parse namespaces from custom compiler options
git-svn-id: trunk@54751 -
This commit is contained in:
parent
a067dd3411
commit
b382175cfb
@ -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;
|
||||
|
@ -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:='';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user