aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)AuthorFilesLines
2020-08-25qt module: add qresource support to compile_translationsEli Schwartz1-11/+49
A common pattern in Qt5 applications is to embed translations in the executable using the qresource system. In this case, the list of translation files is already available in the .qrc file and there's no good reason to duplicate this info in meson.build. Let compile_translations optionally take a qrc input, in which case it will go straight to generating the relevant translations and rcc-generated .cpp, and directly return the thing users actually care about -- the .cpp for linking.
2020-08-09cmake: Make the CMake targte not found error more useful (see #7567)Daniel Mensinger1-1/+3
2020-07-30pkgconfig: Fix various corner casesXavier Claessens1-19/+72
See unit tests for the exact scenarios this PR fixes.
2020-07-19Stabilize keyval moduleMarc-André Lureau1-0/+0
We have experimented with the module for about a year in a qemu branch (https://wiki.qemu.org/Features/Meson), and we would like to start moving the build system to meson. For that, keyval should have the stability guarantees. Cc: Paolo Bonzini <pbonzini@redhat.com>
2020-07-13qt module: rcc supports depfiles now, given a recent enough version of Qt5Eli Schwartz3-7/+10
Add depfile support to generated targets for Qt >= 5.14. Move warning into the module init itself, to check if the version is too old before issuing. Also tweak the wording itself, to advise upgrading to a suitable version of Qt5 instead of advising to wait for a Qt bug to be fixed.
2020-07-05Don't make unactionable warnings fatalNirbheek Chauhan3-3/+3
Some warnings are out of the user's control, such as the RCC QT bug, or the GNU windres bug, or our informational warning about auto-disabling of options when -Db_bitcode is enabled. Such warnings should not be fatal when --fatal-meson-warnings is passed because there's no action that the user can take to fix it. The only purpose it serves is to prevent people who use those features from using --fatal-meson-warnings.
2020-07-04qt: Fix has_tools() when required=FalseXavier Claessens1-36/+15
Improve logs by making it clear when the program is found but has wrong version.
2020-07-01Merge pull request #7231 from mensinda/cmOverrideJussi Pakkanen1-9/+101
cmake: Add more advanced subproject configuration options
2020-06-24pkgconfig: Add missing cflags in uninstalled filesXavier Claessens1-16/+11
Fixes: #7365
2020-06-16Update mesonbuild/modules/gnome.pyXavier Claessens1-1/+1
Co-authored-by: Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
2020-06-16Update mesonbuild/modules/gnome.pyXavier Claessens1-1/+1
Co-authored-by: Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
2020-06-16gnome: Add fatal_warnings kwarg to generate_gir()Xavier Claessens1-2/+11
Fixes: #7130
2020-06-12modules/cmake: Fix setting install_dirDylan Baker1-2/+1
Fixes: #7301
2020-06-05cmake: Add more advanced subproject configuration optionsDaniel Mensinger1-9/+101
This is done with the new cmake subprojects options object that is similar to the already exisiting configuration data object. It is consumed by the new `options` kwarg of the cmake.subproject function.
2020-05-27Fix lack of space after 'Cflags:' in pkgconfig filesSoapux1-1/+1
2020-05-22Merge pull request #7123 from dcbaker/use-feature-deprecatedJussi Pakkanen2-11/+6
Use FeatureDeprecated (and other cleanups)
2020-05-15ninjabackend: Treat GNOME gir/typelib as librariesNirbheek Chauhan1-0/+11
When classifying generated sources, we were treating gir/typelib files generated by gobject-introspection as headers. This is bad because it serializes the build by adding order-only dependencies to every target even though sources will never actually use them for anything. Treat them as libraries, which is somewhat more accurate.
2020-05-14use FeatureNew.single_useDylan Baker1-3/+3
This is just slightly cleaner looking
2020-05-14modules/pkgconfig: Remove duplicate FeatureNewDylan Baker1-2/+0
2020-05-14interpreter: Replace some uses of mlog.deprecation with FeatureDeprecatedDylan Baker1-6/+3
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.
2020-05-14gnome.generate_gir: Fix missing include directoriesXavier Claessens1-6/+4
This revert a part of #7020 because it was using gir_inc_dirs before it is set. Properly fix typelib_includes instead that was working only when g-i is a pkgconfig dependency.
2020-05-10python: install_sources() should default to pure, following the docMarc-André Lureau1-1/+1
As stated by the doc, default to install python sources to purelib location, as they should not depend on platform. This also fixes discrepancy between get_install_dir() and install_sources() locations. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-05-08rename unstable-kconfig to unstable-keyvalPaolo Bonzini1-6/+4
Discussions in #6524 have shown that there are various possible uses of the kconfig module and even disagreements in the exact file format between Python-based kconfiglib and the tools in Linux. Instead of trying to reconcile them, just rename the module to something less suggestive and leave any policy to meson.build files. In the future it may be possible to add some kind of parsing through keyword arguments such as bool_true, quoted_strings, etc. and possibly creation of key-value lists too. For now, configuration_data objects provide an easy way to access quoted strings. Note that Kconfig stores false as "absent" so it was already necessary to write "x.has_key('abc')" rather than the more compact "x['abc']". Therefore, having to use configuration_data does not make things much more verbose.
2020-05-07Allow overriding g-ir-scanner and g-ir-compiler binaries.James Hilliard1-2/+10
This is useful when one needs to force meson to use wrappers for cross compilation. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-04-30gnome: Print proper error when 'nsversion' or 'namespace' are missingXavier Claessens1-2/+6
2020-04-28gnome: Fix usage of gobject-introspection as subprojectXavier Claessens1-59/+37
2020-04-28find_program: Fixes when the program has been overridden by executableXavier Claessens1-5/+5
- ExternalProgramHolder has path() method while CustomTargetHolder and BuildTargetHolder have full_path(). - The returned ExternalProgramHolder's path() method was broken, because build.Executable object has no get_path() method, it needs the backend. - find_program('overridden_prog', version : '>=1.0') was broken because it needs to execute the exe that is not yet built. Now assume the program has the (sub)project version. - If the version check fails, interpreter uses ExternalProgramHolder.get_name() for the error message but build.Executable does not implement get_name() method.
2020-04-21switch python2 %s for python3 .formatMichael1-1/+1
2020-03-29Report an errror if glib-compile-resources is missingJon Turney1-1/+4
Produce a diagnostic if we try to use gnome.compile_resources() when glib-compile-resources isn't present, rather than a python backtrace.
2020-03-24Make werror per subproject optionXavier Claessens1-1/+1
2020-03-23gtkdoc: Add missing permitted kwargXavier Claessens1-1/+1
The 'check' kwarg was added in Meson 0.52.0.
2020-03-23Fix legacy env var support with crossJohn Ericson3-4/+4
Fix #3969
2020-03-09pkgconfig: Document conflicts keywordFini Jastrow1-1/+1
[why] Sometimes one want to set the 'Conflicts:' field in .pc files. This is possible by using the 'conflicts' keyword argument in the pkgconfig module. The feature is not documented on mesonbuild.org, though. But a warning is issued: WARNING: Passed invalid keyword argument "conflicts". WARNING: This will become a hard error in the future. History: It has been added along with kwarg 'url' with commit 309041918 pkgconfig: Add missing 'URL' and 'Conflicts' entries Later the kwargs check has been introduced with 80d665e8d Converted some modules. but both 'url' and 'conflicts' were missing. With commit 2acf737b pkgconfig: Document url keyword the 'url' kwarg has been added to the checks, but not 'conflicts'. [how] Add 'conflicts' to the allowed kwargs. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2020-03-08Merge pull request #6736 from dcbaker/mesonlib-type-annotationsJussi Pakkanen6-55/+29
Mesonlib type annotations
2020-03-08qt5: Add has_tools() methodXavier Claessens1-1/+20
2020-03-05Make use of unholderDylan Baker4-42/+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.
2020-03-05remove ability to pass multiple keys to extract_as_listDylan Baker2-3/+3
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.
2020-03-05Remove some uses of mesonlib.run_onceDylan Baker2-5/+4
These are basically doing what mlog.log(..., once=True) does, so lets just use that. The once argument to mlog is newer, so these probably should have been changed already.
2020-03-05mesonlib: Replace unholder argument to listifyDylan Baker2-5/+5
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.
2020-03-03pkgconfig: Fix deprecation message (fixes #6720)Stéphane Cerveau1-2/+1
Deprecation warning was unable to display because of patch c8f8d58273a40d94c820dccab54a7ae2d948cb8a fixes #6720
2020-02-26mesonbuild/modules/gnome.py: Fix giscanner and gicompiler logicAdam Duskett1-0/+4
Currently, giscanner and the gicompiler paths are only scanned via pkg-config if they are first found in the host path. Add a else statement to fix this oversite.
2020-02-25gobject-introspection: determine g-ir-scanner and g-ir-compiler paths from ↔Adam Duskett1-3/+18
pkgconfig Currently, meson hard codes the paths of these binaries which results in cross-compiled environments to run the host versions of these tools. However, GObject-introspection provides the appropriate paths to these utilities via pkg-config find_program is needed in the case g-i is built as a subproject. If g-ir-scanner or g-ir-compiler are in the build or source directory use those. If they aren't found in the source directory, use the results from pkg-config.
2020-02-20Introduce dataonly for the pkgconfig moduleRohan Garg1-22/+38
This allows users to disable writing out the inbuilt variables to the pkg-config file as they might actualy not be required. One reason to have this is for architecture-independent pkg-config files in projects which also have architecture-dependent outputs. For example : https://gitlab.freedesktop.org/wayland/weston/issues/269 Fixes #4011
2020-02-19modules/cmake: Add a found() method to the cmake subprojectDylan Baker1-0/+8
Just like the native meson subproject has.
2020-02-19modules/cmake: Use the noPosargs helperDylan Baker1-3/+2
2020-02-17modules/python: Do not error out if positional args are passedNirbheek Chauhan1-1/+5
Also update the documentation. Fixes https://github.com/mesonbuild/meson/issues/6470
2020-02-06add FeatureNewMichael Hirsch, Ph.D1-0/+5
2020-02-06add fs.stem()Michael Hirsch, Ph.D1-2/+11
2020-02-06fs: add expanduser methodMichael Hirsch, Ph.D1-1/+8
this should help users specify leading `~` in various Meson options and variables without refactoring lots of places inside Meson itself.
2020-02-06fs: add methods as_posix, is_absoluteMichael Hirsch, Ph.D1-7/+43
fs: make exception specify method name fs: actually raise exceptions fs: resolve path e.g. /opt/foo/.. => /opt/foo fs: correct behavior of is_symlink