Skip to content

Commit 98c4b02

Browse files
committed
meson: Test for minimum macOS/iOS version when targeting Darwin
This is necessary to prevent linking/dyld issues with `getentropy` and `CCRandomGenerateBytes` being missing on macOS < 10.10 or iOS < 8.0. This requirement was set in Rust 1.75. See rust-lang/rust#116319 Fixes #1097 Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/993>
1 parent b8ee7fc commit 98c4b02

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

meson.build

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ cargo_c = find_program('cargo-cbuild', version:'>= 0.9.19')
3030
rustc = find_program('rustc', version:'>= @0@'.format(msrv))
3131
makedef = find_program('meson/makedef.py', native: true)
3232

33+
if host_system in ['darwin', 'ios']
34+
# Validate unconditional presence of getentropy and CCRandomGenerateBytes.
35+
# https://github.com/rust-lang/rust/pull/116319
36+
cc.compiles('''#include <Availability.h>
37+
#include <TargetConditionals.h>
38+
#if !((TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200L) || (TARGET_OS_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000L))
39+
# error "https://gitlab.gnome.org/GNOME/librsvg/-/issues/1097"
40+
#endif''',
41+
name: 'Targets at least macOS 10.12 or iOS 10',
42+
required: rustc.version().version_compare('>= 1.75.0')
43+
)
44+
endif
45+
3346
py = import('python')
3447

3548
python = py.find_installation()

0 commit comments

Comments
 (0)