1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
# https://mesonbuild.com/Python-module.html
defines = []
dependencies = [python.dependency()]
link_args = []
if coremidi_support
defines += ['-D__MACOSX_CORE__']
#defines += ['-frtti']
dependencies += [coremidi_dep]
link_args += [
'-framework', 'CoreAudio',
'-framework', 'CoreMIDI',
'-framework', 'CoreFoundation'
]
endif
if alsa_support or jack_support
dependencies += [threads_dep]
endif
if alsa_support
defines += ['-D__LINUX_ALSA__']
dependencies += [alsa_dep]
endif
if winmm_support
defines += ['-D__WINDOWS_MM__']
if meson.get_compiler('cpp').get_id() != 'gcc'
defines += ['/EHsc']
endif
dependencies += [winmm_dep]
endif
if jack_support
defines += ['-D__UNIX_JACK__', '-DJACK_HAS_PORT_RENAME']
if have_semaphore
defines += ['-DHAVE_SEMAPHORE']
endif
dependencies += [jack_dep]
endif
if get_option('verbose')
defines += ['-D__RTMIDI_DEBUG__']
else
defines += ['-D__RTMIDI_SILENCE_WARNINGS__']
endif
# Build and install the extension module
module = python.extension_module(
'_rtmidi',
[rtmidi_cython, rtmidi_sources],
dependencies: dependencies,
cpp_args: defines,
link_args: link_args,
include_directories: rtmidi_inc,
install: true,
subdir: 'rtmidi',
)
# Generate version.py file
version_py = configure_file(
input: 'version.py.in',
output: 'version.py',
configuration: {
'VERSION': meson.project_version()
}
)
# Pure Python sources
python_sources = files([
'__init__.py',
'midiconstants.py',
'midiutil.py',
])
# Install pure Python modules
python.install_sources(
python_sources,
version_py,
subdir: 'rtmidi',
)
|