Skip to content

Building for Different Platforms

enderger edited this page Jun 15, 2020 · 2 revisions

Building for Different Platforms

  1. Create a nakefile.nim in the root folder of your project with the following contents:
import nimx/naketools
# You can add build configuration later

Here, we assume that your main file is called main.nim and is located in the root of the project. Next, use nake to build.

Nake Usage

Flags:

  • -d:release - Build in release mode
  • --norun - Don't run the project after build

Targets:

  • ios - iOS
  • ios-sim - iOS simulator
  • droid - Android
  • js - Nim JS backend
  • emscripten - Emscripten + Asm.js
  • wasm - Emscripten + WASM
  • else - Build for current desktop platform (Linux, MacOS, Windows)

Examples:

nake # Build and run for the current platform
nake --norun # Build for the current platform
nake -d:release droid # Build in release mod and run on currently connected device
nake js # Build in debug mode and run in default browser.
Clone this wiki locally