[KT-43276] Add watchos_x64 target
This commit is contained in:
committed by
Stanislav Erokhin
parent
63b1aad3ef
commit
20931eebe1
+5
-5
@@ -1610,7 +1610,8 @@ private fun Context.is64BitNSInteger(): Boolean = when (val target = this.config
|
|||||||
KonanTarget.IOS_ARM64,
|
KonanTarget.IOS_ARM64,
|
||||||
KonanTarget.TVOS_ARM64,
|
KonanTarget.TVOS_ARM64,
|
||||||
KonanTarget.TVOS_X64,
|
KonanTarget.TVOS_X64,
|
||||||
KonanTarget.MACOS_X64 -> true
|
KonanTarget.MACOS_X64,
|
||||||
|
KonanTarget.WATCHOS_X64 -> true
|
||||||
KonanTarget.WATCHOS_ARM64,
|
KonanTarget.WATCHOS_ARM64,
|
||||||
KonanTarget.WATCHOS_ARM32,
|
KonanTarget.WATCHOS_ARM32,
|
||||||
KonanTarget.WATCHOS_X86,
|
KonanTarget.WATCHOS_X86,
|
||||||
@@ -1628,10 +1629,9 @@ private fun Context.is64BitNSInteger(): Boolean = when (val target = this.config
|
|||||||
KonanTarget.LINUX_MIPSEL32,
|
KonanTarget.LINUX_MIPSEL32,
|
||||||
KonanTarget.WASM32,
|
KonanTarget.WASM32,
|
||||||
is KonanTarget.ZEPHYR -> error("Target $target has no support for NSInteger type.")
|
is KonanTarget.ZEPHYR -> error("Target $target has no support for NSInteger type.")
|
||||||
KonanTarget.WATCHOS_X64 -> error("Target $target is not supported.")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun Context.is64BitLong(): Boolean = when (val target = this.config.target) {
|
internal fun Context.is64BitLong(): Boolean = when (this.config.target) {
|
||||||
KonanTarget.IOS_X64,
|
KonanTarget.IOS_X64,
|
||||||
KonanTarget.IOS_ARM64,
|
KonanTarget.IOS_ARM64,
|
||||||
KonanTarget.TVOS_ARM64,
|
KonanTarget.TVOS_ARM64,
|
||||||
@@ -1641,7 +1641,8 @@ internal fun Context.is64BitLong(): Boolean = when (val target = this.config.tar
|
|||||||
KonanTarget.LINUX_ARM64,
|
KonanTarget.LINUX_ARM64,
|
||||||
KonanTarget.MINGW_X64,
|
KonanTarget.MINGW_X64,
|
||||||
KonanTarget.LINUX_X64,
|
KonanTarget.LINUX_X64,
|
||||||
KonanTarget.MACOS_X64 -> true
|
KonanTarget.MACOS_X64,
|
||||||
|
KonanTarget.WATCHOS_X64 -> true
|
||||||
KonanTarget.WATCHOS_ARM64,
|
KonanTarget.WATCHOS_ARM64,
|
||||||
KonanTarget.WATCHOS_ARM32,
|
KonanTarget.WATCHOS_ARM32,
|
||||||
KonanTarget.ANDROID_X86,
|
KonanTarget.ANDROID_X86,
|
||||||
@@ -1654,5 +1655,4 @@ internal fun Context.is64BitLong(): Boolean = when (val target = this.config.tar
|
|||||||
KonanTarget.WASM32,
|
KonanTarget.WASM32,
|
||||||
is KonanTarget.ZEPHYR,
|
is KonanTarget.ZEPHYR,
|
||||||
KonanTarget.IOS_ARM32 -> false
|
KonanTarget.IOS_ARM32 -> false
|
||||||
KonanTarget.WATCHOS_X64 -> error("Target $target is not supported.")
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ private fun simulator(project: Project): ExecutorService = object : ExecutorServ
|
|||||||
private val device = project.findProperty("iosDevice")?.toString() ?: when (target) {
|
private val device = project.findProperty("iosDevice")?.toString() ?: when (target) {
|
||||||
KonanTarget.TVOS_X64 -> "Apple TV 4K"
|
KonanTarget.TVOS_X64 -> "Apple TV 4K"
|
||||||
KonanTarget.IOS_X64 -> "iPhone 8"
|
KonanTarget.IOS_X64 -> "iPhone 8"
|
||||||
KonanTarget.WATCHOS_X64,
|
KonanTarget.WATCHOS_X64 -> "Apple Watch Series 6 - 40mm"
|
||||||
KonanTarget.WATCHOS_X86 -> "Apple Watch Series 4 - 40mm"
|
KonanTarget.WATCHOS_X86 -> "Apple Watch Series 4 - 40mm"
|
||||||
else -> error("Unexpected simulation target: $target")
|
else -> error("Unexpected simulation target: $target")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ allprojects {
|
|||||||
|
|
||||||
void setupHostAndTarget() {
|
void setupHostAndTarget() {
|
||||||
ext.hostName = platformManager.hostName
|
ext.hostName = platformManager.hostName
|
||||||
ext.targetList = platformManager.filteredOutEnabledButNotSupported.collect { it.visibleName } as List
|
ext.targetList = platformManager.enabled.collect { it.visibleName } as List
|
||||||
ext.konanTargetList = platformManager.enabled as List
|
ext.konanTargetList = platformManager.enabled as List
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ enum DependencyKind {
|
|||||||
def platformManager = rootProject.ext.platformManager
|
def platformManager = rootProject.ext.platformManager
|
||||||
|
|
||||||
|
|
||||||
platformManager.filteredOutEnabledButNotSupported.each { target ->
|
platformManager.enabled.each { target ->
|
||||||
def loader = platformManager.loader(target)
|
def loader = platformManager.loader(target)
|
||||||
|
|
||||||
task "${target}Dependencies"(type: NativeDep) {
|
task "${target}Dependencies"(type: NativeDep) {
|
||||||
|
|||||||
@@ -337,6 +337,33 @@ osVersionMin.watchos_x86 = 5.0
|
|||||||
runtimeDefinitions.watchos_x86 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS=1 KONAN_NO_64BIT_ATOMIC=1 \
|
runtimeDefinitions.watchos_x86 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS=1 KONAN_NO_64BIT_ATOMIC=1 \
|
||||||
KONAN_X86=1 KONAN_CORE_SYMBOLICATION=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
|
KONAN_X86=1 KONAN_CORE_SYMBOLICATION=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
|
||||||
|
|
||||||
|
# watchOS x86_64 simulator.
|
||||||
|
targetToolchain.macos_x64-watchos_x64 = target-toolchain-xcode_12_0-macos_x64
|
||||||
|
dependencies.macos_x64-watchos_x64 = \
|
||||||
|
libffi-3.2.1-3-darwin-macos
|
||||||
|
|
||||||
|
target-sysroot-xcode_12_0-watchos_x64.default = \
|
||||||
|
remote:internal
|
||||||
|
|
||||||
|
arch.watchos_x64 = x86_64
|
||||||
|
targetSysRoot.watchos_x64 = target-sysroot-xcode_12_0-watchos_x86
|
||||||
|
targetCpu.watchos_x64 = core2
|
||||||
|
clangFlags.watchos_x64 = -cc1 -emit-obj -disable-llvm-passes -x ir -target-cpu $targetCpu.watchos_x64
|
||||||
|
clangNooptFlags.watchos_x64 = -O1
|
||||||
|
clangOptFlags.watchos_x64 = -O3
|
||||||
|
clangDebugFlags.watchos_x64 = -O0
|
||||||
|
clangDynamicFlags.watchos_x64 =
|
||||||
|
|
||||||
|
linkerKonanFlags.watchos_x64 = -lSystem -lc++ -lobjc -framework Foundation -sdk_version 7.0
|
||||||
|
linkerOptimizationFlags.watchos_x64 = -dead_strip
|
||||||
|
linkerNoDebugFlags.watchos_x64 = -S
|
||||||
|
linkerDynamicFlags.watchos_x64 = -dylib
|
||||||
|
osVersionMinFlagLd.watchos_x64 = -watchos_simulator_version_min
|
||||||
|
osVersionMinFlagClang.watchos_x64 = -mwatchos-simulator-version-min
|
||||||
|
osVersionMin.watchos_x64 = 7.0
|
||||||
|
runtimeDefinitions.watchos_x64 = KONAN_OBJC_INTEROP=1 KONAN_WATCHOS=1 \
|
||||||
|
KONAN_X64=1 KONAN_CORE_SYMBOLICATION=1 KONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1
|
||||||
|
|
||||||
# Linux x86-64.
|
# Linux x86-64.
|
||||||
llvmHome.linux_x64 = $llvm.linux_x64.dev
|
llvmHome.linux_x64 = $llvm.linux_x64.dev
|
||||||
libffiDir.linux_x64 = libffi-3.2.1-2-linux-x86-64
|
libffiDir.linux_x64 = libffi-3.2.1-2-linux-x86-64
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
../../../../dist/bin/run_konan defFileDependencies \
|
../../../../dist/bin/run_konan defFileDependencies \
|
||||||
-target watchos_arm32 \
|
-target watchos_arm32 \
|
||||||
-target watchos_x86 \
|
-target watchos_x86 \
|
||||||
|
-target watchos_arm64 \
|
||||||
|
-target watchos_x64 \
|
||||||
*.def
|
*.def
|
||||||
|
|
||||||
#TODO: Reenable targets
|
|
||||||
# -target watchos_arm64 \
|
|
||||||
# -target watchos_x64 \
|
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ class ClangArgs(private val configurables: Configurables) : Configurables by con
|
|||||||
KonanTarget.WATCHOS_X86 ->
|
KonanTarget.WATCHOS_X86 ->
|
||||||
listOf("-stdlib=libc++", "-arch", "i386", "-isysroot", absoluteTargetSysRoot, "-mwatchos-simulator-version-min=$osVersionMin")
|
listOf("-stdlib=libc++", "-arch", "i386", "-isysroot", absoluteTargetSysRoot, "-mwatchos-simulator-version-min=$osVersionMin")
|
||||||
|
|
||||||
KonanTarget.WATCHOS_X64 -> TODO("implement me")
|
KonanTarget.WATCHOS_X64 ->
|
||||||
|
listOf("-stdlib=libc++", "-isysroot", absoluteTargetSysRoot, "-mwatchos-simulator-version-min=$osVersionMin")
|
||||||
|
|
||||||
KonanTarget.ANDROID_ARM32, KonanTarget.ANDROID_ARM64,
|
KonanTarget.ANDROID_ARM32, KonanTarget.ANDROID_ARM64,
|
||||||
KonanTarget.ANDROID_X86, KonanTarget.ANDROID_X64 -> {
|
KonanTarget.ANDROID_X86, KonanTarget.ANDROID_X64 -> {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class PlatformManager(private val distribution: Distribution, experimental: Bool
|
|||||||
|
|
||||||
constructor(konanHome: String, experimental: Boolean = false): this(Distribution(konanHome), experimental)
|
constructor(konanHome: String, experimental: Boolean = false): this(Distribution(konanHome), experimental)
|
||||||
|
|
||||||
private val loaders = filteredOutEnabledButNotSupported.map {
|
private val loaders = enabled.map {
|
||||||
it to loadConfigurables(it, distribution.properties, DependencyProcessor.defaultDependenciesRoot.absolutePath)
|
it to loadConfigurables(it, distribution.properties, DependencyProcessor.defaultDependenciesRoot.absolutePath)
|
||||||
}.toMap()
|
}.toMap()
|
||||||
|
|
||||||
@@ -46,11 +46,5 @@ class PlatformManager(private val distribution: Distribution, experimental: Bool
|
|||||||
val hostPlatform = platforms.getValue(host)
|
val hostPlatform = platforms.getValue(host)
|
||||||
|
|
||||||
fun loader(target: KonanTarget) = loaders.getValue(target)
|
fun loader(target: KonanTarget) = loaders.getValue(target)
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Don't forget to delete this field and replace all its usages to `enabled`.
|
|
||||||
*/
|
|
||||||
val filteredOutEnabledButNotSupported
|
|
||||||
get() = enabled.filterNot { it == KonanTarget.WATCHOS_X64 }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ class PathSpecification extends BaseKonanSpecification {
|
|||||||
expect:
|
expect:
|
||||||
def project = KonanProject.createEmpty(
|
def project = KonanProject.createEmpty(
|
||||||
projectDirectory,
|
projectDirectory,
|
||||||
platformManager.filteredOutEnabledButNotSupported.collect { t -> t.visibleName }
|
platformManager.enabled.collect { t -> t.visibleName }
|
||||||
) { KonanProject it ->
|
) { KonanProject it ->
|
||||||
it.generateSrcFile("main.kt")
|
it.generateSrcFile("main.kt")
|
||||||
it.generateDefFile("interop.def", "")
|
it.generateDefFile("interop.def", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user