HMPP: Parameterize NativePlatform with KonanTarget
Original commit: 8d2e999776
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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ class ModulesTxtBuilder {
|
||||
"js" -> settings.compilerArguments =
|
||||
K2JSCompilerArguments().also { settings.targetPlatform = JsPlatforms.defaultJsPlatform }
|
||||
"native" -> settings.compilerArguments =
|
||||
FakeK2NativeCompilerArguments().also { settings.targetPlatform = NativePlatforms.defaultNativePlatform }
|
||||
FakeK2NativeCompilerArguments().also { settings.targetPlatform = NativePlatforms.unspecifiedNativePlatform }
|
||||
else -> {
|
||||
val flagProperty = ModulesTxt.Module.flags[flag]
|
||||
if (flagProperty != null) flagProperty.set(module, true)
|
||||
|
||||
Reference in New Issue
Block a user