Bersaelor / KDTree

Swift implementation of a k-dimensional binary space partitioning tree.
MIT License
153 stars 26 forks source link

Disable Codable/Encodable behaviour when using WebAssembly #57

Closed pedrovgs closed 2 years ago

pedrovgs commented 2 years ago

:tophat: What is the goal?

Provide support for WebAssembly builds 😃

How is it being implemented?

Thanks to the usage of the Swift Package manager this repository can be built as a WebAssembly binary. However, the codable behavior for the KDTree component is not supported by the Swift WebAssembly toolchain. As this behavior is not mandatory I've decided to add a C macro to disable this feature when we build the code for WASM. The list of available Foundation features WASM supports can be found here.

I've also updated .gitignore file, but this is just a minor change 😃

P.S: Thank you so much for this awesome library. I really appreciate the time and effort needed to make this an open-source project.

Bersaelor commented 2 years ago

Thank you for the PR, I haven't worked with SwiftWasm yet, but I'll definitely check it out.