From 8a60437fd0874d44e0c85e0c2f21d2fc416edae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20Dupr=C3=A9=20Bertoni?= Date: Sat, 22 Mar 2025 16:51:56 +0200 Subject: [PATCH] Add QT bundled libraries behind features --- qttypes/Cargo.toml | 7 +++++++ qttypes/build.rs | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/qttypes/Cargo.toml b/qttypes/Cargo.toml index 1717e26..fb2335d 100644 --- a/qttypes/Cargo.toml +++ b/qttypes/Cargo.toml @@ -33,6 +33,13 @@ qtsql = [] # Link against QtTest qttest = [] +qtbundledfreetype = [] +qtbundledharfbuzz = [] +qtbundledlibjpeg = [] +qtbundledlibpng = [] +qtbundledpcre2 = [] +qtbundledzlib = [] + default = ["required"] [dependencies] diff --git a/qttypes/build.rs b/qttypes/build.rs index c6cda86..663a383 100644 --- a/qttypes/build.rs +++ b/qttypes/build.rs @@ -272,5 +272,19 @@ fn main() { link_lib("Sql"); #[cfg(feature = "qttest")] link_lib("Test"); + + #[cfg(feature = "qtbundledfreetype")] + link_lib("BundledFreetype"); + #[cfg(feature = "qtbundledharfbuzz")] + link_lib("BundledHarfbuzz"); + #[cfg(feature = "qtbundledlibjpeg")] + link_lib("BundledLibjpeg"); + #[cfg(feature = "qtbundledlibpng")] + link_lib("BundledLibpng"); + #[cfg(feature = "qtbundledpcre2")] + link_lib("BundledPcre2"); + #[cfg(feature = "qtbundledzlib")] + link_lib("BundledZLIB"); + println!("cargo:rerun-if-changed=src"); }