forked from openslide/openslide-bin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openslide#230 from bgilbert/zstd
Allow enabling extra deps when overriding OpenSlide; add zstd to dev builds
- Loading branch information
Showing
8 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From d4ec0e6b84cc5e81753921c15285603dc0aca82c Mon Sep 17 00:00:00 2001 | ||
From: Benjamin Gilbert <bgilbert@backtick.net> | ||
Date: Thu, 7 Mar 2024 21:40:27 +0900 | ||
Subject: [PATCH] meson: don't link with -pthread on Windows | ||
|
||
Meson always returns -pthread in dependency('threads') on non-MSVC | ||
compilers. Fix a link error when building on MinGW without winpthreads. | ||
--- | ||
meson.build | 9 +++++++-- | ||
meson_options.txt | 2 +- | ||
2 files changed, 8 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/meson.build b/meson.build | ||
index 15c56c2b13aa..7ddca2e79236 100644 | ||
--- a/meson.build | ||
+++ b/meson.build | ||
@@ -88,8 +88,13 @@ feature_lz4 = get_option('lz4') | ||
# ============================================================================= | ||
|
||
libm_dep = cc.find_library('m', required: false) | ||
-thread_dep = dependency('threads', required: feature_multi_thread) | ||
-use_multi_thread = thread_dep.found() | ||
+if host_machine_os == os_windows | ||
+ thread_dep = dependency('', required: false) | ||
+ use_multi_thread = not feature_multi_thread.disabled() | ||
+else | ||
+ thread_dep = dependency('threads', required: feature_multi_thread) | ||
+ use_multi_thread = thread_dep.found() | ||
+endif | ||
# Arguments in dependency should be equivalent to those passed to pkg-config | ||
zlib_dep = dependency('zlib', required: feature_zlib) | ||
use_zlib = zlib_dep.found() | ||
diff --git a/meson_options.txt b/meson_options.txt | ||
index f35cd5fc8b11..4705178279f8 100644 | ||
--- a/meson_options.txt | ||
+++ b/meson_options.txt | ||
@@ -27,7 +27,7 @@ option('bin_contrib', type: 'boolean', value: false, | ||
description: 'Enable contrib build') | ||
|
||
option('multi_thread', type: 'feature', value: 'enabled', | ||
- description: 'Enable multi-threading when pthread is detected') | ||
+ description: 'Enable multi-threading when pthread or Windows is detected') | ||
option('zlib', type: 'feature', value: 'auto', | ||
description: 'Enable zlib support') | ||
option('lzma', type: 'feature', value: 'auto', | ||
-- | ||
2.44.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[wrap-file] | ||
directory = zstd-1.5.5 | ||
source_url = https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz | ||
source_filename = zstd-1.5.5.tar.gz | ||
source_hash = 9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4 | ||
patch_filename = zstd_1.5.5-1_patch.zip | ||
patch_url = https://wrapdb.mesonbuild.com/v2/zstd_1.5.5-1/get_patch | ||
patch_hash = 0a076f6e60c4288193c2d9604670f2d8b5cb05511c2ac43eb521cb7363665278 | ||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/zstd_1.5.5-1/zstd-1.5.5.tar.gz | ||
wrapdb_version = 1.5.5-1 | ||
|
||
# https://github.com/facebook/zstd/pull/3931 | ||
diff_files = zstd-pthread.patch | ||
|
||
[provide] | ||
libzstd = libzstd_dep |