summaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
Commit message (Collapse)AuthorAgeFilesLines
* Add prelinking support for static libraries.Jussi Pakkanen2020-12-031-1/+21
|
* run_unittests: use textwrap.dedentDylan Baker2020-11-131-4/+5
| | | | | | So that editors that can fold code (vim, vscode, etc) can correctly fold functions, instead of getting confused by code that doesn't follow the current indention. Also, it makes the code easier to read.
* switch gui_app deprecation to FeatureDeprecatedKwargsPaolo Bonzini2020-10-191-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.
* build: use PIE objects for static libraries if b_staticpic=false but b_pie=truePaolo Bonzini2020-10-181-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%.
* intro: Add extra_files key to intro output (fixes #7310)Daniel Mensinger2020-10-151-3/+2
|
* Properly handle the case of linking static library with custom targetsSahnvour2020-10-101-4/+31
|
* Add win_subsystem kwarg. Closes #7765.Jussi Pakkanen2020-10-071-3/+20
|
* pylint: turn on bad-indentation errorDylan Baker2020-09-221-4/+4
| | | | and fix all of the bad indentation
* pylint: Catch cases of `if len(container)` which should be replaced by `if ↵Dylan Baker2020-09-181-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
* Fixed MacOS dylib custom targets not marked as linkableMarco Mastropaolo2020-09-171-1/+1
|
* typing: Fix code reviewDaniel Mensinger2020-09-081-4/+4
|
* typing: fix code reviewDaniel Mensinger2020-09-081-4/+4
|
* typing: more fixesDaniel Mensinger2020-09-081-21/+30
|
* build: optimize extract_objectsPaolo Bonzini2020-08-181-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>
* pkgconfig: Fix various corner casesXavier Claessens2020-07-301-10/+3
| | | | See unit tests for the exact scenarios this PR fixes.
* Do not add rpaths for static libs. Closes #5191.Jussi Pakkanen2020-07-201-1/+2
|
* Merge pull request #7123 from dcbaker/use-feature-deprecatedJussi Pakkanen2020-05-221-3/+2
|\ | | | | Use FeatureDeprecated (and other cleanups)
| * use FeatureNew.single_useDylan Baker2020-05-141-2/+2
| | | | | | | | This is just slightly cleaner looking
| * interpreter: Replace some uses of mlog.deprecation with FeatureDeprecatedDylan Baker2020-05-141-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.
* | Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen2020-05-181-0/+2
|\ \ | |/ |/| Let .pc files and LDFLAGS provide rpaths.
| * Let .pc files specify rpath.Dan Kegel2020-05-161-0/+2
| | | | | | | | Fixes #4027
* | Merge pull request #6620 from jon-turney/test-output-checkDylan Baker2020-05-131-1/+4
|\ \ | | | | | | Add a mechanism for validating meson output in tests
| * | Be more careful about the use of repr() in error messagesJon Turney2020-04-301-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.
* | | interpretor: Do not add dependencies if we already have themMarcel Hollerbach2020-05-131-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.
* | Allow indexed custom target to be used in executable's depends.Szabi Tolnai2020-05-081-1/+1
| | | | | | | | Change-Id: I7f3e0e0dd9c413d7f6e3267de9664b89f2294e27
* | Merge pull request #7064 from dcbaker/gtest-protocolJussi Pakkanen2020-05-061-3/+5
|\ \ | | | | | | Add support for Gtest as a test protocol
| * | build: cleanup and sort importsDylan Baker2020-04-301-3/+5
| |/
* | interpreter: Add link_language to all build targetsDylan Baker2020-04-301-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.
* | build: Fix link_language selectionDylan Baker2020-04-301-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
* | build: add missing type annotationDylan Baker2020-04-301-1/+1
|/
* Compiler options per langJohn Ericson2020-04-201-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`.
* Fix handling of library(name_prefix: [])Jon Turney2020-04-111-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.
* -Add xc16 and c2000 C,Cpp toolchain supportalanNz2020-03-211-0/+5
|
* Generators can depend on custom targets as well as build targets.Jussi Pakkanen2020-03-191-1/+1
|
* Merge pull request #6532 from jon-turney/languages-native-kwargJussi Pakkanen2020-03-091-3/+13
|\ | | | | Add add_languages(native:)
| * Improve error reported when language has no compilerJon Turney2020-02-121-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.
* | Merge pull request #6736 from dcbaker/mesonlib-type-annotationsJussi Pakkanen2020-03-081-66/+32
|\ \ | | | | | | Mesonlib type annotations
| * | Make use of unholderDylan Baker2020-03-051-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.
| * | remove ability to pass multiple keys to extract_as_listDylan Baker2020-03-051-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.
| * | mesonlib: Replace unholder argument to listifyDylan Baker2020-03-051-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.
| * | mesonbuild/mesonlib: Add type annotationsDylan Baker2020-03-051-1/+1
| | |
* | | Improve logged messages for overriden dependenciesXavier Claessens2020-03-061-0/+6
| | |
* | | Add meson.override_dependency()Xavier Claessens2020-03-061-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.
* | Cherry-picking - (rm python2 % add python3 .format) (#6725)Michael Brockus2020-03-031-19/+16
| |
* | Fixed linker detecting on windows. Added comments about linker detecting for ↵ur4t2020-02-291-2/+4
|/ | | | further debugging and refactoring.
* interpreter: Iterate custom target outputsXavier Claessens2020-02-041-0/+4
|
* Merge pull request #6423 from dcbaker/declare-dependency-variablesJussi Pakkanen2020-01-271-1/+1
|\ | | | | Add ability to set and query arbitrary variables on declare_dependency objects
| * dependencies: Add ability to set arbitrary variables onDylan Baker2020-01-091-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.
* | typing: Fix compatibility with Python 3.5.2Nirbheek Chauhan2020-01-241-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
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-15/+15
|