added new output option 'alwaysLinkStaticLibs'

to preserve previous linking behavior.
related to #28
This commit is contained in:
Basile Burg 2015-08-27 12:00:29 +02:00
parent ebd7e3fda4
commit e5296b0e7b
4 changed files with 18 additions and 4 deletions

View File

@ -130,6 +130,8 @@ type
fRelease: boolean;
fAllInst: boolean;
fStackStomp: boolean;
fAlwayLinkLibs: boolean;
procedure setAlwaysLinkLibs(const aValue: boolean);
procedure setAllInst(const aValue: boolean);
procedure setUnittest(const aValue: boolean);
procedure setTrgKind(const aValue: TTargetSystem);
@ -143,6 +145,7 @@ type
procedure setVerIds(const aValue: TStringList);
procedure setStackStomp(const aValue: boolean);
published
property alwaysLinkStaticLibs: boolean read fAlwayLinkLibs write setAlwaysLinkLibs default false;
property targetKind: TTargetSystem read fTrgKind write setTrgKind default auto;
property binaryKind: TBinaryKind read fBinKind write setBinKind default executable;
property inlining: boolean read fInline write setInline default false;
@ -611,10 +614,11 @@ begin
fBoundsCheck:= src.fBoundsCheck;
fOptimz := src.fOptimz;
fGenStack := src.fGenStack;
fAddMain := src.fAddMain;
fAddMain := src.fAddMain;
fRelease := src.fRelease;
fAllinst := src.fAllInst;
fStackStomp := src.fStackStomp;
fAlwayLinkLibs := src.fAlwayLinkLibs;
end
else inherited;
end;
@ -633,6 +637,13 @@ begin
doChanged;
end;
procedure TOutputOpts.setAlwaysLinkLibs(const aValue: boolean);
begin
if fAlwayLinkLibs = aValue then exit;
fAlwayLinkLibs := aValue;
doChanged;
end;
procedure TOutputOpts.setVerIds(const aValue: TStringList);
begin
fVerIds.Assign(aValue);

View File

@ -374,9 +374,10 @@ begin
{$IFDEF WINDOWS}
// only link lib file if executable/shared lib
// OS switch: read more @ http://forum.dlang.org/post/ooekdkwrefposmchekrp@forum.dlang.org
if currentConfiguration.outputOptions.binaryKind in [executable, sharedlib] then
if (currentConfiguration.outputOptions.binaryKind in [executable, sharedlib]) or
currentConfiguration.outputOptions.alwaysLinkStaticLibs then
{$ENDIF}
LibMan.getLibFiles(libAliasesPtr, aList);
LibMan.getLibFiles(libAliasesPtr, aList);
// but always adds -I<path>
LibMan.getLibSources(libAliasesPtr, aList);

View File

@ -1,2 +1,3 @@
- setup: screenshots.
- small paragraph about docking, docking options & known issues.
- small paragraph about docking, docking options & known issues.
- project, output options, screenshot is outdated.

View File

@ -595,6 +595,7 @@ These options are defined per-configuration.
![](https://raw.githubusercontent.com/BBasile/CoeditWikiData/master/projconf.output1.png)
- addMain: adds an empty _main()_ procedure. (**-main**)
- alwaysLinkStaticLibs: under Windows this option forces to link a static library selected in the _LibraryAliases_ even if not required (for example if the project is itself a static library).
- binaryKind: sets the compiler output kind among: **"staticlib"**, **"sharedlib"**, **"executable"** and **"object"**. (it matches respectively to **-lib**, **-shared**, nothing, **-c**).
- boundsCheck: sets the bounds checking mode, among **"alwaysON"**, **"alwaysOFF"** and **"safeOnly"**. (**-boundscheck=on** or **-boundscheck=off** or **-boundscheck=safeonly**). The switch is not generated when it's a default value.
- generateStackFrame: forces the generation of stack frames. (**-gs**)