@@ -35,11 +35,22 @@ rustversion = "1.0"
3535indexmap = { version = " >=2.11.0, <2.12.0" , optional = true }
3636
3737# no_std support
38- # spin is always required for no_std builds (feature detection synchronization)
39- spin = { version = " 0.10.0" , default-features = false , features = [" once" , " rwlock" , " mutex" , " spin_mutex" ] }
38+ # spin is optional - only needed on architectures with SIMD (for feature detection)
39+ # or when cache feature is enabled
40+ spin = { version = " 0.10.0" , default-features = false , features = [" once" , " rwlock" , " mutex" , " spin_mutex" ], optional = true }
4041# hashbrown is only needed when caching is enabled in no_std
4142hashbrown = { version = " 0.16.0" , optional = true }
4243
44+ # Target-specific dependencies: spin is needed for feature detection on SIMD-capable architectures
45+ [target .'cfg(target_arch = "aarch64")' .dependencies ]
46+ spin = { version = " 0.10.0" , default-features = false , features = [" once" , " rwlock" , " mutex" , " spin_mutex" ] }
47+
48+ [target .'cfg(target_arch = "x86")' .dependencies ]
49+ spin = { version = " 0.10.0" , default-features = false , features = [" once" , " rwlock" , " mutex" , " spin_mutex" ] }
50+
51+ [target .'cfg(target_arch = "x86_64")' .dependencies ]
52+ spin = { version = " 0.10.0" , default-features = false , features = [" once" , " rwlock" , " mutex" , " spin_mutex" ] }
53+
4354[dev-dependencies ]
4455criterion = " 0.7"
4556cbindgen = " 0.29"
@@ -84,7 +95,7 @@ ffi = [] # C/C++ compatible dynamic/static library, planned to become optional i
8495
8596# optional features
8697cli = [" std" ] # command line interface binaries (checksum, arch-check, get-custom-params)
87- cache = [" alloc" , " hashbrown" ] # no_std caching requires alloc + hashbrown HashMap
98+ cache = [" alloc" , " hashbrown" , " spin " ] # no_std caching requires alloc + hashbrown HashMap + spin for synchronization
8899
89100# the features below are deprecated, aren't in use, and will be removed in the next MAJOR version (v2)
90101vpclmulqdq = [] # deprecated, VPCLMULQDQ stabilized in Rust 1.89.0
0 commit comments