Add -link-defaultlib-shared and rename -link-debuglib (#2443)

... to -link-defaultlib-debug (with alias for backwards compatibility).

-link-defaultlib-shared is to be used for switching between static and
shared default libs to be linked with.

It defaults to true when generating shared libraries (if shared
druntime/Phobos are supported for the target, i.e., not for Windows).
This is a benign breaking change!
This commit is contained in:
Martin Kinkelin 2018-01-12 18:26:19 +01:00 committed by GitHub
parent 3e543120fd
commit 1572c91fc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 76 additions and 38 deletions

View file

@ -20,11 +20,6 @@
//////////////////////////////////////////////////////////////////////////////
static llvm::cl::opt<llvm::cl::boolOrDefault>
staticFlag("static", llvm::cl::ZeroOrMore,
llvm::cl::desc("Create a statically linked binary, including "
"all system dependencies"));
#if LDC_WITH_LLD
static llvm::cl::opt<bool>
useInternalLinker("link-internally", llvm::cl::ZeroOrMore, llvm::cl::Hidden,
@ -134,10 +129,10 @@ int linkObjToBinary() {
createDirectoryForFileOrFail(gExePath);
if (global.params.targetTriple->isWindowsMSVCEnvironment()) {
return linkObjToBinaryMSVC(gExePath, useInternalLinker, staticFlag);
return linkObjToBinaryMSVC(gExePath, useInternalLinker, opts::staticFlag);
}
return linkObjToBinaryGcc(gExePath, useInternalLinker, staticFlag);
return linkObjToBinaryGcc(gExePath, useInternalLinker, opts::staticFlag);
}
//////////////////////////////////////////////////////////////////////////////