aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)AuthorFilesLines
2020-11-18Merge pull request #7894 from obilaniu/cudaupdatesJussi Pakkanen1-41/+105
Update unstable CUDA Module to support newest toolkits and drivers.
2020-11-18Merge pull request #7900 from bonzini/stabilize-hashJussi Pakkanen1-2/+2
Avoid build.ninja changes due to order of hash table iteration
2020-11-17gnome: Drop use of volatile in GLib type functionsPhilip Withnall1-1/+1
See https://gitlab.gnome.org/GNOME/glib/-/issues/600 `volatile` was previously mistakenly used in GLib to indicate that a variable was accessed atomically or otherwise multi-threaded. It’s not meant for that, and up to date compilers (like gcc-11) will rightly warn about it. Drop the `volatile` qualifiers. Based on a patch by Jeff Law. See also http://isvolatileusefulwiththreads.in/c/. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-15stabilize sets that are converted to listsPaolo Bonzini1-2/+2
The order of elements in sets cannot be relied upon, because the hash values are randomized by Python. Whenever sets are converted to lists we need to keep their order stable, or random changes in the command line cause ninja to rebuild a lot of files unnecessarily. To stabilize them, use either sort or OrderedSet. Sorting is not always applicable, but it can be faster because it's done in C and it can produce slightly nicer output.
2020-11-13gnome: Handle libraries that are not in the current build dirSam Thursfield1-5/+6
The generate_gir() function previously assumed all library inputs were in the current build dir. This would fail if they weren't.
2020-11-05Update CUDA module's nvcc_arch_flags() and nvcc_arch_readable() for newOlexa Bilaniuk1-35/+96
CUDA Toolkits. Also harden internal logic and add several asserts in the testcase.
2020-11-05Add newer CUDA Toolkit version entries.Olexa Bilaniuk1-6/+9
Also, remove the possibility of passing in a compiler instance to min_driver_version. This is because the NVCC compiler instance is, as of CUDA Toolkit 11.0, no longer guaranteed to be versioned identically to the toolkit itself.
2020-11-04pkgconfig: Make external deps of static library publicXavier Claessens1-3/+6
This fix a regression caused by https://github.com/mesonbuild/meson/pull/7837, it wanted to make InternalDependency's external_deps private but has side effect of making StatisLibrary's external_deps private too. It is technically correct to make them private, but Meson used to make StaticLibrary deps public so they are usable without `pkg-config --static` when we know there is only a static library available. Fixes: #7929.
2020-11-04qt module: fix error message typo, translation qresource accepts qm not tsEli Schwartz1-1/+1
Fixes #7925
2020-11-01gnome: Tweak error messageSam Thursfield1-1/+2
It's an easy mistake to do this: gir1 = gnome.generate_gir(...) gir2 = gnome.generate_gir(... includes: ['GObject-2.0', gir1]) This fails with an error: ERROR: Gir includes must be str, GirTarget, or list of them. The issue is that the 'gir1[0]' should be passed instead of 'gir1'. To make the problem slightly clearly, tweak the error message to be: ERROR: Gir includes must be str, GirTarget, or list of them. Got TypelibTarget.
2020-10-22pkgconfig: Define libdir and includedir in -uninstalled.pc filesXavier Claessens1-6/+5
This fixes glib-2.0-uninstalled.pc file. GLib does `extra_cflags : ['-I${libdir}/glib-2.0/include']` because some of its headers gets installed there. But when used uninstalled that path makes no sense and pkg-config aborts because ${libdir} is not defined. This cannot be worked around by GLib because Meson does not allow setting different `extra_cflags` for -uninstalled.pc, and does not allow setting libdir in `uninstalled_variables`.
2020-10-17Fix gnome.compile_resources() when glib is a subprojectXavier Claessens1-33/+38
When glib is a subproject we should use glib-compile-resources it overrides using find_program() in the case it is not installed on the build machine. With old glib version we have to run glib-compile-resources at configure time to generate the list of dependencies, but not when glib is recent enough.
2020-10-17pkgconfig: InternalDependency's ext_deps should be private by defaultXavier Claessens1-1/+1
This fixes a regression introduced by https://github.com/mesonbuild/meson/pull/7488. InternalDependency's ext_deps previously where simply ignored, but that PR has effect to add many more public Requires in generated pc files.
2020-10-16Fix consistency in variables kwargXavier Claessens1-19/+7
Share common code to extract the `variables` kwarg in declare_dependency() and pkg.generate().
2020-10-15windows: Avoid target name clash happening in GTK+Xavier Claessens1-1/+3
2020-10-15gnome: generate cpp gresource source in cpp projectsmimi899991-2/+8
Closes #7839
2020-10-13include_type: Add CMake subporject dependency method (fixes #6879)Daniel Mensinger1-3/+10
2020-10-06python.dependency() is not respecting 'required' kwargXavier Claessens1-2/+9
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger4-4/+4
2020-09-28windows: reduce chance of going over path limit in backend/vsPeter Harris1-4/+5
When building with vs2019 (not ninja), a path length error will be thrown if the path to a resource file is even remotely deep within the tree. This is largely because the target name includes the string "Windows resource for file 'full path'", which is then expanded twice (once for the .vcxproj itself, and once for IntDir) and added to the full path. When combined with the tiny path limits on Windows, it is easy to exceed path limits. This error is largely avoided by the ninja back-end. Unlike the vs back-end, the ninja back-end does not use target.get_id() as part of the project file path, nor does it use target.get_id() as part of get_target_private_dir(). Example error: error MSB4184: The expression "[MSBuild]::NormalizePath( C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp, f3f7317@@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\, f3f7317@@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus. vcxproj.CopyComplete)" cannot be evaluated. Path: C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp\f3f7317 @@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\f3f7317 @@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus. vcxproj.CopyComplete exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
2020-09-22pylint: turn on bad-indentation errorDylan Baker1-23/+23
and fix all of the bad indentation
2020-09-17Revert "windows: reduce chance of going over path limit in backend/vs"Nirbheek Chauhan1-5/+4
This reverts commit 807f88739ebfa002c9a0b9acd3e24c9610fb02a2.
2020-09-17windows: reduce chance of going over path limit in backend/vsPeter Harris1-4/+5
When building with vs2019 (not ninja), a path length error will be thrown if the path to a resource file is even remotely deep within the tree. This is largely because the target name includes the string "Windows resource for file 'full path'", which is then expanded twice (once for the .vcxproj itself, and once for IntDir) and added to the full path. When combined with the tiny path limits on Windows, it is easy to exceed path limits. This error is largely avoided by the ninja back-end. Unlike the vs back-end, the ninja back-end does not use target.get_id() as part of the project file path, nor does it use target.get_id() as part of get_target_private_dir(). Example error: error MSB4184: The expression "[MSBuild]::NormalizePath( C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp, f3f7317@@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\, f3f7317@@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus. vcxproj.CopyComplete)" cannot be evaluated. Path: C:\src\mesonbuild\Misc\FreeRDP-master\client\X11\xfreerdp\xfreerdp\f3f7317 @@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus\f3f7317 @@Windows resource for file 'Misc_FreeRDP-master_client_X11_xfreerdp_xfreerdp_xfreerdp.rc'@cus. vcxproj.CopyComplete exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
2020-09-13external-project: Add typing annotationXavier Claessens1-7/+20
2020-09-13external-project: New module to build configure/make projectsXavier Claessens1-0/+253
This adds an experimental meson module to build projects with other build systems. Closes: #4316
2020-09-08typing: more fixesDaniel Mensinger1-4/+8
2020-09-08typing: fully annotate fs moduleDaniel Mensinger1-4/+4
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.