From 6e049fdb23f9f3920060629b5264bc98d51bf5ea Mon Sep 17 00:00:00 2001 From: lifegpc Date: Thu, 17 Mar 2022 11:28:28 +0800 Subject: [PATCH] Remove unwanted build dependents for default build --- Cargo.toml | 6 +++--- build.rs | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dda0b17..9bf26e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,11 +26,11 @@ urlparse = "0.7" utf16string = { version= "0.2", optional = true } [build-dependencies] -cmake = "0.1" -bindgen = "0.59" +bindgen = { version = "0.59", optional = true } +cmake = { version = "0.1", optional = true } [features] -exif = ["c_fixed_string", "link-cplusplus", "int-enum", "utf16string"] +exif = ["bindgen", "c_fixed_string", "cmake", "link-cplusplus", "int-enum", "utf16string"] [target.'cfg(windows)'.dependencies] winapi = { version = "0.3.9", features = ["winnls", "stringapiset"] } diff --git a/build.rs b/build.rs index e903301..37586e0 100644 --- a/build.rs +++ b/build.rs @@ -1,10 +1,17 @@ +#[cfg(feature = "bindgen")] extern crate bindgen; +#[cfg(feature = "cmake")] extern crate cmake; +#[cfg(any(feature = "exif"))] use std::env; +#[cfg(any(feature = "exif"))] use std::fs::create_dir; +#[cfg(any(feature = "exif"))] use std::fs::File; +#[cfg(any(feature = "exif"))] use std::io::Read; +#[cfg(any(feature = "exif"))] use std::path::PathBuf; fn main() {