diff --git a/basis-universal-sys/Cargo.toml b/basis-universal-sys/Cargo.toml index 3058b4e..e2e4563 100644 --- a/basis-universal-sys/Cargo.toml +++ b/basis-universal-sys/Cargo.toml @@ -16,3 +16,6 @@ exclude = ["vendor/basis_universal/test_files", "vendor/basis_universal/webgl", [build-dependencies] cc = "1.0" + +[features] +link-static = [] diff --git a/basis-universal-sys/build.rs b/basis-universal-sys/build.rs index 73a0a7c..a0a68e5 100644 --- a/basis-universal-sys/build.rs +++ b/basis-universal-sys/build.rs @@ -18,7 +18,10 @@ fn main() { build_with_common_settings() .cpp(true) .define("BASISD_SUPPORT_KTX2_ZSTD", "0") - //.define("BASISU_SUPPORT_SSE", "1") TODO: expose this in a futher release + //.define("BASISU_SUPPORT_SSE", "0") TODO: expose this in a futher release + .cpp_link_stdlib_static(cfg!(feature = "link-static")) + .static_crt(cfg!(feature = "link-static")) + .static_flag(cfg!(feature = "link-static")) .flag_if_supported("--std=c++11") .file("vendor/basis_universal/encoder/pvpngreader.cpp") .file("vendor/basis_universal/encoder/jpgd.cpp") diff --git a/basis-universal/Cargo.toml b/basis-universal/Cargo.toml index 1ccc5cf..6a1b94c 100644 --- a/basis-universal/Cargo.toml +++ b/basis-universal/Cargo.toml @@ -19,3 +19,6 @@ bitflags = "1.2.1" [dev-dependencies] image = "0.23.13" lz4 = "1.23" + +[features] +link-static = ["basis-universal-sys/link-static"]