Commit Graph

11117 Commits

Author SHA1 Message Date
Xavier Claessens 27970b1d85 msubprojects: Add message at the end of purge 2021-06-25 15:16:55 -04:00
Xavier Claessens 2b6fe00e3d msubprojects: Run action on all subprojects in parallel
This moves all the code into a class and call its run() method in a
thread. The class queues all logs to print them at the end to avoid
mixing output of multiple actions.
2021-06-25 15:16:55 -04:00
Daniel Mensinger b95d6e319f typing: Annotate compilers.detect 2021-06-25 19:34:48 +02:00
Daniel Mensinger 3f889606c7 Split compiler detection from Environment
This moves all the compiler detection logic into the new
compilers.detect module. This dramatically reduces the size
and complexity of Environment.
2021-06-25 19:34:48 +02:00
Daniel Mensinger 0f237b8d1d linkers: move linkers.py into the linkers package 2021-06-25 19:34:48 +02:00
Xavier Claessens d3d95d39be gnome: add update_desktop_database to post_install() 2021-06-23 15:48:32 -04:00
Xavier Claessens 39c6571a46 gnome: Set GSETTINGS_SCHEMA_DIR in devenv 2021-06-23 15:48:32 -04:00
Xavier Claessens 0bef89b0c2 interpreter: Empty list used to be allowed in install_headers/man
That change introduced when porting to @typed_pos_args breaks gtk4. We
could decide to deprecate/warn but should not error for backward
compatibility.
2021-06-23 10:15:00 -04:00
Jussi Pakkanen 6e0a0fd1da
Merge pull request #8884 from dcbaker/submit/type-and-annotate-install-functions
Add annotations for the various install_* functions
2021-06-23 01:00:59 +03:00
Jussi Pakkanen 0e5f88baf4
Merge pull request #8912 from mensinda/fixBothLibraries
Fix `BothLibraries` processing
2021-06-23 00:54:58 +03:00
Daniel Mensinger c4b8e03895
tests: both_library test improvements
This switches some `shared_library()` calls to `library()` and adds
one new CI matrix entries for -Ddefault_library={static, both}.
2021-06-22 21:09:25 +02:00
Daniel Mensinger 0c4dd81c4d
fix: Handling BothLibraries objects (fixes #8907) 2021-06-22 21:09:19 +02:00
Jussi Pakkanen 39f25ec6aa
Merge pull request #8905 from mensinda/refactorFix
fix: Fix set_variable not holderifying (fixes #8904)
2021-06-22 21:26:38 +03:00
Daniel Mensinger 765aff5a42 coverage: Enable coverage reports 2021-06-22 21:05:11 +03:00
fanc999 edfe24178d
Add Visual Studio 2012/2013 backends (#8803)
* 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-22 21:00:23 +03:00
Jussi Pakkanen 7588dbc587
Merge pull request #8900 from bonzini/extract-objects-docs
extract_objects: fixes, tests and documentation for using the result in a custom_target
2021-06-22 20:39:58 +03:00
Dylan Baker a44c1d18c1
Merge pull request #8898 from e820/interpreter-required-arguments
interpreter: Add checked kwarg to compiler.get_supported_arguments
2021-06-22 09:50:24 -07:00
Dylan Baker 132420a059 minstall: make intentions clearer
The existing code works, but it probably doesn't do what the author
thought it would do. `(x or y or z) is not None` works by checking that
each of those things are *truthy* in turn, and returning the first
truthy value, which is compared against None. Using `all()` makes it
very clear that what you want to do is make sure that each value is not
None.
2021-06-22 09:13:41 -07:00
Dylan Baker d636b92c1a install_*: FileMode doesn't need to be None
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-22 09:13:41 -07:00
Dylan Baker 7213b7d81f interpreter: use typed_kwargs for install_man 2021-06-22 09:13:41 -07:00
Dylan Baker 7619f31f71 interpreter: man sections can be up to 9 on many platforms
Linux and FreeBSD use section 9 for kernel man pages, so we should allow
that.
2021-06-22 09:13:41 -07:00
Dylan Baker 9611bd8244 interpreter: use typed_pos_args for install_man 2021-06-22 09:13:41 -07:00
Dylan Baker f4d2efbed3 interpreter: use typed_kwargs for install_headers 2021-06-22 09:13:41 -07:00
Dylan Baker 251dff56fb interpreter: use typed_pos_args for install_headers 2021-06-22 09:13:41 -07:00
Dylan Baker ea3d85a1c0 interpreter: use typed_kwargs for install_data 2021-06-22 09:13:41 -07:00
Dylan Baker a551e76137 interpreter: use typed_pos_args for install_data 2021-06-22 09:13:41 -07:00
Dylan Baker 596c8d4af5 interpreter: use typed_kwargs for install_subdir 2021-06-22 09:12:54 -07:00
Dylan Baker 3d940fec98 interpreter: use typed_pos_args for install_subdir 2021-06-22 09:12:54 -07:00
Dylan Baker dd296f321b interpreterbase: Add evolve to KwargInfo
This works just like OptionKey.evolve, pass new keyword arguments to
override old ones, otherwise the original versions are copied to the new
one.
2021-06-22 09:12:54 -07:00
Dylan Baker a024f432dd interpreter: add overload for source_strings_to_files
when only passing strings or Files we only get back Files. This is
useful for the install_* methods
2021-06-22 09:12:54 -07:00
Dylan Baker f276b2349a mesonlib: add rsplit and and maxsplit
Since string has a maxsplit as well, we should implement that for
polymorphism
2021-06-22 09:12:54 -07:00
Dylan Baker 86da131129 mesonlib: Fix FileMode type annotations 2021-06-22 09:12:54 -07:00
Dylan Baker 5d3a60ae65 minstall: fix type annotation for add_arguments
This takes an `argparse.ArgumentParser` instance, not a namespace
2021-06-22 09:12:54 -07:00
Dylan Baker f2ad5e377e backend: Headers.install_subdir is allowed to be None
But we don't properly handle that.
2021-06-22 09:12:54 -07:00
Jon Turney bee4dc9f78 Fix project tests category name used in skippable() and XML output
Since 25df6e7d split the iteration over tests to start them from the
iteration to collect their results, the variable 'name' is only being
set in the first iteratiorn, so all tests are treated as being in the
last test category read (probably 'wasm') for skipppable() and in the
XML output.

Store the category name in the TestDef object
Use it in skippable()
Use it in classname attribute of XML test results
2021-06-22 16:23:09 +02:00
Paolo Bonzini bd75e0398f extract_objects: skip headers when building custom_target command line
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-22 15:56:46 +02:00
Justin Handville 5650c9b769 Fixed unused-parameter/strict-prototypes warnings. 2021-06-22 12:46:17 +02:00
Justin Handville ee240b60b8 Added test case to test fix for issue 8910. 2021-06-22 12:46:17 +02:00
Justin Handville e8e03cdc72 Fixed style issue as per comments on PR 8911. 2021-06-22 12:46:17 +02:00
Justin Handville 9f248c778d Fix for Issue 8910 (Meson filters CMake asm files) 2021-06-22 12:46:17 +02:00
Paolo Bonzini a656febccf extract_objects: test and document using the result in a custom_target
QEMU would like to use the result of extract_objects in a custom_target;
examples are using objcopy, or using the object files as the key to look
up command line arguments in compile_commands.json.  This is slightly
peculiar and not covered by the test suite, but it works; in order to avoid
regressions, add a test case and document it.
2021-06-22 10:40:38 +02:00
Laurin-Luis Lehning 281f5abee3 interpreter: Replace manual kwarg validation in compiler.get_supported_arguments with @typed_kwargs 2021-06-22 07:59:08 +02:00
Daniel Mensinger 5cd9f88d6c fix: Ensure that build targets have all methods from ExternalProgram
As a side-effect from #8885 `find_program()` returns now `Executable`
objects when `meson.override_find_program` is called with an
executable target. To resolve this conflict the missing methods
from `ExternalProgram` are added to `BuildTarget`.
2021-06-21 20:19:06 +03:00
Laurin-Luis Lehning d5ed8f61a5 interpreter: Move argument checks from add_*_arguments to compiler.get_supported_arguments 2021-06-21 09:15:13 +02:00
Laurin-Luis Lehning 377adfb6fb docs: Fix snippet heading for required project arguments 2021-06-21 09:15:13 +02:00
Laurin-Luis Lehning e44587fc73 interpreter: Consider the compiler language before checking arguments 2021-06-21 09:15:13 +02:00
Laurin-Luis Lehning c9ad98ef5e interprter: Add required kwarg to add_(project|global)_arguments
To avoid manual compiler support checks add_project_arguments and
add_global_arguments receive a new keyword argument to perform
them automatically.
2021-06-21 09:15:13 +02:00
Daniel Mensinger 0358445b6e
fix: dicts and list need _holderify for fallback 2021-06-20 00:26:06 +02:00
Daniel Mensinger a73791b529
fix: Fix strange holder_map bug in combination with subprojects
I was unable to reproduce this in a minimal test-case, so there
is currently no new test :(
2021-06-20 00:26:06 +02:00
Daniel Mensinger f1ac7db2e6
fix: Fix set_variable not holderifying (fixes #8904) 2021-06-20 00:26:02 +02:00