[native] Drop deprecated Kotlin/Native targets (3/8)
This commit inlines some helper-APIs that became redundant after dropping deprecated targets. Full list: - 'threadsAreAllowed' is always 'true' now - 'indirectBranchesAreAllowed' is always 'true' now - 'supportsThreads' is always 'true' now - 'isMips' is always 'false' now - 'tlsMode' is always 'LLVMGeneralDynamicTLSModel' now - 'getBoxRange' is always equal to 'cache.defaultRange' now - `targetHasAddressDependency` is always true now, so memory order is always LLVMAtomicOrderingMonotonic now ^KT-64517
This commit is contained in:
committed by
Space Team
parent
85bcc8443d
commit
29e90d70c6
@@ -30,10 +30,6 @@ object PlatformInfo {
|
||||
@JvmStatic
|
||||
fun isWindowsTarget(project: Project) = getTarget(project).family == Family.MINGW
|
||||
|
||||
@JvmStatic
|
||||
fun isWasmTarget(project: Project) =
|
||||
getTarget(project).family == Family.WASM
|
||||
|
||||
@JvmStatic
|
||||
fun getTarget(project: Project): KonanTarget {
|
||||
val platformManager = project.project(":kotlin-native").platformManager
|
||||
@@ -41,11 +37,6 @@ object PlatformInfo {
|
||||
return platformManager.targetManager(targetName).target
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun supportsExceptions(project: Project): Boolean {
|
||||
return getTarget(project).supportsExceptions()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun needSmallBinary(project: Project): Boolean {
|
||||
return getTarget(project).needSmallBinary()
|
||||
@@ -89,4 +80,4 @@ object PlatformInfo {
|
||||
}
|
||||
|
||||
fun unsupportedPlatformException() = TargetSupportException()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,9 +324,6 @@ fun targetSupportsLibBacktrace(targetName: String) =
|
||||
fun targetSupportsCoreSymbolication(targetName: String) =
|
||||
HostManager().targetByName(targetName).supportsCoreSymbolication()
|
||||
|
||||
fun targetSupportsThreads(targetName: String) =
|
||||
HostManager().targetByName(targetName).supportsThreads()
|
||||
|
||||
fun Project.buildStaticLibrary(cSources: Collection<File>, output: File, objDir: File) {
|
||||
delete(objDir)
|
||||
delete(output)
|
||||
|
||||
+1
-4
@@ -12,7 +12,6 @@ import org.gradle.api.internal.project.ProjectInternal
|
||||
import org.jetbrains.kotlin.gradle.plugin.tasks.*
|
||||
import org.jetbrains.kotlin.konan.target.Family
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget
|
||||
import org.jetbrains.kotlin.konan.target.KonanTarget.WASM32
|
||||
import java.io.File
|
||||
|
||||
abstract class KonanCompileConfig<T: KonanCompileTask>(name: String,
|
||||
@@ -94,8 +93,6 @@ open class KonanDynamic(name: String,
|
||||
|
||||
override val defaultBaseDir: File
|
||||
get() = project.konanBinBaseDir
|
||||
|
||||
override fun targetIsSupported(target: KonanTarget): Boolean = target != WASM32
|
||||
}
|
||||
|
||||
open class KonanFramework(name: String,
|
||||
@@ -153,4 +150,4 @@ open class KonanBitcode(name: String,
|
||||
|
||||
override val defaultBaseDir: File
|
||||
get() = project.konanBitcodeBaseDir
|
||||
}
|
||||
}
|
||||
|
||||
+1
-5
@@ -110,11 +110,7 @@ internal val Project.konanArtifactsContainer: KonanArtifactContainer
|
||||
// by using HostManager instead of PlatformManager. But we need to download the compiler at the configuration
|
||||
// stage (e.g. by getting it from maven as a plugin dependency) and bring back the PlatformManager here.
|
||||
internal val Project.hostManager: HostManager
|
||||
get() = findProperty("hostManager") as HostManager? ?:
|
||||
if (hasProperty("org.jetbrains.kotlin.native.experimentalTargets"))
|
||||
HostManager(buildDistribution(rootProject.rootDir.absolutePath), true)
|
||||
else
|
||||
HostManager(customerDistribution(konanHome))
|
||||
get() = findProperty("hostManager") as HostManager? ?: HostManager()
|
||||
|
||||
internal val Project.konanTargets: List<KonanTarget>
|
||||
get() = hostManager.toKonanTargets(konanExtension.targets)
|
||||
|
||||
Reference in New Issue
Block a user