mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 00:20:40 +03:00
Add -linker command-line option (#2386)
To set the linker executable for MSVC targets (e.g., `lld-link`) or the `-fuse-ld` arg for the gcc linking command-line for the other targets.
This commit is contained in:
parent
fa3a78174f
commit
aeaf35c42f
4 changed files with 26 additions and 3 deletions
|
@ -62,8 +62,6 @@ int linkObjToBinaryMSVC(llvm::StringRef outputPath, bool useInternalLinker,
|
|||
windows::setupMsvcEnvironment();
|
||||
#endif
|
||||
|
||||
const std::string tool = "link.exe";
|
||||
|
||||
// build arguments
|
||||
std::vector<std::string> args;
|
||||
|
||||
|
@ -180,5 +178,9 @@ int linkObjToBinaryMSVC(llvm::StringRef outputPath, bool useInternalLinker,
|
|||
#endif
|
||||
|
||||
// try to call linker
|
||||
return executeToolAndWait(tool, args, global.params.verbose);
|
||||
std::string linker = opts::linker;
|
||||
if (linker.empty())
|
||||
linker = "link.exe";
|
||||
|
||||
return executeToolAndWait(linker, args, global.params.verbose);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue