summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cython.py
AgeCommit message (Collapse)Author
2025-11-19compilers: Remove CoreDAta parameter from Compiler.cached_compileDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.has_typeDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.get_option_compile_argsDylan Baker
2025-11-19compilers: Remove Environment parameter from Compiler.sanity_checkDylan Baker
2025-11-19compilers: Remove Environment parameter from get_compileropt_valueDylan Baker
2025-10-06Revert "compilers: refactor sanity checking code"Dylan Baker
This reverts commit 806289a5d27958a084bc6cba41b7cf9ccee4ecf4.
2025-10-06compilers: refactor sanity checking codeDylan Baker
The goal is to reduce code duplication, and allow each language to implement as little as possible to get good checking. The main motivation is that half of the checks are fragile, as they add the work directory to the paths of the generated files they want to use. This works when run inside mesonmain because we always have an absolute build directory, but when put into run_project_tests.py it doesn't work because that gives a relative build directory.
2025-04-08coredata: move MutableKeyedOptionDict to optionsDylan Baker
2025-02-13Make all Meson level options overridable per subproject.Jussi Pakkanen
2025-02-05options: Add an EnumeratedUserOption classDylan Baker
This will allow us to take choices out of the UserOption class, which doesn't actually use this attribute.
2025-02-05options: use dataclasses for UserOptionDylan Baker
This reduces code, makes this clearer, and will be a nice step toward the goal of getting everything typesafe. For `UserIntegerOption` this makes a fairly nice, but substantial change in that the old method used a tuple of `(min, value, max)` to pass to the initializer, while all other types just passed `value`. The new `UserIntegerOption` does the same, with keyword arguments for the min and max values.
2025-02-05compilers: remove Compiler.create_optionDylan Baker
This saves a *tiny* bit of typing, but at the cost of requiring either the current solution of throwing up our hands and saying "typing is too hard, better to have bugs!" or an extensive amount of `TypedDict`s, `overloads`, and a very new version of mypy. Let's get our type safety back, even if it means writing a little bit more code.
2024-07-12Rename langopt methodJussi Pakkanen
The public facing name of language options is compiler option, so let's standardise on that.
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen
2024-06-08Use helper method in remaining compiler classes.Jussi Pakkanen
2024-05-23Refactor option classes to their own file.Jussi Pakkanen
2024-03-15Improve error messages for invalid option valuesCharles Brunet
By adding the option name to UserOption object, it is now possible to display the name of the affected option when the given option value is not valid. Fixes #12635
2023-12-23Remove `get_buildtype_args` functionCharles Brunet
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See #10808. Relates to: - #11645 - #12096 - #5920 - #5814 - #8220 - #8493 - #9540 - #10487 - #12265 - #8308 - #8214 - #7194 - #11732
2023-02-10cython: wire up support for emitting and using depfilesEli Schwartz
This solves rebuild issues when e.g. importing a .pxd header from a .pyx file, just like C/C++ source headers. The transpiler needs to run again in this case. This functionality is present in the 3.0.0 alphas of cython, and is also backported to 0.29.33. Fixes #9049
2023-02-01treewide: add future annotations importEli Schwartz
2022-03-22OptionOverrideProxy: Make it immutable to avoid copiesXavier Claessens
It is always used as an immutable view so there is no point in doing copies. However, mypy insist it must implement the same APIs as Dict[OptionKey, UserOption[Any]] so keep faking it.
2021-09-24Add option to to transpile Cython to C++Dylan Baker
This patch adds a new meson built-in option for cython, allowing it to target C++ instead of C as the intermediate language. This can, of course, be done on a per-target basis using the `override_options` keyword argument, or for the entire project in the project function. There are some things in this patch that are less than ideal. One of them is that we have to add compilers in the build layer, but there isn't a better place to do it because of per target override_options. There's also some design differences between Meson and setuptools, in that Meson only allows options on a per-target rather than a per-file granularity. Fixes #9015
2021-06-07cython: Add an option for selecting python 3 vs python 2 outputDylan Baker
2021-06-07hack: compilers/cython: hardcode python 3 not 2Dylan Baker
2021-06-07compilers: Add a cython CompilerDylan Baker