aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
AgeCommit message (Collapse)AuthorFilesLines
2021-10-10Add --vsenv command line option and active VS only when neededXavier Claessens1-2/+1
2021-10-10Fix typos discovered by codespellChristian Clauss1-1/+1
2021-10-10ar linker: generate thin archives for uninstalled static librariesEli Schwartz1-1/+1
Since they will never be used outside of the build directory, they do not need to literally contain the .o files, and references will be sufficient. This covers a major use of object libraries, which is that the static library would potentially take up a lot of space by including another copy of every .o file. Fixes #9292 Fixes #8057 Fixes #2129
2021-10-10Merge pull request #9373 from anarazel/vs-build-speedJussi Pakkanen1-170/+69
backend/vs: Parallelize compilation inside one project
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-08backend/vs: Parallelize compilation inside one project.Andres Freund1-0/+1
UseMultiToolTask allows parallelism inside a project, without requiring cl.exe internal multi-threading (which meson generated projects currently can't use, mainly due to specifying output filenames for each object). TODO: - think about making behaviour conditional on msbuild version / add comment why not
2021-10-08backend/vs: Deduplicate basic project template.Andres Freund1-171/+61
Note that a few minor details of the output changed for some target types. I think I called them out with XXXs in the code for now.
2021-10-08backend/vs: Name pch pdb files to avoid naming & lock conflicts.Andres Freund1-0/+7
2021-10-08backend/vs: Move Microsoft.Cpp.props to before ItemDefinitionGroup.Andres Freund1-2/+3
The main reason for this move is to make it easier to merge the copies of project generation. But as far as I can tell, the Microsoft.Cpp.props import also belongs before the ItemDefinitionGroup. Originally the order seems to have been that way, but 431a9ea664 changed it in the course of other changes.
2021-10-04backend/vs: process link dependencies.Andres Freund1-0/+10
Partially-Fixes: #1799
2021-10-04fix extra whitespaceEli Schwartz3-7/+0
discovered via flake8 --select E303
2021-10-04remove useless variables that are no longer or were never usedEli Schwartz2-2/+0
2021-10-01rust: dependencies need to cause a rebuild/relink not just reorderDylan Baker1-1/+6
Otherwise changes to a dependency don't propogate
2021-09-30Make custom_target() name argument optionalXavier Claessens1-1/+2
2021-09-24ninjabackend: Rust use Backend.generate_basic_compiler_argsDylan Baker1-9/+1
Instead of open coding it. This simplifies things, and fixes some missing functionality
2021-09-24Merge pull request #9167 from dcbaker/submit/meson-main-type-checkingJussi Pakkanen1-1/+2
Add type annotations and type checking to meson main
2021-09-24Add option to to transpile Cython to C++Dylan Baker1-2/+4
This patch adds a new meson built-in option for cython, allowing it to target C++ instead of C as the intermediate language. This can, of course, be done on a per-target basis using the `override_options` keyword argument, or for the entire project in the project function. There are some things in this patch that are less than ideal. One of them is that we have to add compilers in the build layer, but there isn't a better place to do it because of per target override_options. There's also some design differences between Meson and setuptools, in that Meson only allows options on a per-target rather than a per-file granularity. Fixes #9015
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-22Merge pull request #9274 from anarazel/fix-vs-static-generatedJussi Pakkanen1-0/+3
backends/vs: Set ObjectFileName for generated sources.
2021-09-20ninjabackend/vs: handle builddir on different drive from cwdRyan Kuester1-1/+7
When setup creates a Visual Studio environment, a message is logged which contains a path to the build directory. Typically, this path is converted to a relative path prior to printing. If the path cannot be converted to a relative path (e.g., because buildpath is on a different drive from the cwd), print out the full path instead of failing with an unhandled exception.
2021-09-20backends/vs: Set ObjectFileName for generated sources.Andres Freund1-0/+3
When a static library B to a static library A with generated sources, B directly references the object file corresponding to the generated source in A. For that reference in B object_filename_from_source() is used. But A did not specify the object file name, ending up with cl.exe's default. Fixes: #9235
2021-09-20backend/ninja: add generated sources to depscan order depsDylan Baker1-2/+6
Since we changed to using a json file to avoid over long command lines we created a situation where the generated files may not be ready when the depscan happens. To avoid that, we need to add all of the generated sources as order deps. Fixes: #9258
2021-09-16Fix ignored install_tag kwarg in install_subdir()Xavier Claessens1-1/+1
Fixes: #9263
2021-09-14apply flake8 fixes for unused imports and missing importsEli Schwartz1-1/+1
2021-09-14fix untested codepath? add:item() is surely a typo, not a real functionEli Schwartz1-1/+1
2021-09-14backends/vs: Do not emit dummy command for alias_command().Andres Freund1-11/+19
Alias commands did not work with the vs backend, due to trying to access target.command[0] with an empty command. Fix this by just not emitting a CustomBuild node for alias targets - the project references are enough to trigger the necessary actions. Fixes: #9247
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-31pyllint: enable consider-user-enumerateDylan Baker3-10/+4
This caught a couple of cases of us doing: ```python for i in range(len(x)): v = x[i] ``` which are places to use enumerate instead. It also caught a couple of cases of: ```python assert len(x) == len(y) for i in range(len(x)): xv = x[i] yv = y[i] ``` Which should instead be using zip() ```python for xv, yv in zip(x, y): ... ```
2021-08-31pylint: turn on superflous-parensDylan Baker4-29/+29
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-31pylint: enable consider-iterating-dictionaryDylan Baker1-1/+1
This didn't actually catch what it's supposed to, which is cases of: ```python for x in dict.keys(): y = dict[x] ``` But it did catch one unnecessary use of keys(), and one case where we were doing something in an inefficient way. I've rewritten: ```python if name.value in [x.value for x in self.kwargs.keys() if isinstance(x, IdNode)]: ``` as ``python if any((isinstance(x, IdNode) and name.value == x.value) for x in self.kwargs): ``` Which avoids doing two iterations, one to build the list, and a second to do a search for name.value in said list, which does a single short circuiting walk, as any returns as soon as one check returns True.
2021-08-28Delete old outputs that are no longer in the Ninja file.Jussi Pakkanen1-0/+1
2021-08-21Fix duplicated frameworks in the Xcode backend.Jussi Pakkanen1-1/+7
2021-08-21Fix multiple generators in target in Xcode.Jussi Pakkanen1-2/+2
2021-08-21Path special casing for the Xcode backend.Jussi Pakkanen2-2/+10
2021-08-21Handle .C extension in Xcode.Jussi Pakkanen1-1/+4
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/xcode: remove unused compiler parameter from escape_extra_argsDylan Baker1-2/+1
2021-08-20backends: remove unused name parameter from as_meson_exe_cmdlineDylan Baker4-10/+7
This parameter isn't used, at all, so just remove it
2021-08-20ninjabackend: add missing type annotationDylan Baker1-1/+1
I needed to figure this out for the purposes of annotating CleanTrees anyway.
2021-08-20backends: move method from ninjabackend to base classDylan Baker2-8/+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-20backends/vs: add a missing annotationDylan Baker1-1/+1
2021-08-18backends/ninja: write depscan input files to jsonDylan Baker1-9/+18
Currently, we write each file to the command line, but this can result in situations where the number of files passed exceeds OS imposed command line limits. For compilers, we solve this with response files. For depscan I've chosen to use a JSON list instead. JSON has several advantages in that it's standardized, there's a built-in python module for it, and it's familiar. I've also chosen to always use the JSON file instead of having a heuristic to decide between JSON and not JSON, while there may be a small performance trade off here, keeping the implementation simple with only one path is wort it. Fixes #9129