-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.nims
47 lines (40 loc) · 1.68 KB
/
config.nims
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import os, strutils
import natu/config
const main = "source/main.nim" # path to project file
const name = "ARushedHackJob" # name of ROM
put "natu.toolchain", "devkitarm"
put "natu.gameTitle", "RUSHHACKJOB" # max 12 chars, uppercase
put "natu.gameCode", "2HJP" # "2" = SRAM on EverDrive; "SF" = Stick Flip; P = Europe
switch "experimental", "overloadableEnums"
if projectPath() == thisDir() / main:
# This runs only when compiling the project file:
gbaCfg() # set C compiler + linker options for GBA target
switch "os", "any"
switch "gc", "arc"
switch "define", "useMalloc"
switch "define", "noSignalHandler"
switch "lineTrace", "on"
# switch "define", "panics:on"
# switch "checks", "off" # toggle assertions, bounds checking, etc.
switch "path", projectDir() # allow imports relative to the main file
switch "header" # output "{project}.h"
switch "nimcache", "nimcache" # output C sources to local directory
switch "cincludes", nimcacheDir() # allow external C files to include "{project}.h"
task assets, "builds just the assets":
gfxConvert "graphics.nims"
bgConvert "backgrounds.nims"
mmConvert "audio.nims"
task build, "builds the GBA rom":
let args = commandLineParams()[1..^1].join(" ")
gfxConvert "graphics.nims"
bgConvert "backgrounds.nims"
mmConvert "audio.nims"
selfExec "c " & args & " -o:" & name & ".elf " & thisDir() / main
gbaStrip name & ".elf", name & ".gba"
gbaFix name & ".gba"
task clean, "removes build files":
rmDir "nimcache"
rmDir "output"
rmFile name & ".gba"
rmFile name & ".elf"
rmFile name & ".elf.map"