ce projects, add option to generate the linker opt for gui apps, close #132

This commit is contained in:
Basile Burg 2017-05-03 00:05:18 +02:00
parent 0483b40ca9
commit 4a0827ddf7
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
2 changed files with 25 additions and 5 deletions

View File

@ -99,6 +99,7 @@ These options are defined per-configuration.
- **dmdOtherOptions**: Custom options, only for DMD.
- **gdcOtherOptions**: Custom options, only for GDC.
- **ldcOtherOptions**: Custom options, only for LDC.
- **guiApplication**: Under windows, use this option to hide the console if the target is a GUI application. Under Linux this option has no effect.
Syntax for the custom / other options:

View File

@ -239,16 +239,19 @@ type
TOtherOpts = class(TOptsGroup)
private
fCov: boolean;
fGui: boolean;
fCustom: TStringList;
fDmdOthers: TstringList;
fLdcOthers: TStringList;
fGdcOthers: TStringList;
procedure setCov(const value: boolean);
procedure setCov(value: boolean);
procedure setGui(value: boolean);
procedure setCustom(value: TStringList);
procedure setDmdOtherOptions(value: TStringList);
procedure setLdcOtherOptions(value: TStringList);
procedure setGdcOtherOptions(value: TStringList);
published
property guiApplication: boolean read fGui write setGui;
property coverage: boolean read fCov write setCov default false;
property customOptions: TStringList read fCustom write setCustom;
property dmdOtherOptions: TStringList read fDmdOthers write setDmdOtherOptions;
@ -1169,6 +1172,7 @@ begin
begin
src := TOtherOpts(source);
fCov := src.fCov;
fGUi := src.fGui;
fCustom.Assign(src.fCustom);
fDmdOthers.Assign(src.fDmdOthers);
fLdcOthers.Assign(src.fLdcOthers);
@ -1186,13 +1190,22 @@ begin
inherited;
end;
procedure TOtherOpts.setCov(const value: boolean);
procedure TOtherOpts.setCov(value: boolean);
begin
if fCov = value then exit;
if fCov = value then
exit;
fCov := value;
doChanged;
end;
procedure TOtherOpts.setGui(value: boolean);
begin
if fGui = value then
exit;
fGui := value;
doChanged;
end;
procedure TOtherOpts.getOpts(list: TStrings; base: TOptsGroup = nil);
var
i: integer;
@ -1211,7 +1224,10 @@ begin
str := '-' + str;
list.AddText(fSymStringExpander.expand(str));
end;
if fCov then list.Add('-cov');
if fCov then
list.Add('-cov');
if fGui then
list.Add('-L/SUBSYSTEM:WINDOWS:5.0');
end else
begin
baseopt := TOtherOpts(base);
@ -1228,7 +1244,10 @@ begin
str := '-' + str;
list.AddText(fSymStringExpander.expand(str));
end;
if baseopt.fCov or fCov then list.Add('-cov');
if baseopt.fCov or fCov then
list.Add('-cov');
if baseopt.fGui or fGui then
list.Add('-L/SUBSYSTEM:WINDOWS:5.0');
end;
end;