I am trying to use swift-png package on Windows PC with Intel CPU. This package uses _Builtin_intrinsics.intel module, which seems to be unavailable on Windows on PC with CPU Intel(R) Core(TM) i3-10110U CPU @ 2.10GHz 2.59 GHz.
Here's error I get:
c:\Users\*****\swift-png\sources\png\dictionary.swift:3:8: error: no such module '_Builtin_intrinsics.intel'
import _Builtin_intrinsics.intel
^
Version of swift:
swift --version -v
compnerd.org Swift version 5.7.1 (swift-5.7.1-RELEASE)
Target: x86_64-unknown-windows-msvc
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-frontend.exe --version
compnerd.org Swift version 5.7.1 (swift-5.7.1-RELEASE)
Target: x86_64-unknown-windows-msvc
Does unknown appear here because toolchain cannot detect CPU manufacture?
Is above error of missing _Builtin_intrinsics.intel module the consequence of this unknown?
actually on second thought it might be better to exclude windows in the #if os(Windows) in that file because swiftSettings will trip SPM's "unsafe build flags" rule
hi @valeriyvan thanks for your interest in swift-png!
to be honest, the library was in pretty bad shape, and in my opinion, your (giant) PR did not go far enough, so i used it as a starting point for my own (even more expansive) update:
no more symlinked submodules! (what a terrible idea those were…)
i have some more windows fixes in the pipeline here:
Have you tried the workaround here? I checked out v4.0.1 locally and the PNG library can compile with only warnings from “unsupported platform”.
I don’t think this is the correct way to work around though — judging by #if canImport(_Builtin_intrinsics) should be more reliable. The library is fully functional on Windows, just like on other platforms.