mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-22 10:39:23 +02:00
codetools: set defines when setting modeswitches
git-svn-id: trunk@54838 -
This commit is contained in:
parent
09d0b3fa93
commit
a2e22134f1
@ -3500,12 +3500,20 @@ begin
|
|||||||
if Enable then begin
|
if Enable then begin
|
||||||
FCompilerModeSwitches:=FCompilerModeSwitches+Switches;
|
FCompilerModeSwitches:=FCompilerModeSwitches+Switches;
|
||||||
case ModeSwitch of
|
case ModeSwitch of
|
||||||
cmsDefault_unicodestring: Values.Variables['FPC_UNICODESTRINGS'] := '1';
|
cmsDefault_unicodestring:
|
||||||
|
begin
|
||||||
|
Values.Variables['FPC_UNICODESTRINGS'] := '1';
|
||||||
|
Values.Variables['UNICODE'] := '1';
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
FCompilerModeSwitches:=FCompilerModeSwitches-Switches;
|
FCompilerModeSwitches:=FCompilerModeSwitches-Switches;
|
||||||
case ModeSwitch of
|
case ModeSwitch of
|
||||||
cmsDefault_unicodestring: Values.Undefine('FPC_UNICODESTRINGS');
|
cmsDefault_unicodestring:
|
||||||
|
begin
|
||||||
|
Values.Undefine('FPC_UNICODESTRINGS');
|
||||||
|
Values.Undefine('UNICODE');
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
@ -4551,13 +4559,27 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLinkScanner.SetCompilerMode(const AValue: TCompilerMode);
|
procedure TLinkScanner.SetCompilerMode(const AValue: TCompilerMode);
|
||||||
|
var
|
||||||
|
OldModeSwitches, EnabledModeSwitches,
|
||||||
|
DisabledModeSwitches: TCompilerModeSwitches;
|
||||||
begin
|
begin
|
||||||
if FCompilerMode=AValue then exit;
|
if FCompilerMode=AValue then exit;
|
||||||
Values.Undefine(CompilerModeVars[FCompilerMode]);
|
Values.Undefine(CompilerModeVars[FCompilerMode]);
|
||||||
FCompilerMode:=AValue;
|
FCompilerMode:=AValue;
|
||||||
|
OldModeSwitches:=FCompilerModeSwitches;
|
||||||
FCompilerModeSwitches:=DefaultCompilerModeSwitches[CompilerMode];
|
FCompilerModeSwitches:=DefaultCompilerModeSwitches[CompilerMode];
|
||||||
FNestedComments:=cmsNested_comment in CompilerModeSwitches;
|
FNestedComments:=cmsNested_comment in CompilerModeSwitches;
|
||||||
Values.Variables[CompilerModeVars[FCompilerMode]]:='1';
|
Values.Variables[CompilerModeVars[FCompilerMode]]:='1';
|
||||||
|
|
||||||
|
EnabledModeSwitches:=FCompilerModeSwitches-OldModeSwitches;
|
||||||
|
DisabledModeSwitches:=OldModeSwitches-FCompilerModeSwitches;
|
||||||
|
if cmsDefault_unicodestring in EnabledModeSwitches then begin
|
||||||
|
Values.Variables['FPC_UNICODESTRINGS'] := '1';
|
||||||
|
Values.Variables['UNICODE'] := '1';
|
||||||
|
end else if cmsDefault_unicodestring in DisabledModeSwitches then begin
|
||||||
|
Values.Undefine('FPC_UNICODESTRINGS');
|
||||||
|
Values.Undefine('UNICODE');
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLinkScanner.SetPascalCompiler(const AValue: TPascalCompiler);
|
procedure TLinkScanner.SetPascalCompiler(const AValue: TPascalCompiler);
|
||||||
|
Loading…
Reference in New Issue
Block a user