aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
AgeCommit message (Collapse)AuthorFilesLines
2021-08-09build: store global and project args per-machine even when not cross compilingDylan Baker1-8/+4
The problem is what happens in this case: ```meson add_project_arguments('-DHOST', language : 'c', native : false) add_project_arguments('-DBUILD', langauge : 'c', native : true) ``` The original meson behavior was that in an host == build configuration only the `native : false` would be applied. This doesn't really make sense as in that case the build machine is the host machine, so it is both the native and non-native machine at once. We changed this so that the both would be applied in a host == build configuration, but this is a behavioral change, and needs to be reverted. Fixes: #9037
2021-08-09build: add a few annotationsDylan Baker1-4/+4
I was debugging this code, these were trivial, so I added them.
2021-08-03build: Add annotation to CustomTargetIndex.get_subdirDylan Baker1-1/+1
2021-08-03build: Add get_subdir() to GeneratedListDylan Baker1-0/+4
It needs this to match the behavior of CustomTarget and CustomTargetIndex, the later of which doesn't have a subdir attribute, just `get_subdir()`
2021-07-27build: learn to take CustomTargetIndex as custom_target commandMarc-André Lureau1-0/+4
Fix ERROR: Argument <CustomTargetIndex:...>[0]> in "command" is invalid. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-06-29Add feed arg to custom_target()Simon Ser1-4/+9
2021-06-26refactor: Refactor BothLibraries logicDaniel Mensinger1-13/+3
This commit introduces a new type of `HoldableObject`: The `SecondLevelHolder`. The primary purpose of this class is to handle cases where two (or more) `HoldableObject`s are stored at the same time (with one default object). The best (and currently only) example here is the `BothLibraries` class.
2021-06-25Split compiler detection from EnvironmentDaniel Mensinger1-2/+2
This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
2021-06-23Merge pull request #8884 from dcbaker/submit/type-and-annotate-install-functionsJussi Pakkanen1-7/+7
Add annotations for the various install_* functions
2021-06-22fix: Handling BothLibraries objects (fixes #8907)Daniel Mensinger1-0/+12
2021-06-22Merge pull request #8900 from bonzini/extract-objects-docsJussi Pakkanen1-4/+6
extract_objects: fixes, tests and documentation for using the result in a custom_target
2021-06-22install_*: FileMode doesn't need to be NoneDylan Baker1-6/+6
There's no reason to allow None into the backend, it already has code to check that all of the values of the FileMode object are None, so let's use that, which is much simpler all the way down.
2021-06-22backend: Headers.install_subdir is allowed to be NoneDylan Baker1-1/+1
But we don't properly handle that.
2021-06-22extract_objects: skip headers when building custom_target command linePaolo Bonzini1-4/+6
As seen in the testcase, passing objects to custom_target does not work if headers are passed extract_objects(), or if extract_all_objects() is used and the sources include any header files. To fix this, use the code that already exists for unity build to filter out the nonexistent ".h.o" files. This already gives for free the handling of genlist, which was mentioned in a TODO comment.
2021-06-18holders: Fix the remaining code to respect the holder changesDaniel Mensinger1-1/+1
2021-06-18holders: remove unholderDaniel Mensinger1-45/+32
2021-06-18holders: Introduce BothLibrariesDaniel Mensinger1-0/+20
2021-06-18holders: Introduce HoldableObjectDaniel Mensinger1-15/+15
2021-06-18build: textwrap.dedent() some stringsDaniel Mensinger1-10/+18
2021-06-18build: add type annotations for the IncludeDirs objectDylan Baker1-9/+11
2021-06-15build: Fully annotate GeneratedListDylan Baker1-11/+17
2021-06-15build: Generator add missing annotationsDylan Baker1-5/+6
2021-06-15build: cleanup Generator.proccess_files a bitDylan Baker1-5/+5
2021-06-15interpreterobjects|build: use typed_kwargs for generator.processDylan Baker1-8/+5
2021-06-15interpreter|build: use typed_pos_args and unholder in the interpreterDylan Baker1-4/+3
For generator.process_files. Just cleaner and nicer
2021-06-15build: Pass name of generator to initializerDylan Baker1-4/+6
It's really a property of the Generator what name to use, not something that should be passed to each call to process files.
2021-06-15interpreter|build: Do Generator keyword argument checking in the interpreterDylan Baker1-52/+13
For qt we already have all of the necissary checking in place. Now in the interpreter we have the same, the intrperter does all of the checking, then passed the arguments to the Generator initializer, which just assigns the passed values. This is nice, neat, and clean and fixes the layering violatino between build and interpreter.
2021-06-15interpreter|build: Pass just the executable down to GeneratorDylan Baker1-7/+2
This requires that the interpreter has done the validation, which it now does at all callsites. This simplifies the Generator initializer.
2021-06-08build: fix type annotations fo project_*_argsDylan Baker1-2/+2
These are Dict[str, Dict[str, List[str]]], unlike global arguments because they must store the information per subproject
2021-06-07condense linesEli Schwartz1-6/+3
2021-06-07more f-strings everywhereEli Schwartz1-27/+27
pyupgrade didn't catch many .format() methods which were too complex (e.g. multiline or applied to templates rather than string literals)
2021-06-07Add C compiler when using CythonDylan Baker1-1/+1
Since cython transpiles to C.
2021-06-07compilers: Add cython file suffixesDylan Baker1-0/+1
2021-06-07build: Add type annotations for GeneratorDylan Baker1-14/+15
They're not 100% complete, but it's mostly there.
2021-06-04build: Add a type annotation to CustomTargetDylan Baker1-1/+1
2021-06-02build: Use ImmutableSetProtocol for lru_cache'd valueDylan Baker1-2/+2
To avoid mutation if possible.
2021-06-02build: use typing.Mapping for lru_cached dictsDylan Baker1-9/+9
Thankfully the typing module provides us an immutable protocol for mappings, so we don't have to write one ourselves.
2021-06-02use an immutable list for an lru_cached functionsDylan Baker1-2/+3
When mutable items are stored in an lru cache, changing the returned items changes the cached items as well. Therefore we want to ensure that we're not mutating them. Using the ImmutableListProtocol allows mypy to find mutations and reject them. This doesn't solve the problem of mutable values inside the values, so you could have to do things like: ```python ImmutableListProtocol[ImmutableListProtocol[str]] ``` or equally hacky. It can also be used for input types and acts a bit like C's const: ```python def foo(arg: ImmutableListProtocol[str]) -> T.List[str]: arg[1] = 'foo' # works while running, but mypy errors ```
2021-05-28Add a helper to simplify the usage of PerMachineDefaultableDylan Baker1-19/+10
2021-05-28build: Use a PerMachineDefaultable for (project|global)[_link]_argsDylan Baker1-4/+15
2021-05-28build: Use a PerMachineDefaultable for dependency override cacheDylan Baker1-2/+8
This way if we're doing a host == build configuration then the build and host dependencies will be stored correctly.
2021-05-28build: fix type annotation importDylan Baker1-1/+1
2021-05-19build: annotate can_compile_remove_sourcesDylan Baker1-1/+1
2021-05-19build: Simplify BuildTarget.process_sourcelistDylan Baker1-14/+14
2021-05-19interpreter: Pass unholdered sources into BuildTargetDylan Baker1-3/+3
The build level shouldn't be deal with interpreter objects, by the time they leave the intpreter they should be in the Meson middle layer representaiton
2021-04-19pkgconfig: Add support for CustomTarget objects in generatorXavier Claessens1-0/+3
Fixes: #8618.
2021-04-18Xcode: fix generators that take custom targets as inputs.Jussi Pakkanen1-2/+8
2021-04-10Xcode: Fix source generation.Jussi Pakkanen1-0/+7
2021-03-26Remove ConfigureFile and ConfigureFileHolderXavier Claessens1-26/+0
They are not used anywhere.
2021-03-23environment(): Allow stacking append() and prepend() (#8547)Xavier Claessens1-1/+1
* environment(): Allow stacking append() and prepend() * Update docs/markdown/Reference-manual.md Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>