aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
AgeCommit message (Collapse)AuthorFilesLines
2020-10-19switch gui_app deprecation to FeatureDeprecatedKwargsPaolo Bonzini1-1/+0
The deprecation message for "gui_app" is appearing for every target rather than just once, and even if the required version is older than 0.56.0. Use @FeatureDeprecatedKwargs to fix both issues.
2020-10-18build: use PIE objects for static libraries if b_staticpic=false but b_pie=truePaolo Bonzini1-7/+11
If static_library is used as a convenience library (e.g. for link_whole) it should in principle not need position independent code. However, if the executables that the libraries is linked to are PIE, the non-PIC objects in the static library will cause linker errors. To avoid this, obey b_pie for static libraries if either b_staticpic=false or they use "pic: false". Without this patch, QEMU cannot use b_staticpic, which causes a slowdown on some QEMU benchmarks up to 20%.
2020-10-15intro: Add extra_files key to intro output (fixes #7310)Daniel Mensinger1-3/+2
2020-10-10Properly handle the case of linking static library with custom targetsSahnvour1-4/+31
2020-10-07Add win_subsystem kwarg. Closes #7765.Jussi Pakkanen1-3/+20
2020-09-22pylint: turn on bad-indentation errorDylan Baker1-4/+4
and fix all of the bad indentation
2020-09-18pylint: Catch cases of `if len(container)` which should be replaced by `if ↵Dylan Baker1-1/+1
container` Unfortunately this doesn't catch other abuses of len(continauer) like, `len(container) <comparator> 0`, see: https://github.com/PyCQA/pylint/issues/3751
2020-09-17Fixed MacOS dylib custom targets not marked as linkableMarco Mastropaolo1-1/+1
2020-09-08typing: Fix code reviewDaniel Mensinger1-4/+4
2020-09-08typing: fix code reviewDaniel Mensinger1-4/+4
2020-09-08typing: more fixesDaniel Mensinger1-21/+30
2020-08-18build: optimize extract_objectsPaolo Bonzini1-1/+2
extract_objects is repeatedly looking up files in self.sources, which is a list. Convert it to a set beforehand so that the lookup is O(1). On a QEMU build, the time spent in extract_objects goes from 3.292s to 0.431s. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-07-30pkgconfig: Fix various corner casesXavier Claessens1-10/+3
See unit tests for the exact scenarios this PR fixes.
2020-07-20Do not add rpaths for static libs. Closes #5191.Jussi Pakkanen1-1/+2
2020-05-22Merge pull request #7123 from dcbaker/use-feature-deprecatedJussi Pakkanen1-3/+2
Use FeatureDeprecated (and other cleanups)
2020-05-18Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen1-0/+2
Let .pc files and LDFLAGS provide rpaths.
2020-05-16Let .pc files specify rpath.Dan Kegel1-0/+2
Fixes #4027
2020-05-14use FeatureNew.single_useDylan Baker1-2/+2
This is just slightly cleaner looking
2020-05-14interpreter: Replace some uses of mlog.deprecation with FeatureDeprecatedDylan Baker1-1/+0
This gives the version that the feature was deprecated in, and doesn't print the warning if the project supports versions of meson in which the project wasn't deprecated.
2020-05-13Merge pull request #6620 from jon-turney/test-output-checkDylan Baker1-1/+4
Add a mechanism for validating meson output in tests
2020-05-13interpretor: Do not add dependencies if we already have themMarcel Hollerbach1-0/+4
in tree like dep structures with a lot of source: declarations, this can result in a lot of presure on the source list. this saves ~3s out of 7s in the interpretor stage in efl build.
2020-05-08Allow indexed custom target to be used in executable's depends.Szabi Tolnai1-1/+1
Change-Id: I7f3e0e0dd9c413d7f6e3267de9664b89f2294e27
2020-05-06Merge pull request #7064 from dcbaker/gtest-protocolJussi Pakkanen1-3/+5
Add support for Gtest as a test protocol
2020-04-30build: cleanup and sort importsDylan Baker1-3/+5
2020-04-30Be more careful about the use of repr() in error messagesJon Turney1-1/+4
Generally, we'd want to use str() rather than repr() in error messages anyhow, as that explicitly gives something designed to be read by humans. Sometimes {!r} is being used as a shortcut to avoid writing the quotes in '{!s}'. Unfortunately, these things aren't quite the same, as the repr of a string containing '\' (the path separator on Windows) will have those escaped. We don't have a good string representation to use for the arbitrary internal object used as an argument for install_data() when it's neither a string nor file (which doesn't lead to a good error message), so drop that for the moment.
2020-04-30interpreter: Add link_language to all build targetsDylan Baker1-1/+2
If the feature hadn't been broken in the first place it would have worked on them anyway, so we might as well expose it. I'm loathe to do it because one of the best features of meson in a mixed C/C++ code base is that meson figures out the right linker every time, but there are cases people have where they want to force a linker. We'll let them keep the pieces.
2020-04-30build: Fix link_language selectionDylan Baker1-4/+6
Currently it does nothing, as the field is read too late, and additional languages have already been considered. As such if the language requested is closer to C (for example you want C but have a C++ source with only extern C functions) then link_langauge is ignored. Fixes #6453
2020-04-30build: add missing type annotationDylan Baker1-1/+1
2020-04-20Compiler options per langJohn Ericson1-4/+16
A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
2020-04-11Fix handling of library(name_prefix: [])Jon Turney1-6/+7
Adjust the handling of a name_prefix: [] kwarg to be the same as name_suffix: [] kwarg, i.e. identically to the case where it's omitted, so BuildTarget.prefix doesn't get set (so the default is used). Also clarify the error reported when a non-empty list is used.
2020-03-21-Add xc16 and c2000 C,Cpp toolchain supportalanNz1-0/+5
2020-03-19Generators can depend on custom targets as well as build targets.Jussi Pakkanen1-1/+1
2020-03-09Merge pull request #6532 from jon-turney/languages-native-kwargJussi Pakkanen1-3/+13
Add add_languages(native:)
2020-03-08Merge pull request #6736 from dcbaker/mesonlib-type-annotationsJussi Pakkanen1-66/+32
Mesonlib type annotations
2020-03-06Improve logged messages for overriden dependenciesXavier Claessens1-0/+6
2020-03-06Add meson.override_dependency()Xavier Claessens1-0/+1
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-05Make use of unholderDylan Baker1-50/+17
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-05remove ability to pass multiple keys to extract_as_listDylan Baker1-3/+2
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-05mesonlib: Replace unholder argument to listifyDylan Baker1-12/+12
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 Baker1-1/+1
2020-03-03Cherry-picking - (rm python2 % add python3 .format) (#6725)Michael Brockus1-19/+16
2020-02-29Fixed linker detecting on windows. Added comments about linker detecting for ↵ur4t1-2/+4
further debugging and refactoring.
2020-02-12Improve error reported when language has no compilerJon Turney1-3/+13
This gives consistent reporting of this error for all platforms. Also, reporting this error when constructing the BuildTarget, rather than discovering the problem during backend generation means that the error is reported against with a location.
2020-02-04interpreter: Iterate custom target outputsXavier Claessens1-0/+4
2020-01-27Merge pull request #6423 from dcbaker/declare-dependency-variablesJussi Pakkanen1-1/+1
Add ability to set and query arbitrary variables on declare_dependency objects
2020-01-24typing: Fix compatibility with Python 3.5.2Nirbheek Chauhan1-4/+4
Explicitly use the type instead of the string 'NotImplemented' which still works with Python 3.5.2 Fixes https://github.com/mesonbuild/meson/issues/6427
2020-01-09dependencies: Add ability to set arbitrary variables onDylan Baker1-1/+1
declare_dependencies This allows dependencies declared in subprojects to set variables, and for those variables to be accessed via the get_variable method, just like those from pkg-config and cmake. This makes it easier to use projects from subprojects in a polymorphic manner, lowering the distinction between a subproject and an external dependency every further.
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-15/+15
2019-12-05build: Fix type signature of rich comparison dundersDylan Baker1-4/+12
There are three problems: 1) Dunders like `__lt__` and `__gt__` don't return bool, they return either a bool or the NotImplemented singleton to signal that they don't know how to be compared. 2) The don't take type object, the take `typing.Any` 3) They need to return NotImplemented if the comparison is not implemented, this allows python to try the inverse dunder from the other object. If that object returns NotImplemented as well a TypeError is raised.
2019-12-05lgtm: fix Incomplete orderingDaniel Mensinger1-9/+12