Skip to content

Commit

Permalink
cxx-qt-build: set minimum macOS version
Browse files Browse the repository at this point in the history
to override cc's default which is too low for CXX-Qt
  • Loading branch information
Be-ing committed Jan 30, 2024
1 parent 92baeff commit 3b8aecd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
5 changes: 5 additions & 0 deletions crates/cxx-qt-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions crates/cxx-qt-lib/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 3b8aecd

Please sign in to comment.