Closed wenyuzhao closed 9 months ago
The changes look good to me. I wonder about the testing story though. Can we add a no_std build to the CI so that this does not regress so easily?
@adamreichold I added a no_std build test in CI. The CI job will check no_std macro builds on both x86_64-unknown-none
and x86_64-unknown-linux-gnu
targets. However, I added the source code for the build test as a cargo example under the examples/ dir. Not sure if there is any better way to do this...
This PR fixes #106 and supports no_std builds to use macros.
Changes involved:
::std
to::core
in macros crate::std::vec
to::hecs::alloc::vec
OnceLock
withspin::Lazy
~There is probably no need to deal with lazy_static as it already has the
spin_no_std
feature enabled. It should already support no_std builds.~~After merging the commit to use
OnceLock
instead oflazy_static
, I had to usespin::Once
for no-std builds.OnceLock
is only instd
, not incore
.~