11project (
22 ' python-rtmidi' ,
33 ' cpp' ,
4- version : ' 1.5.0 ' ,
4+ version : ' 1.5.1 ' ,
55 license : ' MIT' ,
66 default_options : [
77 ' warning_level=2'
@@ -11,40 +11,9 @@ project(
1111
1212cpp = meson .get_compiler(' cpp' )
1313
14- ## From https://github.com/numpy/numpy/blob/main/numpy/meson.build
15- # Platform detection
16- if host_machine .system() == ' windows' and cpp.get_id() == ' gcc'
17- # For mingw-w64, link statically against the UCRT.
18- gcc_link_args = [' -lucrt' , ' -static' ]
19-
20- add_project_link_arguments (gcc_link_args, language : [' c' , ' cpp' ])
21- # Force gcc to float64 long doubles for compatibility with MSVC
22- # builds, for C only.
23- add_project_arguments (' -mlong-double-64' , language : ' c' )
24- # Make fprintf("%zd") work (see https://github.com/rgommers/scipy/issues/118)
25- add_project_arguments (' -D__USE_MINGW_ANSI_STDIO=1' , language : [' c' , ' cpp' ])
26- # Manual add of MS_WIN64 macro when not using MSVC.
27- # https://bugs.python.org/issue28267
28- add_project_arguments (' -DMS_WIN64' , language : [' c' , ' cpp' ])
29- endif
30- ##
31-
32- if host_machine .system() == ' darwin'
33- # Enable c++11 support
34- add_project_arguments (' -std=c++11' , language : [' cpp' ])
35- endif
36-
37- # Dependencies
14+ # Jack API (portable)
3815jack2_dep = dependency (' jack' , version : ' >=1.9.11' , required : false )
3916jack1_dep = dependency (' jack' , version : [' >=0.125.0' , ' <1.0' ], required : false )
40- alsa_dep = dependency (' alsa' , required : false )
41- threads_dep = dependency (' threads' )
42- coremidi_dep = dependency (
43- ' appleframeworks' ,
44- modules : [' coreaudio' , ' coremidi' , ' foundation' ],
45- required : false
46- )
47- winmm_dep = cpp.find_library (' winmm' , required : false )
4817
4918if not jack2_dep.found() and jack1_dep.found()
5019 jack_dep = jack1_dep
5524 jack_dep = disabler ()
5625endif
5726
27+
28+ jack_not_found = jack_dep.found() ? false : true
29+
30+ ## From https://github.com/numpy/numpy/blob/main/numpy/meson.build
31+ # Platform dependent config
32+ if host_machine .system() == ' windows'
33+ # WINDOWS
34+ if cpp.get_id() == ' gcc'
35+ # For mingw-w64, link statically against the UCRT.
36+ gcc_link_args = [' -lucrtbase' , ' -static' ]
37+ add_project_link_arguments (gcc_link_args, language : [' c' , ' cpp' ])
38+ # Make fprintf("%zd") work (see https://github.com/rgommers/scipy/issues/118)
39+ add_project_arguments (' -D__USE_MINGW_ANSI_STDIO=1' , language : [' c' , ' cpp' ])
40+ # Manual add of MS_WIN64 macro when not using MSVC.
41+ # https://bugs.python.org/issue28267
42+ add_project_arguments (' -DMS_WIN64' , language : [' c' , ' cpp' ])
43+ elif cpp.get_id() == ' msvc'
44+ # Force gcc to float64 long doubles for compatibility with MSVC
45+ # builds, for C only.
46+ add_project_arguments (' -mlong-double-64' , language : ' c' )
47+ endif
48+
49+ # API
50+ winmm_dep = cpp.find_library (' winmm' , required : jack_not_found)
51+ elif host_machine .system() == ' darwin'
52+ # OSX
53+
54+ # Enable c++11 support
55+ add_project_arguments (' -std=c++11' , language : [' cpp' ])
56+
57+ # API
58+ coremidi_dep = dependency (
59+ ' appleframeworks' ,
60+ modules : [' coreaudio' , ' coremidi' , ' foundation' ],
61+ required : jack_not_found
62+ )
63+ else
64+ # LINUX
65+
66+ # API
67+ alsa_dep = dependency (' alsa' , required : jack_not_found)
68+ threads_dep = dependency (' threads' )
69+ endif # Platform detection
70+
5871pymod = import (' python' )
5972python = pymod.find_installation(get_option (' python' ), required : true )
6073
7285summary ({
7386 ' Debug messages (verbose)' : get_option (' verbose' ),
7487 ' Build for wheel' : get_option (' wheel' ),
88+ ' JACK support' : jack_dep.found() and get_option (' jack' ),
7589 ' ALSA support' : host_machine .system() == ' linux' and alsa_dep.found() and get_option (' alsa' ),
7690 ' CoreMIDI support' : host_machine .system() == ' darwin' and coremidi_dep.found() and get_option (' coremidi' ),
77- ' JACK support' : jack_dep.found() and get_option (' jack' ),
7891 ' Window MM support' : host_machine .system() == ' windows' and winmm_dep.found() and get_option (' winmm' ),
7992}, section : ' Configuration' )
93+
0 commit comments