aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2020-03-19compilers: Link D runtime/libphobs dynamically on !WindowsDylan Baker2-1/+19
Fixes: #6786
2020-03-19Fix bogus parameter passed to LLVMDynamicLinker (llvm-mingw regression)Andrei Alexeyev1-1/+1
2020-03-17compilers: Error if invalid linker selectedDylan Baker2-4/+4
2020-03-17envconfig: Make compiler and linker environment variables matchDylan Baker1-7/+23
2020-03-15Merge pull request #6779 from dcbaker/gdc-linker-argsJussi Pakkanen1-1/+1
Allow setting linker for GDC as well as LDC
2020-03-15fix conversion of hasattr to getattrDylan Baker2-2/+2
getattr() requires a default (return if missing) value or it raises an AttributeError. In a few cases I changed hasattr to getattr and didn't set a default value, so those cases could except. This corrects that.
2020-03-15Resolve Clang failure to use -Og with --optimization=gPhillip Johnston1-2/+9
Clang supports the GCC -Og flag, but --optimization=g is not setting that. This is because Clang is referencing the clike_optimization_args, which does not define a flag for 'g'. To address this, we'll mimic the GNU options instead of the C-like ones. Fixes #6619
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-12Merge pull request #6356 from dcbaker/fix-d-compiler-abstractionsJussi Pakkanen5-72/+141
Fix d compiler abstractions
2020-03-11compilers: Don't put split soname args in start groupsDylan Baker1-0/+10
Some compilers that act as linker drivers (dmd and ldc) need to split arguments that GCC combines with , (ie, -Wl,-foo,bar -> -L=-foo -L=bar). As such we need to detect that the previous argument contained -soname, and not wrap that in a --start-group/--end-group This modifies the shared library test to demonstrate the problem, with a test case. Fixes #6359
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-11coredata: Warn on usage of both -Dbuildtype and -Doptimization/-DdebugNirbheek Chauhan1-0/+7
It may not be obvious to users that these two ways to set build-types override each other and specifying both is redundant, and conflicts are resolved based on whichever is specified later. Closes https://github.com/mesonbuild/meson/issues/6742
2020-03-11coredata: Passing an option is supposed to set it, not flip the defaultNirbheek Chauhan1-3/+4
With the current logic passing `--debug` will actually be parsed as `-Ddebug=false`, which is absolutely not what is expected. There is no case in which the presence of a boolean option in `--foo` form will mean 'I want feature foo disabled', regardless of the *default* value of that option. Also includes a test. Closes https://github.com/mesonbuild/meson/issues/4686
2020-03-11coredata: Set default options as cmdline args that override each otherNirbheek Chauhan1-8/+13
The previous code was assuming that options do not depend on each other, and that you can set defaults using `dict.setdefault()`. This is not true for `buildtype` + `optimization`/`debug`, so we add defaults + overrides in the right order and use the options parsing code later to compute the values. Includes a test. Closes https://github.com/mesonbuild/meson/issues/6752
2020-03-11coredata: Convert all option parsing to OrderedDict()Nirbheek Chauhan1-5/+5
This ensures that options are always parsed in the order in which they were specified on the command-line, even with Python 3.5, and non-CPython implementations compatible with CPython 3.5 and 3.6. Closes https://github.com/mesonbuild/meson/issues/6742
2020-03-10Improve regular expression for MSVC compiler target arch detectionLuca Bacci1-1/+1
Did not work for some MSVC output language combinations. Now should work for every locale / output language. Fixes issue #6757
2020-03-09linkers: Allow optlink to be invoked indirectlyDylan Baker2-3/+10
2020-03-09linkers: Move import_library_args to from VS compiler to linkerDylan Baker2-4/+4
This is the argument to name the implib when using the Visual Studio Linker. This is needed by LDC and DMD when using link.exe or lld-link.exe on windows, and is really a linker argument not a compiler argument.
2020-03-09Allow invoking the linker directly through dmdDylan Baker2-11/+24
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 Baker2-24/+36
Like it wants
2020-03-09pkgconfig: Document conflicts keywordFini Jastrow1-1/+1
[why] Sometimes one want to set the 'Conflicts:' field in .pc files. This is possible by using the 'conflicts' keyword argument in the pkgconfig module. The feature is not documented on mesonbuild.org, though. But a warning is issued: WARNING: Passed invalid keyword argument "conflicts". WARNING: This will become a hard error in the future. History: It has been added along with kwarg 'url' with commit 309041918 pkgconfig: Add missing 'URL' and 'Conflicts' entries Later the kwargs check has been introduced with 80d665e8d Converted some modules. but both 'url' and 'conflicts' were missing. With commit 2acf737b pkgconfig: Document url keyword the 'url' kwarg has been added to the checks, but not 'conflicts'. [how] Add 'conflicts' to the allowed kwargs. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2020-03-09Merge pull request #6532 from jon-turney/languages-native-kwargJussi Pakkanen4-9/+39
Add add_languages(native:)
2020-03-08Merge pull request #6736 from dcbaker/mesonlib-type-annotationsJussi Pakkanen17-311/+336
Mesonlib type annotations
2020-03-08cmake: Fix build_by_default: false, install: true (fixes #6737)Daniel Mensinger1-1/+1
2020-03-08Merge pull request #6688 from dcbaker/emcc-linker-bugsJussi Pakkanen6-16/+71
Emcc linker bugs and improvments
2020-03-08add logic for Java jar projectMichael1-7/+29
2020-03-08intro: List symlinks in installdata (fixes #6734)Daniel Mensinger1-3/+8
2020-03-08qt5: Add has_tools() methodXavier Claessens1-1/+20
2020-03-07Merge pull request #6203 from xclaesse/override-dependencyJussi Pakkanen2-29/+110
Add meson.override_dependency()
2020-03-06dependency: Verify fallback variable consistencyXavier Claessens1-2/+14
This change made `5 dependency versions` unit test fail because now once a subproject has been configured, the fallback variable is checked to be consistent. So it has to use new subproject because 'somesub' was already configured by previous tests.
2020-03-06Improve logged messages for overriden dependenciesXavier Claessens2-11/+23
2020-03-06Allow override_dependency() with a not-found depXavier Claessens1-0/+7
2020-03-06Simplify dependency() fallbackXavier Claessens1-13/+25
Now that subprojects can override the dependency name, there is no need to provide a variable name for the fallback any more.
2020-03-06Add meson.override_dependency()Xavier Claessens2-17/+55
Similar to meson.override_find_program() but overrides the result of the dependency() function. Also ensure that dependency() always returns the same result when looking for the same dependency, this fixes cases where parts of the project could be using a system library and other parts use the library provided by a subproject.
2020-03-06compilers: Don't deduplicate -L= argumentsDylan Baker1-0/+9
This breaks LDC and DMD, so just don't do it.
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-03-06ast: Implement dummy evaluate_notstatementDaniel Mensinger1-0/+5
2020-03-06ast: Do not resolve dict keysXavier Claessens1-1/+1
Fixes: #6748
2020-03-05Make use of unholderDylan Baker8-112/+43
We have a lot of cases of code like: ```python if hasattr(var, 'held_object'): var = var.held_object` ``` replace that with the unholder function.
2020-03-05dependencies/boost: Fix a number of mypy issuesDylan Baker1-8/+8
Since mypy can now see type information for mesonlib it can determine a number of potential errors in the boost module, this fixes those.
2020-03-05dependencies: Use CompilerType not CompilerDylan Baker1-2/+2
Compiler is invariant, in other words Compiler and only Compiler can fulfull it, it's derived classes cannot be used. CompilerType is covariant, that is Compiler and any derived class can fulfill it. This fixes a number of issues in the boost module.
2020-03-05remove ability to pass multiple keys to extract_as_listDylan Baker5-16/+8
This makes the typing annotations basically impossible to get right, but if we only have one key then it's easy. Fortunately python provides comprehensions, so we don't even need the ability to pass multiple keys, we can just [extract_as_list(kwargs, c) for c in ('a', 'b', 'c')] and get the same result.
2020-03-05Remove some uses of mesonlib.run_onceDylan Baker2-5/+4
These are basically doing what mlog.log(..., once=True) does, so lets just use that. The once argument to mlog is newer, so these probably should have been changed already.
2020-03-05mesonlib: use mlog instead of printDylan Baker1-2/+2
2020-03-05mesonlib: Replace unholder argument to listifyDylan Baker6-43/+36
listify shouldn't be unholdering, it's a function to turn scalar values into lists, or flatten lists. Having a separate function is clearer, easier to understand, and can be run recursively if necessary.
2020-03-05mesonbuild/mesonlib: Add type annotationsDylan Baker5-125/+230
2020-03-04mesonlib: Fix File.__eq__ to return NotImplementedDylan Baker1-0/+2
The implementation assumes another File, but doesn't properly guard that. Let's do that guarding.
2020-03-04mesonlib: Use textwrap.dedentDylan Baker1-4/+7
This is mostly just to help folding editors like vim, which get confused by the non-indented code. It also helps readability, IMHO.