HMPP: Parameterize NativePlatform with KonanTarget
This commit is contained in:
@@ -51,7 +51,7 @@ fun IdePlatform<*, *>.toNewPlatform(): NewPlatform = when (this) {
|
||||
is CommonIdePlatformKind.Platform -> CommonPlatforms.defaultCommonPlatform
|
||||
is JvmIdePlatformKind.Platform -> JvmPlatforms.jvmPlatformByTargetVersion(this.version)
|
||||
is JsIdePlatformKind.Platform -> JsPlatforms.defaultJsPlatform
|
||||
is NativeIdePlatformKind.Platform -> NativePlatforms.defaultNativePlatform
|
||||
is NativeIdePlatformKind.Platform -> NativePlatforms.unspecifiedNativePlatform
|
||||
else -> error("Unknown platform $this")
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -14,13 +14,14 @@ import org.jetbrains.kotlin.platform.IdePlatformKind
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.platform.TargetPlatformVersion
|
||||
import org.jetbrains.kotlin.platform.konan.NativePlatforms
|
||||
import org.jetbrains.kotlin.platform.konan.isNative
|
||||
|
||||
object NativeIdePlatformKind : IdePlatformKind<NativeIdePlatformKind>() {
|
||||
override fun supportsTargetPlatform(platform: TargetPlatform): Boolean = platform == NativePlatforms.defaultNativePlatform
|
||||
override fun supportsTargetPlatform(platform: TargetPlatform): Boolean = platform.isNative()
|
||||
|
||||
override fun platformByCompilerArguments(arguments: CommonCompilerArguments): TargetPlatform? {
|
||||
return if (arguments is FakeK2NativeCompilerArguments)
|
||||
NativePlatforms.defaultNativePlatform
|
||||
NativePlatforms.unspecifiedNativePlatform
|
||||
else
|
||||
null
|
||||
}
|
||||
@@ -30,7 +31,7 @@ object NativeIdePlatformKind : IdePlatformKind<NativeIdePlatformKind>() {
|
||||
}
|
||||
|
||||
override val defaultPlatform: TargetPlatform
|
||||
get() = NativePlatforms.defaultNativePlatform
|
||||
get() = NativePlatforms.unspecifiedNativePlatform
|
||||
|
||||
@Deprecated(
|
||||
message = "IdePlatform is deprecated and will be removed soon, please, migrate to org.jetbrains.kotlin.platform.TargetPlatform",
|
||||
|
||||
Reference in New Issue
Block a user