Re: [Mesa-dev] [PATCH] meson: Don't define HAVE_PTHREAD only on linux
Quoting Jon Turney (2017-11-15 02:52:29) > I'm not sure of the reason for this. I don't see anything like this in > configure.ac I hadn't had a chance to test other platforms, and I wasn't sure about Windows and Haiku. Some of the BSD's also stiil use pthread-stubs, and I don't think those get HAVE_PTHREADS. I also don't konw what depdnency('threads') returns on windows, but in mean time this probably fixes some platforms and doesn't break any that previous worked. Reviewed-by: Dylan Baker> > In include/c11/threads.h the cases are: > > 1) building for Windows -> threads_win32.h > 2) HAVE_PTHREAD -> threads_posix.h > 3) Not supported on this platform > > So not defining HAVE_PTHREAD for anything not Windows just means we can't > build at all. > > When we are building for Windows, I'm not sure if dependency('threads') > would ever find anything, or defining HAVE_PTHREAD has any effect, but avoid > defining it there, just in case. > > Signed-off-by: Jon Turney > --- > meson.build | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meson.build b/meson.build > index 84c0e102737..a0dd02b1f64 100644 > --- a/meson.build > +++ b/meson.build > @@ -668,7 +668,7 @@ endif > # TODO: some of these may be conditional > dep_zlib = dependency('zlib', version : '>= 1.2.3') > dep_thread = dependency('threads') > -if dep_thread.found() and host_machine.system() == 'linux' > +if dep_thread.found() and host_machine.system() != 'windows' >pre_args += '-DHAVE_PTHREAD' > endif > dep_elf = dependency('libelf', required : false) > -- > 2.15.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev signature.asc Description: signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] meson: Don't define HAVE_PTHREAD only on linux
On Wednesday, 2017-11-15 10:52:29 +, Jon Turney wrote: > I'm not sure of the reason for this. I don't see anything like this in > configure.ac > > In include/c11/threads.h the cases are: > > 1) building for Windows -> threads_win32.h > 2) HAVE_PTHREAD -> threads_posix.h > 3) Not supported on this platform > > So not defining HAVE_PTHREAD for anything not Windows just means we can't > build at all. > > When we are building for Windows, I'm not sure if dependency('threads') > would ever find anything, or defining HAVE_PTHREAD has any effect, but avoid > defining it there, just in case. Might be worth checking that to see if we can drop the os check, but in the mean time this should be fine: Reviewed-by: Eric Engestrom> > Signed-off-by: Jon Turney > --- > meson.build | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meson.build b/meson.build > index 84c0e102737..a0dd02b1f64 100644 > --- a/meson.build > +++ b/meson.build > @@ -668,7 +668,7 @@ endif > # TODO: some of these may be conditional > dep_zlib = dependency('zlib', version : '>= 1.2.3') > dep_thread = dependency('threads') > -if dep_thread.found() and host_machine.system() == 'linux' > +if dep_thread.found() and host_machine.system() != 'windows' >pre_args += '-DHAVE_PTHREAD' > endif > dep_elf = dependency('libelf', required : false) > -- > 2.15.0 > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] meson: Don't define HAVE_PTHREAD only on linux
I'm not sure of the reason for this. I don't see anything like this in configure.ac In include/c11/threads.h the cases are: 1) building for Windows -> threads_win32.h 2) HAVE_PTHREAD -> threads_posix.h 3) Not supported on this platform So not defining HAVE_PTHREAD for anything not Windows just means we can't build at all. When we are building for Windows, I'm not sure if dependency('threads') would ever find anything, or defining HAVE_PTHREAD has any effect, but avoid defining it there, just in case. Signed-off-by: Jon Turney--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 84c0e102737..a0dd02b1f64 100644 --- a/meson.build +++ b/meson.build @@ -668,7 +668,7 @@ endif # TODO: some of these may be conditional dep_zlib = dependency('zlib', version : '>= 1.2.3') dep_thread = dependency('threads') -if dep_thread.found() and host_machine.system() == 'linux' +if dep_thread.found() and host_machine.system() != 'windows' pre_args += '-DHAVE_PTHREAD' endif dep_elf = dependency('libelf', required : false) -- 2.15.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev