From 81ff303d2ef2b0265c3f077979925caddbb56734 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 23 Aug 2025 09:11:19 +0300 Subject: [PATCH] meson.build: check for pthread_setname_np --- meson.build | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/meson.build b/meson.build index 3ec8a5fc..6bf392e7 100644 --- a/meson.build +++ b/meson.build @@ -165,6 +165,19 @@ else message('no wordexp, no command-line option expansion') endif +pthread_setname_np_code = ''' +#include +int main() { return pthread_setname_np(pthread_self(), "test"); } +''' +pthread_setname_np_check = cxx.compiles( + pthread_setname_np_code, + name: 'pthread_setname_np check', + args: '-D_GNU_SOURCE' +) +if pthread_setname_np_check + config_h_data.set('HAVE_PTHREAD_SETNAME_NP', 1) +endif + if not get_option('tests').disabled() # only needed for tests cp=find_program('cp')