You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using this lib in a personal project but it appears that the colorkt-native artifact (from Maven Central) only supports linuxX64.
Here is the error thrown by Gradle :
> Could not resolve dev.kdrag0n:colorkt:1.0.5.
Required by:
project :
> No matching variant of dev.kdrag0n:colorkt:1.0.5 was found. The consumer was configured to find a usage of 'kotlin-cinterop' of a library, with the library elements 'cinterop-klib', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'mingw_x64' but:
...
- Variant 'nativeApiElements-published' capability dev.kdrag0n:colorkt:1.0.5 declares a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
- Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'linux_x64' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'mingw_x64'
...
So right now if anyone wants to use this lib in a Multiplatform project targeting multiple native platforms (like mingwX64 or macosX64) they need to clone this repo and build the lib themselves (cross-compilation is available for all native targets expect for Apple products targets afaik).
The text was updated successfully, but these errors were encountered:
I think the easiest way to set up all the targets is to simply do something like this:
kotlin {
linuxX64()
mingwX64()
macosX64()
...
But if you want to use the same code for all native targets, you should add something like this in the sourceSets block:
val nativeMain by creating { dependsOn(commonMain) }
val nativeTest by creating { dependsOn(commonTest) }
val linuxX64Main by getting { dependsOn(nativeMain) }
val linuxX64Test by getting { dependsOn(nativeTest) }
val mingwX64Main by getting { dependsOn(nativeMain) }
val mingwX64Test by getting { dependsOn(nativeTest) }
val macosX64Main by getting { dependsOn(nativeMain) }
val macosX64Test by getting { dependsOn(nativeTest) }
And it looks like that cross compilation is possible from a MacOS host to almost any other targets (see there), so you'll be able to build the library for (almost) every target you want from your Apple host.
I was using this lib in a personal project but it appears that the colorkt-native artifact (from Maven Central) only supports linuxX64.
Here is the error thrown by Gradle :
So right now if anyone wants to use this lib in a Multiplatform project targeting multiple native platforms (like mingwX64 or macosX64) they need to clone this repo and build the lib themselves (cross-compilation is available for all native targets expect for Apple products targets afaik).
The text was updated successfully, but these errors were encountered: