Nathaniel Novod
Nathaniel Novod

Reputation: 181

Building an iOS application with scala-native

I'm trying to build an iOS application on os x with scala-native and running into a number of problems when doing the sbt build. Any hints about what to do are welcome.

I set build.sbt, using Xcode directories for iOS files, as follows:

    nativeCompileOptions := Seq("-v",  
    "-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk")

    nativeLinkingOptions := Seq("-v",
    "-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include",
    "-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib",
    "-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk")

Am I going about this all wrong? I'm not a sbt expert, but do I need to do major modifications of the scala-native sbt code?

Thank you.

Upvotes: 14

Views: 1353

Answers (1)

Andreas ZUERCHER
Andreas ZUERCHER

Reputation: 902

From an LLVM IR perspective, this should be possible and indeed almost supported (given being the guinea pig to plod through the debugging of smoothing off rough edges). But from the perspective of having the Apple frameworks available to you to invoke from Scala Native, you would have none of these Apple frameworks available to you from Scala Native, which means that the answer effectively is a hard "no" regarding utilizing Scala Native in its current ecosystem as a way to write iOS/iPadOS/MacOS apps on iPhone, iPad, Apple Watch, Apple TV, or Mac.

Upvotes: 2

Related Questions