port to the meson build system
The meson build system is a fast, modern, ergonomic build system with great support for python extensions and cython.
This is a rebased version of https://github.com/Cangjians/pycangjie/pull/40 with a couple slight tweaks for issues that I discovered.
range-diff between my original Github PR and this one:
1: 3e5d197 ! 1: c7ed7ee port to the meson build system
@@ meson.build (new)
## src/cangjie/meson.build (new) ##
@@
-+fs.copyfile('__init__.py')
++mods = [fs.copyfile('__init__.py')]
+py.install_sources('__init__.py', subdir: 'cangjie')
+
+foreach mod: ['_core', 'errors', 'filters', 'versions']
-+ py.extension_module(
++ mods += py.extension_module(
+ mod,
+ mod+'.pyx',
+ cython_args: ['-I', meson.current_source_dir()],
@@ tests/meson.build (new)
+test(
+ 'python unittests',
+ py, args: ['-m', 'unittest', 'discover', meson.current_source_dir()],
++ depends: mods,
+ env: env,
+)
-: ------- > 2: ec68698 support building libcangjie as a meson subproject
-: ------- > 3: 93a073b update the CI for meson