diff --git a/docs/markdown/Cython.md b/docs/markdown/Cython.md new file mode 100644 index 000000000..17302b38a --- /dev/null +++ b/docs/markdown/Cython.md @@ -0,0 +1,33 @@ +--- +title: Cython +short-description: Support for Cython in Meson +... + +# Cython + +Meson provides native support for cython programs starting with version 0.59.0. +This means that you can include it as a normal language, and create targets like +any other supported language: + +```meson +lib = static_library( + 'foo', + 'foo.pyx', +) +``` + +Generally Cython is most useful when combined with the python module's +extension_module method: + +```meson +project('my project', 'cython') + +py = import('python') +dep_py3 = py.dependency() + +py.extension_module( + 'foo', + 'foo.pyx', + dependencies : dep_py, +) +``` diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md index eb0210e2a..f2fc663eb 100644 --- a/docs/markdown/Reference-tables.md +++ b/docs/markdown/Reference-tables.md @@ -34,6 +34,7 @@ These are return values of the `get_id` (Compiler family) and | sun | Sun Fortran compiler | | | valac | Vala compiler | | | xc16 | Microchip XC16 C compiler | | +| cython | The Cython compiler | | ## Linker ids @@ -160,6 +161,7 @@ These are the parameter names for passing language specific arguments to your bu | Objective C++ | objcpp_args | objcpp_link_args | | Rust | rust_args | rust_link_args | | Vala | vala_args | vala_link_args | +| Cython | cython_args | cython_link_args | All these `_*` options are specified per machine. See in [specifying options per @@ -177,16 +179,17 @@ are many caveats to their use, especially when rebuilding the project. It is **highly** recommended that you use [the command line arguments](#language-arguments-parameter-names) instead. -| Name | Comment | -| ----- | ------- | -| CFLAGS | Flags for the C compiler | -| CXXFLAGS | Flags for the C++ compiler | -| OBJCFLAGS | Flags for the Objective C compiler | -| FFLAGS | Flags for the Fortran compiler | -| DFLAGS | Flags for the D compiler | -| VALAFLAGS | Flags for the Vala compiler | -| RUSTFLAGS | Flags for the Rust compiler | -| LDFLAGS | The linker flags, used for all languages | +| Name | Comment | +| ----- | ------- | +| CFLAGS | Flags for the C compiler | +| CXXFLAGS | Flags for the C++ compiler | +| OBJCFLAGS | Flags for the Objective C compiler | +| FFLAGS | Flags for the Fortran compiler | +| DFLAGS | Flags for the D compiler | +| VALAFLAGS | Flags for the Vala compiler | +| RUSTFLAGS | Flags for the Rust compiler | +| CYTHONFLAGS | Flags for the Cython compiler | +| LDFLAGS | The linker flags, used for all languages | N.B. these settings are specified per machine, and so the environment varibles actually come in pairs. See the [environment variables per diff --git a/docs/markdown/snippets/first-class-cython.md b/docs/markdown/snippets/first-class-cython.md new file mode 100644 index 000000000..481269767 --- /dev/null +++ b/docs/markdown/snippets/first-class-cython.md @@ -0,0 +1,18 @@ +## Cython as as first class language + +Meson now supports Cython as a first class language. This means you can write: + +```meson +project('my project', 'cython') + +py = import('python') +dep_py3 = py.dependency() + +py.extension_module( + 'foo', + 'foo.pyx', + dependencies : dep_py, +) +``` + +And avoid the step through a generator that was previously required. diff --git a/docs/sitemap.txt b/docs/sitemap.txt index d942aa40c..8014668f4 100644 --- a/docs/sitemap.txt +++ b/docs/sitemap.txt @@ -59,6 +59,7 @@ index.md Java.md Vala.md D.md + Cython.md IDE-integration.md Custom-build-targets.md Build-system-converters.md