aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)AuthorFilesLines
2021-04-19pkgconfig: Add support for CustomTarget objects in generatorXavier Claessens1-6/+18
Fixes: #8618.
2021-04-18pkgconfig: Fix broken paths in -uninstalled.pc on WindowsXavier Claessens1-11/+6
Fixes: #8668
2021-04-12interpreter: Split permitted_kwargs dictXavier Claessens2-4/+4
2021-04-01interpreter: Move to its own folder and split itXavier Claessens3-5/+5
2021-03-26pkgconfig: Allow setting prefix in dataonly pc fileXavier Claessens1-2/+4
Some variables are reserved because meson set them automatically. But we are not setting them for dataonly pc files, so there is no reason to reserve them. Fixes: #8583.
2021-03-26modules/external_project: use typed_pos_argsDylan Baker1-9/+5
2021-03-24Merge pull request #8568 from dcbaker/submit/qt-dependency-factoryJussi Pakkanen1-11/+64
QT: use a proper dependency factory
2021-03-23Refactor Qt Dependency into proper split classes with factoriesDylan Baker1-13/+9
Currently the Qt Dependencies still use the old "combined" method for dependencies with multiple ways to be found. This is problematic as it means that `get_variable()` and friends don't work, as the dependency can't implement any of those methods. The correct solution is to make use of multiple Dependency instances, and a factory to tie them together. This does that. To handle QMake, I've leveraged the existing config-tool mechanism, which allows us to save a good deal of code, and use well tested code instead of rolling more of our own code. The one thing this doesn't do, but we probably should, is expose the macOS ExtraFrameworks directly, instead of forcing them to be found through QMake. That is a problem for another series, and someone who cares more about macOS than I do.
2021-03-23devenv: Set GI_TYPELIB_PATH and LD_LIBRARY_PATH (#8548)Xavier Claessens1-5/+14
2021-03-22qt: move compilers_detect to the qt moduleDylan Baker1-2/+59
It's a method on the QtDependeny that exists purely for the consumption of the qt module (in the form, return some stuff the module makes into an instance variable). So put it where it actually belongs, and pass the qt dependency into it.
2021-03-19Move OverrideProgram to programsDylan Baker1-2/+2
2021-03-19split program related classes and functions out of dependenciesDylan Baker9-16/+19
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-16externalproject: Flatten configure_options kwargXavier Claessens1-8/+11
2021-03-16externalproject: Do not add --includedir by defaultXavier Claessens1-1/+3
Some projects (e.g. OpenSSL) does not support setting include directory at all.
2021-03-16externalproject: Fix error when used from main projectXavier Claessens1-1/+1
2021-03-05Port CUDA module to new API.Olexa Bilaniuk1-11/+23
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz14-81/+81
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz5-8/+8
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-03-04Simplify module APIXavier Claessens4-16/+54
- ModuleState is now a real class that will have methods in the future for actions modules needs, instead of using interpreter internal API. - New ModuleObject base class, similar to InterpreterObject, that should be used by all objects returned by modules. Its methods gets the ModuleState passed as first argument. It has a `methods` dictionary to define what is public API that can be called from build definition. - Method return value is not required to be a ModuleReturnValue any more, it can be any type that interpreter can holderify, including ModuleObject. - Legacy module API is maintained until we port all modules. In the future modules should be updated: - Use methods dict. - Remove snippets. - Custom objects returned by modules should all be subclass of ModuleObject to get the state iface in their methods. - Modules should never call into interpreter directly and instead state object should have wrapper API. - Stop using ModuleReturnValue in methods that just return simple objects like strings. Possibly remove ModuleReturnValue completely since all objects that needs to be processed by interpreter (e.g. CustomTarget) should be created through ModuleState API.
2021-03-03pkgconfig: Add missing permitted kwargsXavier Claessens1-1/+1
Fixes #8462
2021-03-02exernal_project: Fix default cross compile parametersLeif Middelschulte1-1/+1
The variable `{host}` cannot be successfully expanded. Using the `@HOST@` parameter, as suggested by the documentation, works.
2021-02-27install_man locale supportJason Woodward1-1/+4
Rather than having to manually build the locale aware man paths with `install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')` Support doing `install_man('foo.fr.1', locale: 'fr')`
2021-02-26modules/fs: Use typed_pos_argsDylan Baker1-75/+40
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens4-7/+8
By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
2021-02-16CUDA Toolkit 11.2.1 has been released, update version tableOlexa Bilaniuk1-1/+2
Strangely, the minimum version of CUDA Toolkit 11.2.0 has also been updated - downwards. We pick up this change as well.
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.