aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)AuthorFilesLines
2021-02-07Add Qt6 moduleLuca Weiss2-2/+28
2021-02-07Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgenJussi Pakkanen1-3/+77
Add a wrapper to the rust module for bindgen
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen2-7/+7
run_target: Add env kwarg
2021-02-06rust: Add a module wrapper for bindgenDylan Baker1-3/+77
This has a couple of advantages over rolling it by hand: 1. it correctly handles include_directories objects, which is always handy 2. it correctly generates a depfile for you, which makes it more reliable 3. it requires less typing
2021-02-06modules/rust: use typed_pos_argsDylan Baker1-10/+5
2021-02-05run_target: Add env kwargXavier Claessens2-7/+7
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-02-05gnome: Add post_install() methodXavier Claessens1-18/+67
Various GNOME projects have scripts that does similar task, better do it directly in meson. This ensures it's done correctly regarding usage of subprojects and pkg-config. See for example this gtk bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/3626. Fixes: #8268
2021-02-04Introduce `fs.read` to read a file as a stringLuke Drummond1-1/+64
Following #7890, this patch introduces the ability to read the contents of a file to the fs module. This patch introduces the ability to read files at configure time, but has some restrictions: - binary files are not supported (I don't think this will prove a problem, and if people are wanting to do something with binary files, they should probably be shelling out to their own script). - Only files outside the build directory allowed. This limitation should prevent build loops. Given that reading an arbitrary file at configure time can affect the configuration in almost arbitrary ways, meson should force a reconfigure when the given file changes. This is non-configurable, but this can easily be changed with a future keyword argument.
2021-02-02Quick update of table of CUDA Toolkit vs. NVIDIA driver versions.Olexa Bilaniuk1-0/+2
2021-01-30Merge pull request #8264 from xclaesse/ep-miscJussi Pakkanen1-14/+19
external_project: misc improvements
2021-01-30Fix executable as script on WindowsXavier Claessens3-9/+4
On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
2021-01-29external_project: Add default configure optionsXavier Claessens1-12/+12
2021-01-29external_project: Do not set LD in the envXavier Claessens1-1/+4
This was breaking some autotools projects such as libyaml.
2021-01-29external_project: Improve loggingXavier Claessens1-1/+3
Write output of 'make' and 'make install' into log files as well when not verbose.
2021-01-20external_project: Log configure commandXavier Claessens1-0/+4
2021-01-19Replace NinjaBackend is_rust_target with build.uses_rustDylan Baker1-1/+1
we have two functions to do the exact same thing, and they're basically implemented the same way. Instead, let's just use the BuildTarget one, as it's more generally available.
2021-01-17external_project: Write output in log files when not verboseXavier Claessens1-2/+7
2021-01-14Merge pull request #8192 from dcbaker/submit/minstall-type-annotationsJussi Pakkanen4-13/+13
Add type annotations to minstall (and some related cleanups)
2021-01-13build/interpreter: Split InstallDir to fix layering violationDylan Baker1-9/+9
Currently InstallDir is part of the interpreter, and is an Interpreter object, which is then put in the Build object. This is a layering violation, the interperter should have a Holder for build data. This patch fixes that.
2021-01-13build/interperter: Add annotations and move input validation to interpreterDylan Baker3-4/+4
This moves the user input validation to the interpreter, instead of being in the build module, and adds type annotations.
2021-01-13Fix misspellsAntonin Décimo3-4/+4
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-11rename cflags_mapping to CFLAGS_MAPPINGDylan Baker1-4/+4
This is PEP8 convention for a const variable. Also, make the type Mapping, which doesn't have mutation methods. This means mypy will warn us if someone tries to change this.
2021-01-05modules: Add an unstable-rust moduleDylan Baker1-0/+137
Like other language specific modules this module is module for holding rust specific helpers. This commit adds a test() function, which simplifies using rust's internal unittest mechanism. Rust tests are generally placed in the same code files as they are testing, in contrast to languages like C/C++ and python which generally place the tests in separate translation units. For meson this is somewhat problematic from a repetition point of view, as the only changes are generally adding --test, and possibly some dependencies. The rustmod.test() method provides a mechanism to remove the repatition: it takes a rust target, copies it, and then addes the `--test` option, then creates a Test() target with the `rust` protocol. You can pass additional dependencies via the `dependencies` keyword. This all makes for a nice, DRY, test definition.
2021-01-04Use a single coredata dictionary for optionsDylan Baker7-20/+21
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-5/+9
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2020-11-20use real pathlib moduleDylan Baker4-4/+4
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
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