Skip to content

Commit

Permalink
Add iosSimulatorArm64 target
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Drouin authored and sstone committed Dec 21, 2023
1 parent e2f7395 commit 6c784da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 9 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ kotlin {
}
}

// iosSimulatorArm64() : ios simulator on Apple Silicon devices. Disabled for now, until all dependencies support it.
iosSimulatorArm64 { // actual ios devices
compilations["main"].cinterops.create("PhoenixCrypto") {
val platform = "iphonesimulator"
val interopTask = tasks[interopProcessingTaskName]
interopTask.dependsOn(":PhoenixCrypto:buildCrypto${platform.capitalize()}")
includeDirs.headerFilterOnly("$rootDir/PhoenixCrypto/build/Release-$platform/include")
}
}
}

sourceSets {
Expand All @@ -88,7 +95,7 @@ kotlin {
api(ktor("serialization-kotlinx-json"))
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation("org.kodein.memory:kodein-memory-files:0.8.1")
implementation("org.kodein.memory:klio-files:0.12.0")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import fr.acinq.secp256k1.Hex
import kotlinx.serialization.encodeToString
import org.kodein.memory.file.*
import org.kodein.memory.system.Environment
import org.kodein.memory.text.putString
import org.kodein.memory.text.readString
import org.kodein.memory.text.writeString
import kotlin.test.Test
import kotlin.test.assertEquals

Expand All @@ -29,7 +29,7 @@ class StateSerializationNonRegTestsCommon {
val tmpFile = path.resolve("actual.json")
if (debug) {
tmpFile.openWriteableFile().run {
putString(json)
writeString(json)
close()
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/nativeInterop/cinterop/PhoenixCrypto.def
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ headerFilter = PhoenixCrypto/*
staticLibraries = libPhoenixCrypto.a
libraryPaths.ios_x64 = PhoenixCrypto/build/Release-iphonesimulator
libraryPaths.ios_arm64 = PhoenixCrypto/build/Release-iphoneos
libraryPaths.ios_simulator_arm64 = PhoenixCrypto/build/Release-iphonesimulator

linkerOpts = -L/usr/lib/swift
linkerOpts.ios_x64 = -platform_version ios-simulator 15.0.0 15.0.0 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/
linkerOpts.ios_arm64 = -iphoneos_version_min 15.0.0 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/
linkerOpts.ios_simulator_arm64 = -platform_version ios-simulator 15.0.0 15.0.0 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/

0 comments on commit 6c784da

Please sign in to comment.