Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
More work
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz-invideo committed Mar 3, 2022
1 parent 3e1bc26 commit 4f79eb4
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 496 deletions.
8 changes: 7 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,20 @@ subprojects {
}
}

for (baseName in listOf("nativeInteropMain", "posixInteropMain", "darwinInteropMain")) {
for (baseName in listOf(
"nativeInteropMain",
"posixInteropMain",
"darwinInteropMain",
"linuxInteropMain",
)) {
val nativeInteropMainFolder = file("src/$baseName/kotlin")
if (nativeInteropMainFolder.isDirectory) {
val currentNativeTarget = currentPlatformNativeTarget(project)
// @TODO: Copy instead of use the same source folder
for (target in allNativeTargets(project)) {
if (baseName.contains("posix", ignoreCase = true) && !target.isPosix) continue
if (baseName.contains("darwin", ignoreCase = true) && !target.isApple) continue
if (baseName.contains("linux", ignoreCase = true) && !target.isLinux) continue

val sourceSet = this@sourceSets.maybeCreate("${target.name}Main")
val folder = when {
Expand Down
441 changes: 0 additions & 441 deletions korgw/src/linuxX64Main/kotlin/com/soywiz/korgw/X11GameWindow.kt

This file was deleted.

3 changes: 0 additions & 3 deletions korio/src/iosArm32Main/kotlin/com/soywiz/korio/TargetInfo.kt

This file was deleted.

3 changes: 0 additions & 3 deletions korio/src/iosArm64Main/kotlin/com/soywiz/korio/TargetInfo.kt

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions korio/src/iosX64Main/kotlin/com/soywiz/korio/TargetInfo.kt

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions korio/src/linuxX64Main/kotlin/com/soywiz/korio/TargetInfo.kt

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions korio/src/macosX64Main/kotlin/com/soywiz/korio/TargetInfo.kt

This file was deleted.

3 changes: 0 additions & 3 deletions korio/src/mingwX64Main/kotlin/com/soywiz/korio/TargetInfo.kt

This file was deleted.

24 changes: 23 additions & 1 deletion korio/src/nativeMain/kotlin/com/soywiz/korio/nativeExpect.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
package com.soywiz.korio

expect fun nativeCwd(): String
expect val TARGET_INFO: String

val nativeOsfamilyName: String get() = when (Platform.osFamily) {
OsFamily.MACOSX -> "macos"
OsFamily.IOS -> "ios"
OsFamily.LINUX -> "linux"
OsFamily.WINDOWS -> "windows"
OsFamily.ANDROID -> "android"
OsFamily.WASM -> "wasm"
OsFamily.TVOS -> "tvos"
OsFamily.WATCHOS -> "watchos"
else -> "unknown"
}

val nativeArchName: String get() = when (Platform.cpuArchitecture) {
CpuArchitecture.ARM32 -> "Arm32"
CpuArchitecture.ARM64 -> "Arm64"
CpuArchitecture.X86 -> "X86"
CpuArchitecture.X64 -> "X64"
CpuArchitecture.MIPS32 -> "Mips32"
CpuArchitecture.MIPSEL32 -> "Mipsel32"
CpuArchitecture.WASM32 -> "Wasm32"
else -> "Unknown"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.soywiz.korio.util

import com.soywiz.korio.*

internal actual val rawPlatformName: String = "native"
internal actual val rawOsName: String = com.soywiz.korio.TARGET_INFO
internal actual val rawOsName: String = "$nativeOsfamilyName$nativeArchName"
3 changes: 0 additions & 3 deletions korio/src/tvosArm64Main/kotlin/com/soywiz/korio/TargetInfo.kt

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions korio/src/tvosX64Main/kotlin/com/soywiz/korio/TargetInfo.kt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 4f79eb4

Please sign in to comment.