mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-23 07:19:50 +00:00
meson: Fixes timespec_get detect code
Add functions_to_detect dictionary to records the paths to include Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15497>
This commit is contained in:
parent
cc805aef69
commit
a6dd77149a
18
meson.build
18
meson.build
@ -1434,9 +1434,21 @@ foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'sys/shm.h', '
|
||||
endif
|
||||
endforeach
|
||||
|
||||
foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create', 'random_r',
|
||||
'flock', 'strtok_r', 'getrandom', 'qsort_r', 'qsort_s']
|
||||
if cc.has_function(f)
|
||||
functions_to_detect = {
|
||||
'strtof': '',
|
||||
'mkostemp': '',
|
||||
'timespec_get': '#include <time.h>',
|
||||
'memfd_create': '',
|
||||
'random_r': '',
|
||||
'flock': '',
|
||||
'strtok_r': '',
|
||||
'getrandom': '',
|
||||
'qsort_r': '',
|
||||
'qsort_s': '',
|
||||
}
|
||||
|
||||
foreach f, prefix: functions_to_detect
|
||||
if cc.has_function(f, prefix: prefix)
|
||||
pre_args += '-DHAVE_@0@'.format(f.to_upper())
|
||||
endif
|
||||
endforeach
|
||||
|
Loading…
Reference in New Issue
Block a user