From b35d598003f19577b72bb43f7fed55fa68e416c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 13 Apr 2023 14:46:43 +0300 Subject: [PATCH] ptp-helper: Check for the required Rust toolchain version via meson If an older version is found that gives a more useful output than a compiler error at a later time. Part-of: --- .../libs/gst/helpers/ptp/meson.build | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/subprojects/gstreamer/libs/gst/helpers/ptp/meson.build b/subprojects/gstreamer/libs/gst/helpers/ptp/meson.build index 401b3e1fe3..76cac29391 100644 --- a/subprojects/gstreamer/libs/gst/helpers/ptp/meson.build +++ b/subprojects/gstreamer/libs/gst/helpers/ptp/meson.build @@ -13,6 +13,26 @@ endif if have_ptp rustc = meson.get_compiler('rust') + + if rustc.get_id() not in ['rustc', 'clippy-driver rustc'] + message('PTP support is only tested with rustc, found different compiler @0@ @1@'.format(rustc.get_id(), rustc.version())) + endif + + # We currently need at least Rust 1.48 on all platforms but Windows. + # On Windows some 1.54 API is used that would otherwise complicate things + # unncecessarily. + rust_req = '1.48' + if host_system == 'windows' + rust_req = '1.54' + endif + + if rustc.get_id() in ['rustc', 'clippy-driver rustc'] and not rustc.version().version_compare('>=' + rust_req) + have_ptp = false + message('PTP support requires at least Rust @0@ on this platform, found @1@'.format(rust_req, rustc.version())) + endif +endif + +if have_ptp cdata.set('HAVE_PTP', 1, description : 'PTP support available') ptp_helper_conf_data = configuration_data()