mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
meson: Update the pthread feature checks
For GNU extensions, we need to define _GNU_SOURCE; but, more importantly, we need to tell Meson to use the threadlib dependency when compiling and linking the feature check. This currently exposes a bug in Meson; see: https://github.com/mesonbuild/meson/issues/2165 But once that's fixed, the check will work as intended. https://bugzilla.gnome.org/show_bug.cgi?id=785955
This commit is contained in:
parent
1a755a63e1
commit
50eeb24415
21
meson.build
21
meson.build
@ -1273,14 +1273,21 @@ else
|
||||
glib_conf.set('HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP', 1)
|
||||
endif
|
||||
if cc.links('''#include <pthread.h>
|
||||
int main() {
|
||||
pthread_setname_np("example");
|
||||
}''', name : 'pthread_setname_np(const char*)')
|
||||
int main() {
|
||||
pthread_setname_np("example");
|
||||
}''',
|
||||
name : 'pthread_setname_np(const char*)',
|
||||
dependencies : thread_dep)
|
||||
glib_conf.set('HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID', 1)
|
||||
elif cc.links('''#include <pthread.h>
|
||||
int main() {
|
||||
pthread_setname_np(pthread_self(), "example");
|
||||
}''', name : 'pthread_setname_np(pthread_t, const char*)')
|
||||
elif cc.links('''#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
int main() {
|
||||
pthread_setname_np(pthread_self(), "example");
|
||||
}''',
|
||||
name : 'pthread_setname_np(pthread_t, const char*)',
|
||||
dependencies : thread_dep)
|
||||
glib_conf.set('HAVE_PTHREAD_SETNAME_NP_WITH_TID', 1)
|
||||
endif
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user