diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-09-14 20:26:14 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-01-09 21:07:23 +0200 |
commit | 24221d71ccd341759b008cf1918826910c40247c (patch) | |
tree | 16edc7011ba57678fbe8393d7076966dc70564df /test cases | |
parent | 9cf0991a1d332cb1f492376bf718aa75020519e4 (diff) | |
download | meson-24221d71ccd341759b008cf1918826910c40247c.zip meson-24221d71ccd341759b008cf1918826910c40247c.tar.gz meson-24221d71ccd341759b008cf1918826910c40247c.tar.bz2 |
Created a Python 3 module for simpler building of Python extension modules.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/python3/2 extmodule/ext/meson.build | 15 | ||||
-rw-r--r-- | test cases/python3/2 extmodule/meson.build | 1 | ||||
-rw-r--r-- | test cases/python3/3 cython/libdir/meson.build | 4 | ||||
-rw-r--r-- | test cases/python3/3 cython/meson.build | 2 |
4 files changed, 6 insertions, 16 deletions
diff --git a/test cases/python3/2 extmodule/ext/meson.build b/test cases/python3/2 extmodule/ext/meson.build index 7d67953..d5d8849 100644 --- a/test cases/python3/2 extmodule/ext/meson.build +++ b/test cases/python3/2 extmodule/ext/meson.build @@ -1,17 +1,6 @@ -if host_machine.system() == 'darwin' - # Default suffix is 'dylib' but Python does not use for extensions. - suffix = 'so' -elif host_machine.system() == 'windows' - # On Windows the extension is pyd for some unexplainable reason. - suffix = 'pyd' -else - suffix = [] -endif - -pylib = shared_library('tachyon', +pylib = py3_mod.extension_module('tachyon', 'tachyon_module.c', dependencies : py3_dep, - name_prefix : '', - name_suffix : suffix) +) pypathdir = meson.current_build_dir() diff --git a/test cases/python3/2 extmodule/meson.build b/test cases/python3/2 extmodule/meson.build index 92a12b2..582a14e 100644 --- a/test cases/python3/2 extmodule/meson.build +++ b/test cases/python3/2 extmodule/meson.build @@ -3,6 +3,7 @@ project('Python extension module', 'c', # Because Windows Python ships only with optimized libs, # we must build this project the same way. +py3_mod = import('python3') py3_dep = dependency('python3', required : false) if py3_dep.found() diff --git a/test cases/python3/3 cython/libdir/meson.build b/test cases/python3/3 cython/libdir/meson.build index 5c0352e..0d015f0 100644 --- a/test cases/python3/3 cython/libdir/meson.build +++ b/test cases/python3/3 cython/libdir/meson.build @@ -14,10 +14,8 @@ pyx_c = custom_target('storer_pyx', command : [cython, '@INPUT@', '-o', '@OUTPUT@'], ) -slib = shared_library('storer', +slib = py3_mod.extension_module('storer', 'storer.c', pyx_c, - name_prefix : '', - name_suffix : suffix, dependencies : py3_dep) pydir = meson.current_build_dir() diff --git a/test cases/python3/3 cython/meson.build b/test cases/python3/3 cython/meson.build index 22bbf7a..c6027ac 100644 --- a/test cases/python3/3 cython/meson.build +++ b/test cases/python3/3 cython/meson.build @@ -5,6 +5,8 @@ cython = find_program('cython3', required : false) py3_dep = dependency('python3', required : false) if cython.found() and py3_dep.found() + py3_dep = dependency('python3') + py3_mod = import('python3') subdir('libdir') test('cython tester', |