Kotlin Help

Kotlin/Native binary options

This page lists helpful Kotlin/Native binary options that you can use to configure Kotlin/Native final binaries and the ways to set up binary options in your project.

How to enable

You can enable binary options in the gradle.properties file, your build file, or pass them as compiler arguments.

In Gradle properties

You can set binary options in your project's gradle.properties file using the kotlin.native.binary property. For example:

kotlin.native.binary.latin1Strings=true

In your build file

You can set binary options for your project in your build.gradle.kts file:

  • For specific binaries using the binaryOption attribute. For example:

    kotlin { iosArm64 { binaries { framework { binaryOption("smallBinary", "true") } } } }
  • As -Xbinary=$option=$value compiler options in the freeCompilerArgs attribute. For example:

    kotlin { iosArm64 { compilations.configureEach { compilerOptions.configure { freeCompilerArgs.add("-Xbinary=smallBinary=true") } } } }

In the command-line compiler

You can pass binary options as -Xbinary=$option=$value directly in the command line when executing the Kotlin/Native compiler. For example:

kotlinc-native main.kt -Xbinary=enableSafepointSignposts=true

Binary options

What's next

Learn how to build final native binaries.

07 August 2026