aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
AgeCommit message (Collapse)AuthorFilesLines
2021-10-29Make environment objects hash deterministically.Jussi Pakkanen1-3/+8
2021-10-08add install_emptydir functionEli Schwartz1-0/+15
This replaces the absolute hack of using ``` install_subdir('nonexisting', install_dir: 'share') ``` which requires you to make sure you don't accidentally or deliberately have a completely different directory with the same name in your source tree that is full of files you don't want installed. It also avoids splitting the name in two and listing them in the wrong order. You can also set the install mode of each directory component by listing them one at a time in order, and in fact create nested structures at all. Fixes #1604 Properly fixes #2904
2021-10-04fix extra whitespaceEli Schwartz1-1/+0
discovered via flake8 --select E303
2021-09-24build: use an object rather than a dict for the dep_manifestDylan Baker1-1/+2
This really is more of a struct than a dict, as the types are disjoint and they are internally handled, (ie, not from user input). This cleans some things up, in addition I spotted a bug in the ModuleState where the dict with the version and license is passed to a field that expects just the version string.
2021-09-16Fix ignored install_tag kwarg in install_subdir()Xavier Claessens1-1/+1
Fixes: #9263
2021-09-06mintro: add installed_planFilipe Laíns1-28/+48
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-01run_target: do not yield broken names with subdirsEli Schwartz1-1/+4
A run_target object created in a subdir/meson.build always has a ninja rule name of "name", not "subdir/name". Fixes #9175
2021-08-31pylint: turn on superflous-parensDylan Baker1-7/+7
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-21Path special casing for the Xcode backend.Jussi Pakkanen1-1/+5
2021-08-20backend/backends: use a TypedDict for introspection dataDylan Baker1-1/+11
Which is easier to reason about as a human, and narrower, allowing for more accurate type checking.
2021-08-20backend/backends: Add type annotations to BackendDylan Baker1-147/+223
2021-08-20backend/backends: Add verbose to ExecutableSerialisiation initializerDylan Baker1-1/+2
There are cases in the backend like this: ```python e = ExecutableSerialisation(...) e.verbose = v ``` setting it from the initializer is cleaner.
2021-08-20backend/backends: Add type annotations to ExecutableSerilalisationDylan Baker1-3/+12
2021-08-20backend/backends: Add type annotations to SubdirInstallDataDylan Baker1-1/+2
2021-08-20backend/backends: Add type annotations to TargetInstallDataDylan Baker1-3/+6
2021-08-20backend/backends: Add type annotations to CleanTreesDylan Baker1-1/+1
2021-08-20backend/backends: add type annotations to RegenInfoDylan Baker1-1/+1
2021-08-20backends: remove unused name parameter from as_meson_exe_cmdlineDylan Baker1-1/+1
This parameter isn't used, at all, so just remove it
2021-08-20backends: move method from ninjabackend to base classDylan Baker1-3/+8
The baseclass has code that assumes said method exists, and it really doesn't seem to do anything ninja specific, so move it to the generic backend.
2021-08-17Add install tagsXavier Claessens1-20/+60
Fixes: #7007.
2021-06-29Add feed arg to custom_target()Simon Ser1-11/+21
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-3/+3
2021-06-28 build: fix object path for vs backendDenis Fortin1-1/+8
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-4/+6
Add annotations for the various install_* functions
2021-06-22Add Visual Studio 2012/2013 backends (#8803)fanc9991-0/+6
* backends: Add a Visual Studio 2013 backend This is more-or-less a quick port from the VS2015 backend, except that we update the Visual Studio version strings and toolset versions accordingly. Also correct the generator string for Visual Studio 2015 in mesonbuild/cmake/common.py. * backend: Add VS2012 backend Similar to what we did for Visual Studio 2013, add a Visual Studio 2012 backend. * vs2010backend.py: Implement `link_whole:` if needed We actually need Visual Studio 2015 Update 2 to use `/WHOLEARCHIVE:`, which is what we are currently using for `link_whole:` on Visual Studio. For Visual Studio versions before that, we need to expand from the static targets that were indicated by `link_whole:`, and any of the sub-dependent targets that were pulled in via the dependent target's `link_whole:`. This wil ensure `link_whole:` would actually work in such cases. * vs2010backend.py: Handle objects from generated sources Unforunately, we can't use backends.determine_ext_objs() reliably, as the Visual Studio backends handle this differently. * vs2010backend.py: Fix generating VS2010 projects Visual Studio 2010 (at least the Express Edition) does not set the envvar %VisualStudioVersion% in its command prompt, so fix generating VS2010 projects by taking account into this, so that we can determine the location of vcvarsall.bat correctly. * whole archive test: Disable on vs2012/2013 backends too The Visual Studio 2012/2013 IDE has problems handling the items that would be generated from this test case, so skip this test when using --backend=vs[2012|2013]. This test does work for the Ninja backend when VS2012 or VS2013 is used, though. Consolidate this error message with XCode along with the vs2010 backend. * docs: Add the new vs2012 and vs2013 backends Let people know that we have backends for vs2012 and 2013. Also let people know that generating Visual Studio 2010 projects have been fixed and the pre-vs2015 backends now handle the `link_whole:` project option.
2021-06-22install_*: FileMode doesn't need to be NoneDylan Baker1-3/+0
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/+6
But we don't properly handle that.
2021-06-18holders: remove unholderDaniel Mensinger1-9/+9
2021-06-14backends: fix TestSerialisation.suite annotationsDylan Baker1-1/+1
It's a `str[]` not `str`
2021-06-07condense linesEli Schwartz1-4/+2
2021-06-07more f-strings everywhereEli Schwartz1-11/+11
pyupgrade didn't catch many .format() methods which were too complex (e.g. multiline or applied to templates rather than string literals)
2021-06-02use an immutable list for an lru_cached functionsDylan Baker1-6/+6
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-23Add swift executable support in Xcode.Jussi Pakkanen1-0/+6
2021-05-19backends: use a set for processed targets instead of a dictDylan Baker1-1/+1
We're only interested in the keys, not in the value (which was always set to True), so a set is a better data structure anyway.
2021-04-26introspection: export all sources for custom targetsJason Francis1-0/+2
Also adds some test cases for source files in target_sources.
2021-04-25Xcode: make Swift projects work.Jussi Pakkanen1-0/+6
2021-04-21Xcode: put all include dirs via a property rather than a cmd line arg.Jussi Pakkanen1-2/+6
2021-04-19Xcode: regenerato project file when build conf changes.Jussi Pakkanen1-0/+16
2021-04-18Xcode: fix running commands that lie in the build root dir.Jussi Pakkanen1-1/+1
2021-04-18Xcode: fix custom target chaining.Jussi Pakkanen1-2/+2
2021-04-16Xcode: fix custom targets that produce objs and libs.Jussi Pakkanen1-0/+24
2021-04-11Xcode: fix setting up inlude args for source and build dirs.Jussi Pakkanen1-2/+6
2021-04-10Xcode: Fix source generation.Jussi Pakkanen1-1/+13
2021-04-09Write include dirs with absolute paths in the Xcode backend, relative ones ↵Jussi Pakkanen1-4/+7
do not seem to work.
2021-03-26backends: Remove @PRIVATE_OUTDIR_(ABS)@ substitutionXavier Claessens1-12/+0
It is not documented and does not seems to be used anywhere.
2021-03-23devenv: Set GI_TYPELIB_PATH and LD_LIBRARY_PATH (#8548)Xavier Claessens1-3/+18
2021-03-19split program related classes and functions out of dependenciesDylan Baker1-7/+8
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-16Add `meson devenv` command and meson.add_devenv()Xavier Claessens1-0/+19
2021-03-16EnvironmentVariables: Simplify and annotateXavier Claessens1-4/+4