Closed Supereg closed 3 years ago
canImport(ObjectiveC)
maybe?
With canImport(ObjectiveC)
tests pass as well (see https://github.com/Supereg/Runtime/actions/runs/987505669).
The docs read like that package is only available if the objective-c runtime is available. So that is probably then the way to go.
There are about 5 or 6 ObjC runtimes supported by clang, but I think only the Apple one is supported by Swift (and coming w/ a modmap). So I'm not entirely sure which one is better :-)
If I may ping you @wickwirew, would love to get a review on this to get the fix upstream (as well as my other PRs).
As described in https://github.com/wickwirew/Runtime/issues/92, swift 5.4 change the
ClassMetadataLayout
for platforms that do not support Objective-C interoperability. This resulted in Runtime crashing when running on those platforms with the newest swift releases.This PR fixes this issue by adjusting the
ClassMetadataLayout
on those platforms. I'm using the#if !swift(>=5.4) || canImport(Darwin)
. Not entirely sure ifcanImport(Darwin)
is the proper check for availability of Objective-C interoperability (works though). Happy for any feedback.I have another PR ready which adds some CI integration with GitHub to test the framework on all the available linux distortions. This PR passes all tests on all platforms: Actions Run. I chose to do the CI PR separately so this fix can get merged faster.