In a bit of a Multiplatform design quandary. I am ...
# multiplatform
In a bit of a Multiplatform design quandary. I am maintaining a Kotlin Native library that currently supports two Linux targets (linuxX64 & linuxArm32Hfp). The maintained library uses a C library as a base (dependency), however there are some parts of the dependency which are only applicable to some Unix based targets (eg Linux). Initially I was looking at having the Unix bits shared in the common module, however that would mean it would need to be available for all platform modules which won't work if a new platform module is added that isn't Unix based. Kotlin 1.5.20 will have the new platform code sharing feature however that would only cover a single platform. Is there a way cover the code sharing for Unix based targets scenario?
HMPP seems like exactly what you're looking for: Just make a
target above the two linux ones
In 1.5.20 commonizer is improved, but still have issues for platforms with different bitness, see still unresolved
Looks like the feature is being pushed out to Kotlin 1.5.30.