summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/d.py
Commit message (Collapse)AuthorAgeFilesLines
* vs: add static_from_buildtype to b_vscrtPeter Harris2020-10-141-5/+11
|
* compilers/d: add type annotationsDylan Baker2020-10-011-128/+138
|
* compilers/cuda: make type safeDylan Baker2020-10-011-6/+0
|
* compilres: move depfile_for_object to compilerDylan Baker2020-10-011-6/+0
|
* compilers: move get_dependency_gen_args to base CompilerDylan Baker2020-10-011-4/+0
| | | | | | So that every subclass doesn't have to reimplement it. Especially since the Gnu implementation moved out of the CCompiler and into the GnuLikeCompiler mixin
* compilers: make is_cross part of the base Compiler classDylan Baker2020-09-241-12/+14
| | | | | | | Every class needs to set this, so it should be part of the base. For classes that require is_cross, the positional argument remains in their signature. For those that don't, they just allow the base class to set their value to it's default of False.
* compilers: put name_string method in base compilerDylan Baker2020-09-241-3/+0
| | | | Every language had the exact same implementation
* D: fix include orderPierrick Bouvier2020-08-301-0/+7
| | | | | Commit 93c3ec7e introduced a new way to handle deduplication with compiler args. This resulted in D includes to be reversed.
* compilers: Return CompilerArgs from compiler instanceDylan Baker2020-06-221-2/+1
| | | | | | | Since the CompileArgs class already needs to know about the compiler, and we really need at least per-lanaguage if not per-compiler CompilerArgs classes, let's get the CompilerArgs instance from the compiler using a method.
* compilers: Split CompilerArgs into a separate moduleDylan Baker2020-06-221-1/+1
| | | | | I've also moved this out of the compilers pacakge because we're soon going to need it in linkers, and that creates some serious spagetti
* compilers/d: Add b_ndebug supportDylan Baker2020-05-201-3/+12
| | | | | | | | D lang compilers have an option -release (or similar) which turns off asserts, contracts, and other runtime type checking. This patch wires that up to the b_ndebug flag. Fixes #7082
* Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen2020-05-181-4/+5
|\ | | | | Let .pc files and LDFLAGS provide rpaths.
| * Let .pc files specify rpath.Dan Kegel2020-05-161-4/+5
| | | | | | | | Fixes #4027
* | compilers/d: Enable pgo for GDCDylan Baker2020-05-181-1/+2
|/
* compilers/d: Add missing method for dmd and ldcDylan Baker2020-04-101-0/+3
| | | | | This allows coverage to be generated, although we can't yet do anything useful with it.
* compilers/d: Implement coverage for GDCDylan Baker2020-04-101-4/+1
| | | | | | | Since GDC a GNU compiler, we just need to pass the normal GNU options and coverage is generated. Related: ##5669
* compilers: Link D runtime/libphobs dynamically on !WindowsDylan Baker2020-03-191-0/+18
| | | | Fixes: #6786
* compilers/d: Support linker selection with gdcDylan Baker2020-03-121-1/+1
| | | | | | This should have worked before, but the inheritance order was backwards, so we got the DCompiler before the GnuCompiler, and the base Compiler methods overrode the Gnu methods.
* compilers/d: Properly pass -soname argsDylan Baker2020-03-111-4/+17
|
* compilers/d: Fix rpath generation with LDC and DMDDylan Baker2020-03-111-14/+18
|
* Allow invoking the linker directly through dmdDylan Baker2020-03-091-0/+3
| | | | | DMD is awful in a lot of ways. To change the linker you set an environment variable, which is pretty much impossible for us.
* Allow invoking link.exe and lld-link.exe through ldc2Dylan Baker2020-03-091-0/+4
| | | | Like it wants
* compilers/d: Fix get_allow_undefined_link_args on macOSDylan Baker2020-03-061-0/+11
| | | | | | | | | DMD and LDC are a real pain to use as linkers. On Unices they invoke the C compiler as the linker, just like meson does. This means we have to figure out what C compiler they're using and try to pass valid arguments to that compiler if the D compiler doesn't understand the linker arguments we want to pass. In this case that means gcc or clang. We can use-the -Xcc to pass arguments directly to the C compiler without dmd/ldc getting involved, so we'll use that.
* compilers/d: Remove CompilerIsLInkerMixinDylan Baker2020-03-061-16/+6
| | | | | | | This was never really true of the D compilers, it made them more complicated than necessary and was incorrect in many cases. Removing it causes no regressions on Linux, at least in our rather limited test cases).
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-5/+5
|
* compilers: move language attribute to the class levelDylan Baker2019-12-121-1/+2
| | | | | We know that if a compiler class inherits CCompiler it's language will be C, so doing this at the class level makes more sense.
* lgtm: fix Missing call to __init__ during object initializationDaniel Mensinger2019-12-051-0/+1
| | | | | | Either mark the missing calls as intentional, or explicetly call the right __init__ method and avoid mixing super() and explicit base calss calls.
* Fix cross-compilation of D programsEric Le Bihan2019-11-191-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since version 9.1, GCC provides support for the D programming language. Thus it is easy to build a cross-compiler for D, such as aarch64-unknown-linux-gnu-gdc. However to cross-compile a Meson project using D, using a cross build definition such as the following is not enough: ``` [binaries] d = '/path/to/aarch64-unknown-linux-gnu-gdc' exe_wrapper = '/path/to/qemu-aarch64-static' [properties] needs_exe_wrapper = true [host_machine] system = 'linux' cpu_family = 'aarch64' cpu = 'cortex-a53' endian = 'little' ``` Indeed, "exe_wrapper" is not be taken into account. Build will fail with: ``` Executables created by D compiler /path/to/aarch64-uknown-linux-gnu-gdc are not runnable. ``` This patch fixes this by reworking: - detect_d_compiler() to properly get exe_wrapper and D compilers and detect the one available. - Dcompiler to properly handle exe_wrapper.
* Add -L= to soname linker argument, too.Jussi Pakkanen2019-11-061-1/+4
|
* d: Fix various linking issues on WindowsGoaLitiuM2019-10-211-1/+10
|
* Workaround broken get_allow_undefined_link_args in DmdLikeCompilerMixinAndrei Alexeyev2019-10-141-0/+3
| | | | | Previously it worked by accident because BasicLinkerIsCompilerMixin had that method misspelled.
* Revert "Remove BasicLinkerIsCompilerMixin from LDC and DMD"Andrei Alexeyev2019-10-141-2/+2
| | | | This reverts commit 04d6a439457d76b9cf4c4f98fce238219366e241.
* Remove BasicLinkerIsCompilerMixin from LDC and DMDAndrei Alexeyev2019-10-141-2/+2
| | | | | | | | | | | | | | These compilers invoke external linkers and have the appropriate .linker property set. Therefore, BasicLinkerIsCompilerMixin appears to be misplaced. It used to work by chance, because BasicLinkerIsCompilerMixin failed to override the get_allow_undefined_link_args method. The D compilers do not provide their own get_allow_undefined_link_args, because they expect to inherit it from Compiler, which simply delegates it to the linker. Now that BasicLinkerIsCompilerMixin correctly overrides that method with a stub, it broke compilers that relied on the buggy behavior.
* compilers: replace uses of mesonlib.is_<os>() with self.info.is_<os>()Dylan Baker2019-10-071-21/+18
| | | | Since these are cross compilation safe, while the former is not.
* compilers: replace CompilerType with MachineInfoDylan Baker2019-10-071-9/+17
| | | | | | Now that the linkers are split out of the compilers this enum is only used to know what platform we're compiling for. Which is what the MachineInfo class is for
* Handle -idirafter in unix_args_to_nativeDaniel Mensinger2019-10-031-1/+8
|
* compilers: Move the compiler argument to proxy linker flags to the compiler ↵Dylan Baker2019-08-301-0/+6
| | | | | | | | | | | | class Instead of the DynamicLinker returning a hardcoded value like `-Wl,-foo`, it now is passed a value that could be '-Wl,', or could be something '-Xlinker=' This makes a few things cleaner, and will make it possible to fix using clang (not clang-cl) on windows, where it invokes either link.exe or lld-link.exe instead of a gnu-ld compatible linker.
* compilers: Dispatch to dynamic linker classDylan Baker2019-08-141-23/+108
| | | | | Most of the cuda code is from Olexa Bilaniuk. Most of the PGI code is from Michael Hirsc
* re-architect the D compiler abstractionsDylan Baker2019-08-141-215/+197
| | | | | | | | | | | | | | | | | | We support 3 D compilers, DMD, LDC, and GDC. DMD is the reference compiler, and LDC attempts to largely mirror it's command line usage. GDC does not, it instead acts like GCC (which makes sense). The current abstraction puts DMD behavior in the base D compiler and then overrides then in the GnuDCompiler class. This is messy, but it becomes more problematic when splitting the linker and compiler abstractions apart. I've opted to instead split the DCompiler class into two separate classes. The DCompiler implements core D functinoality, and DmdLikeCompilerMixin, which implements the DMD and LDC command line arguments. I've then mxed that into the DmdDCompiler and LLVMDCompiler classes, and mixed the GnuCompiler into the GnuDCompiler class to get Gnu command line behavior.
* compilers: split gnu and gnulike compilers out of compilersDylan Baker2019-07-151-3/+1
| | | | | I debated a bit whether both classes really belong in the same module, and decided that they do because the share a number of helpers.
* Ignore -D* and -fstack-protector* args for D compilersmyfreeweb2019-07-111-0/+4
| | | Fixes #5369
* Purge `is_cross` and friends without changing user interfacesJohn Ericson2019-06-091-16/+10
| | | | | | | | | | | | In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
* Moved caching into a seperate functionDaniel Mensinger2019-04-281-1/+1
|
* Added some cahced valuesDaniel Mensinger2019-04-281-1/+1
|
* Cache compile results in coredataDaniel Mensinger2019-04-281-1/+1
|
* d: Fix linker errors with shared libraries on WindowsAri Vuollet2019-04-031-1/+9
|
* Add warning level zerojml17952019-02-191-2/+5
|
* d: Translate the -isystem flag for LDC and DMDMatthias Klumpp2019-02-181-0/+11
|
* d: fix linker due to argument errorsLuís Ferreira2019-02-051-1/+1
| | | | | | - revert some changes on d2483d44128778f4d7fe6b028abd2431d2e9f4cc commit. Signed-off-by: Luís Ferreira <lsferreira169@gmail.com>
* Never access environment.properties downstreamJohn Ericson2019-02-021-3/+10
| | | | | | | | | | | | | | | | | Instead use coredata.compiler_options.<machine>. This brings the cross and native code paths closer together, since both now use that. Command line options are interpreted just as before, for backwards compatibility. This does introduce some funny conditionals. In the future, I'd like to change the interpretation of command line options so - The logic is cross-agnostic, i.e. there are no conditions affected by `is_cross_build()`. - Compiler args for both the build and host machines can always be controlled by the command line. - Compiler args for both machines can always be controlled separately.