Commit graph

23 commits

Author SHA1 Message Date
Ikey Doherty
ad71070369
For LLVM >= 16, use std::optional APIs
Unfortunately when building with LLVM < 15, we're using C++-11,
so the std::optional bits are only available in C++-17.

Even more unfortunately we can't really override this, rather
inherit the fact of using C++-17 when using LLVM > 16.

Thus, we add a slightly messy conditional compilation situation
to allow usage of LDC on older LLVM versions, and with newer
LLVM/libcxx.

Signed-off-by: Ikey Doherty <ikey@serpentos.com>
2023-06-03 22:07:24 +01:00
Martin Kinkelin
29b4355f26 Merge upstream stable (dlang/dmd@d8668e1afa)
Requiring some adaptations for enhanced emitMakeDeps functionality.
2021-02-08 21:23:59 +01:00
Martin Kinkelin
18ed3efe4d Extend -platformlib to Posix targets 2020-08-14 17:55:35 +02:00
Dentcho Bankov
ccaccb8edd Fix for #3374
Introduce -platformlib option to control libraries added automatically for Windows targets.
2020-08-12 14:01:31 -07:00
Martin Kinkelin
18406bcc06 Adopt DMD's MSVC toolchain detection
This reduces the overhead for auto-detecting and setting up an MSVC
toolchain from a very rough 1 second to about 8 milliseconds on my box.
Enabling the auto-detection by default (and so preferring MSVC over the
'internal' toolchain if there's a Visual C++ installation) is now
possible, fixing issues like #3402.

The MSVC setup now consists of the bare minimum - prepending 3
directories to the LIB env var and 1-2 directories to PATH.
2020-04-30 21:45:56 +02:00
Martin Kinkelin
bdfc0f9b07 MSVC: Default to the internal 'toolchain' (-link-internally + MinGW-w64 libs) 2018-10-29 20:19:14 +01:00
Martin Kinkelin
39b46d7b69 Replace old-school header guards by #pragma once 2018-10-20 16:19:46 +02:00
Martin Kinkelin
0bd9a10234 Add LDC-specific support for __traits(getTargetInfo) 2018-10-20 16:19:46 +02:00
Martin
82a6ccd293 Refactor default libs linker stuff to driver/linker.cpp 2018-04-21 18:23:59 +02:00
Martin
891234bbe4 Only set rpath when linking against shared default libs 2018-04-21 18:23:59 +02:00
Martin
ec1a54aade Move static lib generation from driver/linker.cpp to driver/archiver.cpp 2017-05-26 21:55:25 +02:00
Martin
aed881350a Refactor output filename generation/validation 2016-09-07 09:53:35 +02:00
Martin
24cecc268c Streamline main() with DMD's (ddmd/mars.d) 2016-08-27 20:40:26 +02:00
Johan Engelen
d9b267a4be Accept LLVM bitcode files (*.bc) on the commandline and add the code to the first source file on the cmdline (the first emitted module). 2016-06-05 16:07:14 +02:00
David Nadlinger
57546e1723 driver: Add -static option for creating fully static binaries 2015-11-29 20:16:19 +01:00
Rainer Schuetze
8b5cee7a7c issue #1161: return status if lib invocation 2015-10-17 15:27:37 +02:00
Martin
1670323ebb Refactor argv[0] management, related path searches etc. 2015-09-27 20:47:14 +02:00
David Nadlinger
e7bbacadb7 Removed useless -quiet switch. 2013-02-13 00:07:49 +01:00
David Nadlinger
243083b88c Factored out tool invocation code into separate file. 2013-02-13 00:07:48 +01:00
David Nadlinger
0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
David Nadlinger
4b23e794ca Removed linkExecutable() (dead code). 2012-09-07 03:51:32 +02:00
Eldar Insafutdinov
feefad412c Move cl_options out of LDCShared 2012-04-02 14:53:52 +01:00
Renamed from gen/linker.h (Browse further)