diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-08-24 09:20:03 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-09-24 22:56:46 +0300 |
commit | 68c23a61203fc35dd11c7a0b1cc13f7cc2c5cf8c (patch) | |
tree | 5afe315e41b55e8b12f3b1b56d75bfd766620cae /test cases/cython | |
parent | 524a95fa62a6e0cb77e53d7b38d5c2d59a75e449 (diff) | |
download | meson-68c23a61203fc35dd11c7a0b1cc13f7cc2c5cf8c.zip meson-68c23a61203fc35dd11c7a0b1cc13f7cc2c5cf8c.tar.gz meson-68c23a61203fc35dd11c7a0b1cc13f7cc2c5cf8c.tar.bz2 |
Add option to to transpile Cython to C++
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
Diffstat (limited to 'test cases/cython')
-rw-r--r-- | test cases/cython/1 basic/libdir/storer.h | 8 | ||||
-rw-r--r-- | test cases/cython/1 basic/test.json | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test cases/cython/1 basic/libdir/storer.h b/test cases/cython/1 basic/libdir/storer.h index 4f71917..6f5bc6f 100644 --- a/test cases/cython/1 basic/libdir/storer.h +++ b/test cases/cython/1 basic/libdir/storer.h @@ -1,8 +1,16 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _Storer Storer; Storer* storer_new(); void storer_destroy(Storer *s); int storer_get_value(Storer *s); void storer_set_value(Storer *s, int v); + +#ifdef __cplusplus +} +#endif diff --git a/test cases/cython/1 basic/test.json b/test cases/cython/1 basic/test.json new file mode 100644 index 0000000..ed7ac2b --- /dev/null +++ b/test cases/cython/1 basic/test.json @@ -0,0 +1,10 @@ +{ + "matrix": { + "options": { + "cython_language": [ + { "val": "c" }, + { "val": "cpp" } + ] + } + } +} |