Skip to content

Commit

Permalink
Add openslide_werror Meson option
Browse files Browse the repository at this point in the history
Don't require build.sh or external direct Meson builds to know how to
pass werror options directly to the OpenSlide and OpenSlide Java
subprojects.

Signed-off-by: Benjamin Gilbert <[email protected]>
  • Loading branch information
bgilbert committed Nov 1, 2023
1 parent 6a96886 commit 141f696
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/direct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
working-directory: meson
run: |
meson setup build --native-file native-linux-x86_64.ini \
-Dopenslide:werror=true -Dopenslide-java:werror=true
-Dopenslide_werror=true
meson compile -C build
DESTDIR=install meson install -C build
mkdir output
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
run: |
for arch in x86_64 arm64; do
meson setup $arch --cross-file cross-macos-${arch}.ini \
-Dopenslide:werror=true -Dopenslide-java:werror=true
-Dopenslide_werror=true
meson compile -C $arch
DESTDIR=install meson install -C $arch
done
Expand Down
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ build() {
--cross-file "${cross_file}" \
"$build" meson \
${ver_suffix:+-Dversion_suffix=${ver_suffix}} \
${openslide_werror:+-Dopenslide:werror=true} \
${openslide_werror:+-Dopenslide-java:werror=true}
${openslide_werror}
fi
meson compile -C "$build" $parallel
# When building multiple interdependent subpackages, we need to make sure
Expand Down Expand Up @@ -474,7 +473,7 @@ do
ver_suffix="${OPTARG}"
;;
w)
openslide_werror=1
openslide_werror="-Dopenslide_werror=true"
;;
esac
done
Expand Down
8 changes: 7 additions & 1 deletion meson/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ subproject(
'default_library=shared',
'doc=disabled',
'version_suffix=' + get_option('version_suffix'),
'werror=' + get_option('openslide_werror').to_string(),
],
)
subproject(
'openslide-java',
default_options : [
'werror=' + get_option('openslide_werror').to_string(),
],
)
subproject('openslide-java')
6 changes: 6 additions & 0 deletions meson/meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
option(
'openslide_werror',
type : 'boolean',
value : false,
description : 'Fail on compile warnings from OpenSlide/OpenSlide Java',
)
option(
'version_suffix',
type : 'string',
Expand Down

0 comments on commit 141f696

Please sign in to comment.