From 3b8aecdd9128cb252f30976cf349b3bb6cbd8ab4 Mon Sep 17 00:00:00 2001 From: Be Wilson Date: Tue, 30 Jan 2024 01:38:06 -0600 Subject: [PATCH] cxx-qt-build: set minimum macOS version to override cc's default which is too low for CXX-Qt --- Cargo.toml | 2 +- crates/cxx-qt-build/src/lib.rs | 5 +++++ crates/cxx-qt-lib/build.rs | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fc8949907..a2c2f9636 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,4 +60,4 @@ serde_json = "1.0" # Use a patched version of cc-rs that respects the rustc wrapper # This should greatly speed up CI builds! [patch.crates-io] -cc = { git = "https://github.com/LeonMatthesKDAB/cc-rs.git", branch="respect-rustc-wrapper" } +cc = { git = "https://github.com/Be-ing/cc-rs.git", branch="apple_deployment_target_api" } diff --git a/crates/cxx-qt-build/src/lib.rs b/crates/cxx-qt-build/src/lib.rs index 4c8affcea..3239b225f 100644 --- a/crates/cxx-qt-build/src/lib.rs +++ b/crates/cxx-qt-build/src/lib.rs @@ -510,6 +510,11 @@ impl CxxQtBuilder { builder.flag_if_supported("-std=c++17"); // MinGW requires big-obj otherwise debug builds fail builder.flag_if_supported("-Wa,-mbig-obj"); + // macOS + // We need + // - std::filesystem::path from 10.15 + // - std::shared_mutex from 10.12 + builder.apple_deployment_target(&"10.5"); // Enable Qt Gui in C++ if the feature is enabled #[cfg(feature = "qt_gui")] builder.define("CXX_QT_GUI_FEATURE", None); diff --git a/crates/cxx-qt-lib/build.rs b/crates/cxx-qt-lib/build.rs index b71d383b2..f464178c1 100644 --- a/crates/cxx-qt-lib/build.rs +++ b/crates/cxx-qt-lib/build.rs @@ -289,6 +289,11 @@ fn main() { builder.flag_if_supported("/bigobj"); // GCC + Clang builder.flag_if_supported("-std=c++17"); + // macOS + // We need + // - std::filesystem::path from 10.15 + // - std::shared_mutex from 10.12 + builder.apple_deployment_target(&"10.15"); // MinGW requires big-obj otherwise debug builds fail builder.flag_if_supported("-Wa,-mbig-obj");