diff --git a/build.rs b/build.rs index 4a737c219..dd2c4c32a 100644 --- a/build.rs +++ b/build.rs @@ -2,10 +2,14 @@ // Copyright 2021-2023 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 +use std::env::var; + fn main() { // link carbon hotkey on macOS { - if std::env::var("CARGO_CFG_TARGET_OS").map_or(false, |os| os == "macos") { + if var("DOCS_RS").map_or(true, |f| f != "1") + && var("CARGO_CFG_TARGET_OS").map_or(false, |os| os == "macos") + { println!("cargo:rustc-link-lib=framework=Carbon"); cc::Build::new() .file("src/platform_impl/macos/carbon_hotkey/carbon_hotkey_binding.c")