diff options
author | Dylan Baker <dylan.c.baker@intel.com> | 2021-01-20 09:16:27 -0800 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-02-01 19:40:20 +0000 |
commit | abdaf5fab82c7d74c036cf576b012b71fcab705e (patch) | |
tree | e58d4491bf68cd94a63f9002aab5605bb0f6f889 /scons | |
parent | f2545f22f46df332da85356f7103470c4734f4e6 (diff) | |
download | mesa-abdaf5fab82c7d74c036cf576b012b71fcab705e.tar.gz mesa-abdaf5fab82c7d74c036cf576b012b71fcab705e.tar.bz2 mesa-abdaf5fab82c7d74c036cf576b012b71fcab705e.zip |
Scons: check for timespec_get on windows as well as unices
windows has a timespec_get function, and if we don't check that then it
will try to fall back to using clock_gettime, which windows doesn't
have.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8592>
Diffstat (limited to 'scons')
-rwxr-xr-x | scons/gallium.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scons/gallium.py b/scons/gallium.py index 03d11e440a1..63accb143a5 100755 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -340,6 +340,10 @@ def generate(env): cppdefines += ['NDEBUG'] if env['build'] == 'profile': cppdefines += ['PROFILE'] + + if check_functions(env, ['timespec_get']): + cppdefines += ['HAVE_TIMESPEC_GET'] + if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): cppdefines += [ '_POSIX_SOURCE', @@ -374,9 +378,6 @@ def generate(env): if check_functions(env, ['random_r']): cppdefines += ['HAVE_RANDOM_R'] - if check_functions(env, ['timespec_get']): - cppdefines += ['HAVE_TIMESPEC_GET'] - if check_header(env, 'sys/shm.h'): cppdefines += ['HAVE_SYS_SHM_H'] |