summaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)Author
2025-05-05cmake: include_directories() returns an arrayPaolo Bonzini
See the way that it is created: dir_node = assign(dir_var, function(include_directories, tgt.includes)) sys_node = assign(sys_var, function(include_directories, tgt.sys_includes, {is_system: True})) inc_node = assign(inc_var, array([id_node(dir_var), id_node(sys_var)])) Due to incorrect documentation, commit 1f4bb3737 ("modules/cmake: Make fully type safe", 2025-04-02) added an incorrect assertion. Fix both. Fixes: #14530 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-09New xgettext method for i18n moduleCharles Brunet
This method call xgettext to extract translatable string from source files into a .pot translation template. It differs from a plain CustomTarget in three ways: - It accepts build targets as sources, and automatically resolves source files from those build targets; - It detects command lines that are too long, and writes, at config time, the list of source files into a text file to be consumed by the xgettext command; - It detects dependencies between pot extraction targets, based on the dependencies between source targets.
2025-04-09modules/gnome, modules/Python: Allow injecting RPATH flags through LDFLAGS ↵L. E. Segovia
if needed Fixes communicating the RPATH to g-i-scanner in macOS. See #14169
2025-04-02modules/cmake: Make fully type safeDylan Baker
Mostly this was just adding a few asserts for options, and one bug fix from the option refactor
2025-04-02wayland: Mark module stableXavier Claessens
There is no point in printing warning about unstable module, in the worst case we can just deprecate and add new API. It has been tested in a few projects already, and this warning is a blocker on wider adoption.
2025-04-02rust: add link_whole to rust.test and rust.doctestPaolo Bonzini
QEMU needs it in its integration tests (in order to run global constructors), and therefore in rust.doctest too. With this change I could do: # Rust executables do not support objects, so add an intermediate step. rust_qemu_api_objs = static_library( 'rust_qemu_api_objs', objects: [libqom.extract_all_objects(recursive: false), libhwcore.extract_all_objects(recursive: false)]) rust.doctest('rust-qemu-api-doc', _qemu_api_rs, dependencies: [qemu_api, qemu_api_macros], link_with: libqemuutil, link_whole: [rust_qemu_api_objs], suite: ['doc', 'rust']) followed by "meson test --suite doc". For completeness, add it to rust.test as well. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-02rust: add rust.doctestPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-02rust: extract common parts of rust.test and rust.doctestPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-02interpreter, rust: move "args" out of BaseTestPaolo Bonzini
rust.doctest() will have to typecheck that to a list of strings, no other argument types are allowed. Extract the field out of BaseTest, placing it in FuncBenchmark and the rust modules's FuncTest. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-02build, interpreter: associate a doctest target to a BuildTargetPaolo Bonzini
A doctest target is a separate build target (with its own linker arguments, including dependencies) that is built and added as a unit test whenever the parent target is built. The doctest's target is not accessible via ninja. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-03-10coredata: replace get_option with optstore.get_value_forDylan Baker
This is an old method, that is now just a wrapper around the OptionStore method, that doesn't add any value. It's also an option related method attached to the CoreData instead of the OptionStore, so useless and a layering violation.
2025-03-09compilers: convert `b_sanitize` to a free-form array optionPatrick Steinhardt
In the preceding commit we have started to perform compiler checks for the value of `b_sanitize`, which allows us to detect sanitizers that aren't supported by the compiler toolchain. But we haven't yet loosened the option itself to accept arbitrary values, so until now it's still only possible to pass sanitizer combinations known by Meson, which is quite restrictive. Lift that restriction by adapting the `b_sanitize` option to become a free-form array. Like this, users can pass whatever combination of comma-separated sanitizers to Meson, which will then figure out whether that combination is supported via the compiler checks. This lifts a couple of restrictions and makes the supporting infrastructure way more future proof. A couple of notes regarding backwards compatibility: - All previous values of `b_sanitize` will remain valid as the syntax for free-form array values and valid combo choices is the same. We also treat 'none' specially so that we know to convert it into an empty array. - Even though the option has been converted into a free-form array, callers of `get_option('b_sanitize')` continue to get a string as value. We may eventually want to introduce a kwarg to alter this behaviour, but for now it is expected to be good enough for most use cases. Fixes #8283 Fixes #7761 Fixes #5154 Fixes #1582 Co-authored-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Patrick Steinhardt <ps@pks.im>
2025-03-01modules/gnome: Allow to specify the doc-format argumentCorentin Noël
Add the support for the doc-format argument if g-ir-scanner supports it. Ignore the argument otherwise as this is a no-op in such cases.
2025-02-27use ElementaryOptionValues instead of open coding... againDylan Baker
2025-02-27modules/rust: use 'nightly' as the bindgen version if the compiler is nightlyDylan Baker
This adds tracking for both nightly and beta to the rust compiler.
2025-02-27modules/rust: set --rust-edition for bindgen >= 0.71Dylan Baker
But only if the user hasn't manually set it.
2025-02-27modules/rust: Update bindgen target error checking for bindgen >= 0.71Dylan Baker
Which has both changed the error message and relaxed the check. In theory we wouldn't hit this unless you have a very old bindgen and a very new rustc.
2025-02-13Make all Meson level options overridable per subproject.Jussi Pakkanen
2025-02-12modules/pkgconfig: use host machine to calculate install prefixDylan Baker
The `mesonlib.is_*` functions are not correct to use here, since they are for the build machine, not the host machine. This means if the build machine if Linux but the host is Haiku, then pkg-config files willb e installed into $libdir/pkgconfig, instead of $prefix/develop/lib/pkgconfig
2025-01-08qt module: provide qml_modulePierre Lamot
This aims to bring the support of QML modules to meson, the goal is to provide something similar to CMake `qt_add_qml_module` function provided by Qt (see https://doc.qt.io/qt-6/qt-add-qml-module.html ) Fixes: #6988, #9683
2025-01-08qt module: allow moc to generate json introspection filePierre Lamot
2025-01-08qt module: remove quoted annotationsPierre Lamot
2024-12-20modules/rust: Specify the compiler version to bindgen when possibleDylan Baker
bindgen by default may output code that an older rustc cannot successfully consume. To avoid this, we check if bindgen supports the rustc version we're using, if so, and if the user didn't set the `--rust-target` option, we will supply it to ensure that bindgen writes out code our rustc can use. If it does not support that version explicitly, we leave it at the default, assuming that our compiler version is newer than bindgen.
2024-11-19rust: avoid warnings from rust.testPaolo Bonzini
Any argument from the base target is copied to the test target, but some keyword arguments for libraries are not available in executable. Remove them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-11-19make external_project work again on MinGWMihailJP
On Python 3.12, self.prefix.relative_to(self.prefix.drive) no longer works and raises error like: ``` ValueError: 'C:/msys64/mingw64' is not in the subpath of 'C:' ```
2024-11-15interpreter: remove current_linenoDylan Baker
This was only used in a couple of places, and requires extra tracking to ensure it is correct, while we already have `current_node.lineno`, which is always accurate and up to date. I have also fixed a potential strict-null issue by using a sentinel node for `current_node`
2024-10-28external-project: Setup devenv to run programsXavier Claessens
2024-10-01modules/cmake: use typed_kwargs instead of permittedKwargsDylan Baker
2024-10-01modules/cmake: use typed_kwargs for subproject.dependencyDylan Baker
2024-10-01modules/cmake: simplify _args_to_infoDylan Baker
We don't need to pass a list, and we don't need to check length or type
2024-10-01modules/cmake: use typed_pos_args for remaining subproject methodsDylan Baker
Since these are all more-or-less the same
2024-10-01modules/cmake: use typed_pos_args for subproject.dependencyDylan Baker
2024-10-01modules/cmake: use typed_pos_args for subproject.get_variableDylan Baker
2024-09-24qt module: allow has_tools to specify which tools to checkPierre Lamot
This allows checking for tools that may not be available in older version of qt or avoiding requesting tools that may not be necessary for a given project Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
2024-09-14Fix various incorrect uses of `its` vs `it's`.Andrew McNulty
These errors can make reading comments and documentation unnecessarily confusing for users and contributors who do not speak English as their first language.
2024-09-11Fix typosspaette
2024-09-11Fix pkgconfig.generate handling of BothLibraries dependenciesCharles Brunet
Was caused by 7b3169f. Fixes #13657.
2024-09-04modules/gnome: Make 'gnome.yelp()' install actual media with symlinkssid
In cases, when localized media files are provided by some languages, we need to use 'gnome.yelp ()' with 'symlink_media: false' which copies all files from 'C' locale in addition to the localized media. This wastes storage space. The alternative is to use 'symlink_media: true' which symlinks entirely to 'C' media files ignoring localized media files. As a middle ground, if the localized media file exists in the source tree for a language, we use that file rather than symlinking to 'C' media with the same filename even when 'symlink_media: true'. This saves storage space. If there are no localized media files in non-C language, the existing behaviour is maintained.
2024-08-30update various deprecation notices to call out meson 2.0Eli Schwartz
2024-08-06modules/dlang: Use the DubDependency.class_dubbin correctlyRemi Thebault
Which was broken because of DubDependency.class_dubbin typing change. Passed under radar because Dub tests were deactivated in the same PR.
2024-07-30flake8: move unused typing-only imports to TYPE_CHECKINGEli Schwartz
2024-07-19modules/gnome: gnome.compile_resources() must have 'install_dir' if installingRaviRahar
Since they do not implement a default install dir like BuildTargets do. gnome.compile_resources() would result in an unhandled python exception when missing install_dir argument together with providing following arguments: gresource_bundle: true install: true closes: https://github.com/mesonbuild/meson/issues/13447 Signed-off-by: RaviRahar <ravirahar33@gmail.com>
2024-07-17Remove module type from OptionKey.Jussi Pakkanen
2024-07-17Remove language (AKA compiler) type from OptionKey.Jussi Pakkanen
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-06-14Merge pull request #13307 from mesonbuild/optstorerefactorJussi Pakkanen
Convert OptionStore from a dict to a full class with named methods
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen
2024-06-11Python: fix limited API logic under mingwAndrew McNulty
The Python Limited API support that was added in 1.2 had special handling of Windows, but the condition to check for Windows was not correct: it checked for MSVC and not for the target's OS. This causes mingw installations to not have the special handling applied. This commit fixes this to check explicitly for Windows.
2024-05-23Refactor option classes to their own file.Jussi Pakkanen