diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-09-13 11:06:09 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-09-17 13:16:46 -0700 |
commit | 3acc18fcf7c38e7060e43e2de59f09392aa8fdea (patch) | |
tree | f2766ca27c17e1b48bf9a3bc479be6f82947c1b2 /meson.build | |
parent | 60d0c0d062b543b85a354e5266aa974fcdc36290 (diff) |
move pthread_setaffinity_np check to the build system
Rather than trying to encode all of the rules in a header, lets just put
them in the build system where they belong. This fixes the build on
FreeBSD, which does have pthraed_setaffinity_np, but it's in a
pthread_np.h, not behind _GNU_SOURCE. FreeBSD also implements cpu_set
slightly differently, so additional changes would be required to get it
working right there anyway.
v2: - fix #define in autotools
Fixes: 9f1bbbdbbd77d346c74c7abbb31f399151a85713
("util: try to fix the Android and MacOS build")
Cc: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 0d534b9b4a9..0588ebf8e7a 100644 --- a/meson.build +++ b/meson.build @@ -1070,6 +1070,13 @@ pre_args += '-DHAVE_ZLIB' dep_thread = dependency('threads') if dep_thread.found() and host_machine.system() != 'windows' pre_args += '-DHAVE_PTHREAD' + if cc.has_function( + 'pthread_setaffinity_np', + dependencies : dep_thread, + prefix : '#include <pthread.h>', + args : '-D_GNU_SOURCE') + pre_args += '-DHAVE_PTHREAD_SETAFFINITY' + endif endif if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 or with_gallium_opencl dep_elf = dependency('libelf', required : false) |