aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/d.py
AgeCommit message (Collapse)AuthorFilesLines
2021-07-14linkers: remove is_shared_module argument to get_soname_argsPaolo Bonzini1-3/+2
The argument is now unused, drop it.
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-1/+1
2021-03-19split program related classes and functions out of dependenciesDylan Baker1-1/+1
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-17Fix D lib search path translationRemi Thebault1-15/+49
This requires quite a complex and messy logic. As @dcbaker suggested in #8491, this could be replaced by an abstraction over linker flags instead of having GNU flags translated.
2021-03-14ninjabackend: Use rsp_file_syntax methodDylan Baker1-3/+4
This also makes us of the new enum value in the backend, for better type saftey.
2021-03-14compilers/linkers: Add a methhod for getting the rspfile syntaxDylan Baker1-2/+11
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-13/+13
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz1-12/+12
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-03-02fix missing versions with generated sourceRemi Thebault1-0/+6
2021-03-01D add build dir to -J switchRemi Thebault1-2/+6
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-5/+7
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2020-12-29Implement support of dlang -makedeps switch (#8119)Remi Thebault1-2/+31
* Implement support of dlang -makedeps switch Fix #8118 * resolve code review comments
2020-10-14vs: add static_from_buildtype to b_vscrtPeter Harris1-5/+11
2020-10-01compilers/d: add type annotationsDylan Baker1-128/+138
2020-10-01compilers/cuda: make type safeDylan Baker1-6/+0
2020-10-01compilres: move depfile_for_object to compilerDylan Baker1-6/+0
2020-10-01compilers: move get_dependency_gen_args to base CompilerDylan Baker1-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
2020-09-24compilers: make is_cross part of the base Compiler classDylan Baker1-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.
2020-09-24compilers: put name_string method in base compilerDylan Baker1-3/+0
Every language had the exact same implementation
2020-08-30D: fix include orderPierrick Bouvier1-0/+7
Commit 93c3ec7e introduced a new way to handle deduplication with compiler args. This resulted in D includes to be reversed.
2020-06-22compilers: Return CompilerArgs from compiler instanceDylan Baker1-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.
2020-06-22compilers: Split CompilerArgs into a separate moduleDylan Baker1-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
2020-05-20compilers/d: Add b_ndebug supportDylan Baker1-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
2020-05-18Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen1-4/+5
Let .pc files and LDFLAGS provide rpaths.
2020-05-18compilers/d: Enable pgo for GDCDylan Baker1-1/+2
2020-05-16Let .pc files specify rpath.Dan Kegel1-4/+5
Fixes #4027
2020-04-10compilers/d: Add missing method for dmd and ldcDylan Baker1-0/+3
This allows coverage to be generated, although we can't yet do anything useful with it.
2020-04-10compilers/d: Implement coverage for GDCDylan Baker1-4/+1
Since GDC a GNU compiler, we just need to pass the normal GNU options and coverage is generated. Related: ##5669
2020-03-19compilers: Link D runtime/libphobs dynamically on !WindowsDylan Baker1-0/+18
Fixes: #6786
2020-03-12compilers/d: Support linker selection with gdcDylan Baker1-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.
2020-03-11compilers/d: Properly pass -soname argsDylan Baker1-4/+17
2020-03-11compilers/d: Fix rpath generation with LDC and DMDDylan Baker1-14/+18
2020-03-09Allow invoking the linker directly through dmdDylan Baker1-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.
2020-03-09Allow invoking link.exe and lld-link.exe through ldc2Dylan Baker1-0/+4
Like it wants
2020-03-06compilers/d: Fix get_allow_undefined_link_args on macOSDylan Baker1-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.
2020-03-06compilers/d: Remove CompilerIsLInkerMixinDylan Baker1-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).
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-5/+5
2019-12-12compilers: move language attribute to the class levelDylan Baker1-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.
2019-12-05lgtm: fix Missing call to __init__ during object initializationDaniel Mensinger1-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.
2019-11-19Fix cross-compilation of D programsEric Le Bihan1-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.
2019-11-06Add -L= to soname linker argument, too.Jussi Pakkanen1-1/+4
2019-10-21d: Fix various linking issues on WindowsGoaLitiuM1-1/+10
2019-10-14Workaround broken get_allow_undefined_link_args in DmdLikeCompilerMixinAndrei Alexeyev1-0/+3
Previously it worked by accident because BasicLinkerIsCompilerMixin had that method misspelled.
2019-10-14Revert "Remove BasicLinkerIsCompilerMixin from LDC and DMD"Andrei Alexeyev1-2/+2
This reverts commit 04d6a439457d76b9cf4c4f98fce238219366e241.
2019-10-14Remove BasicLinkerIsCompilerMixin from LDC and DMDAndrei Alexeyev1-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.
2019-10-07compilers: replace uses of mesonlib.is_<os>() with self.info.is_<os>()Dylan Baker1-21/+18
Since these are cross compilation safe, while the former is not.
2019-10-07compilers: replace CompilerType with MachineInfoDylan Baker1-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
2019-10-03Handle -idirafter in unix_args_to_nativeDaniel Mensinger1-1/+8
2019-08-30compilers: Move the compiler argument to proxy linker flags to the compiler ↵Dylan Baker1-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.
2019-08-14compilers: Dispatch to dynamic linker classDylan Baker1-23/+108
Most of the cuda code is from Olexa Bilaniuk. Most of the PGI code is from Michael Hirsc