-
Notifications
You must be signed in to change notification settings - Fork 28
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 #178 from bgilbert/java
Update OpenSlide Java and fix it on Linux/macOS
- Loading branch information
Showing
6 changed files
with
87 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# not from wrapdb | ||
|
||
[wrap-file] | ||
directory = openslide-java-0.12.3 | ||
source_url = https://github.com/openslide/openslide-java/releases/download/v0.12.3/openslide-java-0.12.3.tar.xz | ||
source_filename = openslide-java-0.12.3.tar.xz | ||
source_hash = 0fb4ef9aac3cc5f60e685ddd8886ba75d195f8f7bc61c8bd26e0eaa919f0c90e | ||
directory = openslide-java-0.12.4 | ||
source_url = https://github.com/openslide/openslide-java/releases/download/v0.12.4/openslide-java-0.12.4.tar.xz | ||
source_filename = openslide-java-0.12.4.tar.xz | ||
source_hash = 63a6cd63fedc7c700020708c0a362b3807b6780f0246b12c8dc372cecd6130cf |
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,72 @@ | ||
From 8ffb2c233432024c7adb24a1f7a0b25b28112014 Mon Sep 17 00:00:00 2001 | ||
From: Benjamin Gilbert <[email protected]> | ||
Date: Tue, 7 Nov 2023 10:55:08 -0600 | ||
Subject: [PATCH] meson: add a private option to filter out non-OpenSlide | ||
symbols | ||
|
||
On macOS, openslide-bin needs to use a linker option to filter out | ||
non-OpenSlide exported symbols. It can't set the option globally because | ||
that would break OpenSlide Java, and can't set a per-project option | ||
because Meson doesn't support that. Add a private option to do the | ||
filtering until Meson provides syntax for this. | ||
|
||
Signed-off-by: Benjamin Gilbert <[email protected]> | ||
--- | ||
meson.build | 10 ++++++++++ | ||
meson_options.txt | 6 ++++++ | ||
src/meson.build | 1 + | ||
3 files changed, 17 insertions(+) | ||
|
||
diff --git a/meson.build b/meson.build | ||
index 0b4d7d47b695..852b976419a9 100644 | ||
--- a/meson.build | ||
+++ b/meson.build | ||
@@ -161,6 +161,16 @@ endif | ||
|
||
# Test suite options | ||
visibility = get_option('_export_internal_symbols') ? '' : 'hidden' | ||
+libopenslide_link_args = ( | ||
+ # On macOS, openslide-bin needs to keep non-OpenSlide symbols out of the | ||
+ # combined dylib, but it can't do it via global link options without | ||
+ # breaking the exports of the OpenSlide Java JNI library. Until Meson | ||
+ # allows passing compiler flags to individual subprojects, provide a | ||
+ # workaround here. | ||
+ # https://github.com/mesonbuild/meson/issues/11002 | ||
+ get_option('_filter_external_symbols') and host_machine.system() == 'darwin' | ||
+ ? ['-Wl,-exported_symbol,_openslide_*'] : [] | ||
+) | ||
if get_option('_gcov') | ||
add_project_arguments( | ||
'-O0', | ||
diff --git a/meson_options.txt b/meson_options.txt | ||
index 1a71bf92c235..a11494c85f7a 100644 | ||
--- a/meson_options.txt | ||
+++ b/meson_options.txt | ||
@@ -29,6 +29,12 @@ option( | ||
value : false, | ||
description : 'For test suite; do not use', | ||
) | ||
+option( | ||
+ '_filter_external_symbols', | ||
+ type : 'boolean', | ||
+ value : false, | ||
+ description : 'For openslide-bin; do not use', | ||
+) | ||
option( | ||
'_gcov', | ||
type : 'boolean', | ||
diff --git a/src/meson.build b/src/meson.build | ||
index f9d184be1bc7..e8997cae00ed 100644 | ||
--- a/src/meson.build | ||
+++ b/src/meson.build | ||
@@ -78,6 +78,7 @@ libopenslide = library('openslide', | ||
openslide_sources, | ||
version : soversion, | ||
c_args : ['-D_OPENSLIDE_BUILDING_DLL', '-DG_LOG_DOMAIN="OpenSlide"'], | ||
+ link_args : libopenslide_link_args, | ||
gnu_symbol_visibility : visibility, | ||
include_directories : config_h_include, | ||
dependencies : [ | ||
-- | ||
2.41.0 | ||
|