diff --git a/Cargo.toml b/Cargo.toml index a97fa34..efa323a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,3 +25,7 @@ strum_macros = "0.24.2" [lib] name = "gdcm_rs" path = "src/lib.rs" + +[features] +default = ["charls"] +charls = [] diff --git a/README.md b/README.md index a4ae6d9..9e4517c 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,5 @@ Rust bindings for [Grassroots DICOM (GDCM)](https://github.com/malaterre/GDCM). The goal of this project is to provide an easy to use interface with GDCM. This can be used to decode a wide variety of compressed DICOM objects. +### Feature Flags +* `charls` use built-in libcharls diff --git a/build.rs b/build.rs index 4e0668b..aa7823f 100644 --- a/build.rs +++ b/build.rs @@ -39,7 +39,6 @@ fn build() { // gdcm libs println!("cargo:rustc-link-lib=static=gdcmMSFF"); - println!("cargo:rustc-link-lib=static=gdcmcharls"); println!("cargo:rustc-link-lib=static=gdcmCommon"); println!("cargo:rustc-link-lib=static=gdcmDICT"); println!("cargo:rustc-link-lib=static=gdcmDSED"); @@ -53,6 +52,9 @@ fn build() { println!("cargo:rustc-link-lib=static=gdcmMEXD"); println!("cargo:rustc-link-lib=static=gdcmzlib"); + #[cfg(feature="charls")] + println!("cargo:rustc-link-lib=static=gdcmcharls"); + // FIXME: OSX ONLY println!("Building for {}", env::consts::OS); match env::consts::OS {