jpsim / Yams

A Sweet and Swifty YAML parser.
https://jpsim.com/Yams
MIT License
1.11k stars 144 forks source link

Musl support #429

Open arasan01 opened 1 month ago

arasan01 commented 1 month ago

The combination of Yams and the Static Linux SDK allows the creation of a CLI in a single binary. To do this, the implementation needs to be changed from a direct dependency on Glibc to a dependency on both Glibc and Musl.

Here, import needs to be changed to support Musl.

#elseif canImport(Glibc)
import CoreFoundation
import Glibc
private let cpow: (_: Double, _: Double) -> Double = Glibc.pow
#elseif canImport(Musl)
import CoreFoundation
import Musl
private let cpow: (_: Double, _: Double) -> Double = Musl.pow
#endif
arasan01 commented 1 month ago

I will create PR

kkebo commented 2 weeks ago

Musl support is really important for command line tools written in Swift and using Yams.