meson: don't depend on pthreads when compiling for windows
authorSteve Lhomme <robux4@ycbcr.xyz>
Fri, 19 Aug 2022 09:04:08 +0000 (11:04 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 31 Oct 2022 10:20:13 +0000 (10:20 +0000)
On UNIX toolchains cross compiling for Windows, winpthread will be detected and
added as a dependency even though it's not used.

orc/meson.build

index bb2c464..626da63 100644 (file)
@@ -101,7 +101,11 @@ endif
 
 orc_c_args = ['-DORC_ENABLE_UNSTABLE_API', '-D_GNU_SOURCE']
 
-orc_dependencies = [libm, librt, liblog, threads]
+orc_dependencies = [libm, librt, liblog]
+if host_os != 'windows'
+  # winpthread may be detected but we don't use it
+  orc_dependencies += threads
+endif
 
 orc_lib = library ('orc-' + orc_api,
   orc_sources,