Skip to content

Commit 270dcfc

Browse files
committed
openal-soft: don't add lpthread to MINGW
Signed-off-by: Rosen Penev <[email protected]>
1 parent 7dbfe47 commit 270dcfc

File tree

3 files changed

+42
-38
lines changed

3 files changed

+42
-38
lines changed

releases.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,6 +3245,7 @@
32453245
"openal"
32463246
],
32473247
"versions": [
3248+
"1.24.3-2",
32483249
"1.24.3-1",
32493250
"1.24.2-1",
32503251
"1.24.1-1",

subprojects/packagefiles/openal-soft/meson.build

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ project(
44
license: 'LGPL-2.1-or-later',
55
version: '1.24.3',
66
meson_version: '>=0.58',
7-
default_options: ['cpp_std=c++17', 'c_std=c11'],
87
)
98

9+
cpp_std = 'cpp_std=c++17'
10+
1011
cpp = meson.get_compiler('cpp')
1112
if meson.version().version_compare('>= 0.62')
1213
dl_dep = dependency(
@@ -19,8 +20,15 @@ else
1920
required: false,
2021
)
2122
endif
23+
2224
fmt_dep = dependency('fmt')
23-
thread_dep = dependency('threads')
25+
26+
if host_machine.system() != 'windows'
27+
thread_dep = dependency('threads')
28+
else
29+
thread_dep = declare_dependency()
30+
endif
31+
2432
alsa_dep = dependency(
2533
'alsa',
2634
required: get_option('alsa'),
@@ -355,45 +363,39 @@ if cdata.get('HAVE_RTKIT')
355363
alc_sources += files('core/dbus_wrap.cpp', 'core/rtkit.cpp')
356364
endif
357365

358-
foreach h : ['guiddef.h', 'pthread_np.h']
359-
cdata.set('HAVE_@0@'.format(h.underscorify().to_upper()), cpp.has_header(h))
366+
headers = {
367+
'dlfcn.h': dl_dep,
368+
'guiddef.h': [],
369+
'pthread_np.h': [],
370+
}
371+
foreach h, d : headers
372+
if cpp.has_header(
373+
h,
374+
dependencies: d,
375+
)
376+
cdata.set('HAVE_@0@'.format(h.underscorify().to_upper()), 1)
377+
endif
360378
endforeach
361379

362-
cdata.set(
363-
'HAVE_DLFCN_H',
364-
cpp.has_header(
365-
'dlfcn.h',
366-
dependencies: dl_dep,
367-
),
368-
)
369-
370380
#needs to be check_header for LLVM as well as MinGW
371381
cdata.set('HAVE_CPUID_H', cpp.check_header('cpuid.h'))
372382
cdata.set('HAVE_INTRIN_H', cpp.check_header('intrin.h'))
373383

374-
#need to check for non windows because meson wrongly detects its presence under MinGW
375-
cdata.set('HAVE_PROC_PIDPATH', cpp.has_function('proc_pidpath'))
376-
cdata.set(
377-
'HAVE_PTHREAD_SETSCHEDPARAM',
378-
cpp.has_function(
379-
'pthread_setschedparam',
380-
dependencies: thread_dep,
381-
),
382-
)
383-
cdata.set(
384-
'HAVE_PTHREAD_SETNAME_NP',
385-
cpp.has_function(
386-
'pthread_setname_np',
387-
dependencies: thread_dep,
388-
),
389-
)
390-
cdata.set(
391-
'HAVE_PTHREAD_SET_NAME_NP',
392-
cpp.has_function(
393-
'pthread_set_name_np',
394-
dependencies: thread_dep,
395-
),
396-
)
384+
functions = {
385+
#need to check for non windows because meson wrongly detects its presence under MinGW
386+
'proc_pidpath': [],
387+
'pthread_setschedparam': thread_dep,
388+
'pthread_setname_np': thread_dep,
389+
'pthread_set_name_np': thread_dep,
390+
}
391+
foreach f, d : functions
392+
if cpp.has_function(
393+
f,
394+
dependencies: d,
395+
)
396+
cdata.set('HAVE_@0@'.format(f.underscorify().to_upper()), 1)
397+
endif
398+
endforeach
397399

398400
cdata.set('HAVE_CPUID_INTRINSIC', cpp.get_argument_syntax() == 'msvc')
399401
cdata.set(
@@ -469,6 +471,7 @@ endif
469471
common_lib = static_library(
470472
'common',
471473
common_sources,
474+
override_options: cpp_std,
472475
pic: true,
473476
dependencies: fmt_dep,
474477
)
@@ -490,6 +493,7 @@ openal_lib = library(
490493
alc_sources,
491494
hrtf_h,
492495
cpp_args: openal_args,
496+
override_options: cpp_std,
493497
dependencies: [
494498
common_dep,
495499
dl_dep,
@@ -522,9 +526,7 @@ openal_dep = declare_dependency(
522526
compile_args: get_option('default_library') == 'static' ? '-DAL_LIBTYPE_STATIC' : [],
523527
)
524528

525-
if meson.version().version_compare('>=0.54.0')
526-
meson.override_dependency('openal', openal_dep)
527-
endif
529+
meson.override_dependency('openal', openal_dep)
528530

529531
install_headers(
530532
'include/AL/al.h',

subprojects/packagefiles/openal-soft/utils/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ foreach u, d : utils
2222
executable(
2323
u.split('.')[0],
2424
u,
25+
override_options: cpp_std,
2526
dependencies: d,
2627
link_args: cpp.get_supported_arguments('-municode'),
2728
)

0 commit comments

Comments
 (0)