简体   繁体   中英

Build M1 binary for Kotlin Native in IntelliJ IDEA

I'm playing with Kotlin Native on my M1 Mac using IntelliJ IDEA 2022.3 Community Edition. (Build #IC-223.7571.182, built on November 29, 2022; Runtime version: 17.0.5+1-b653.14 aarch64)

I noticed that the resulting binaries are for x86_64

I can't find in the settings, the IDEA help, or Google how to get it to build for aarch64.

Is it missing or am I just not finding the setting?

我的项目设置的 Kotlin Compiler 页面

I still have not found a way to set this via the GUI and I don't have a Java, Kotlin, Gradle, or JetBrains background, but I found out how to change it in the configuration files for now:

修复的项目和编辑器选项卡

In the project tab I can edit build.gradle.kts and change the kotlin / nativeTarget / hostOS line:

Was:

hostOs == "Mac OS X" -> macosX64("native")

Now:

hostOs == "Mac OS X" -> macosArm64("native")

Thanks to the help of this post on YouTrack from a month ago: New Kotlin Multiplatform Native Application project template won't run on Apple M1 from IntelliJ IDEA

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM