From 78855fb6b61f61ecc3f9d1c70496a99425c36222 Mon Sep 17 00:00:00 2001 From: Eric Sheppard Date: Thu, 11 Aug 2022 22:42:37 +1000 Subject: [PATCH] allow optional wasmbindgen --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 94adca3e72..e9e8a6ffe3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,13 +20,13 @@ appveyor = { repository = "chronotope/chrono" } name = "chrono" [features] -default = ["clock", "std", "oldtime"] +default = ["clock", "std", "oldtime", "wasmbind"] alloc = [] libc = [] std = [] clock = ["std", "winapi", "iana-time-zone"] oldtime = ["time"] -wasmbind = [] # TODO: empty feature to avoid breaking change in 0.4.20, can be removed later +wasmbind = ["wasm-bindgen", "js-sys"] unstable-locales = ["pure-rust-locales", "alloc"] __internal_bench = ["criterion"] __doctest = [] @@ -42,8 +42,8 @@ criterion = { version = "0.3", optional = true } rkyv = {version = "0.7", optional = true} [target.'cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi"))))'.dependencies] -wasm-bindgen = { version = "0.2" } -js-sys = { version = "0.3" } # contains FFI bindings for the JS Date API +wasm-bindgen = { version = "0.2", optional = true } +js-sys = { version = "0.3", optional = true } # contains FFI bindings for the JS Date API [target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "solaris")))'.dependencies] iana-time-zone = { version = "0.1.41", optional = true }