Update to godot-nim v0.7.1
This commit is contained in:
parent
b5ac353ad2
commit
19f09a8ebc
3 changed files with 17 additions and 30 deletions
15
nakefile.nim
15
nakefile.nim
|
|
@ -27,8 +27,21 @@ proc genGodotApi() =
|
|||
|
||||
task "build", "Builds the client for the current platform":
|
||||
genGodotApi()
|
||||
let bitsPostfix = when sizeof(int) == 8: "_64" else: "_32"
|
||||
let libFile =
|
||||
when defined(windows):
|
||||
"nim" & bitsPostfix & ".dll"
|
||||
elif defined(ios):
|
||||
"nim_ios" & bitsPostfix & ".dylib"
|
||||
elif defined(macosx):
|
||||
"nim_mac.dylib"
|
||||
elif defined(android):
|
||||
"libnim_android.so"
|
||||
elif defined(linux):
|
||||
"nim_linux" & bitsPostfix & ".so"
|
||||
else: nil
|
||||
withDir "src":
|
||||
direShell("nimble", "make")
|
||||
direShell(["nimble", "c", ".."/"src"/"stub.nim", "-o:.."/"_dlls"/libFile])
|
||||
|
||||
task "clean", "Remove files produced by build":
|
||||
removeDir(".nimcache")
|
||||
|
|
|
|||
|
|
@ -16,3 +16,5 @@ load_once=true
|
|||
symbol_prefix="godot_"
|
||||
|
||||
[dependencies]
|
||||
|
||||
Windows=PoolStringArray()
|
||||
|
|
@ -2,33 +2,5 @@ version = "0.1.0"
|
|||
author = "Xored Software, Inc."
|
||||
description = "Godot-Nim Project Stub"
|
||||
license = "MIT"
|
||||
bin = @["stub"]
|
||||
|
||||
requires "godot >= 0.6.8 & < 0.7.0"
|
||||
|
||||
task make, "build":
|
||||
const bitsPostfix = when sizeof(int) == 8: "_64" else: "_32"
|
||||
const libFile =
|
||||
when defined(windows):
|
||||
"nim" & bitsPostfix & ".dll"
|
||||
elif defined(ios):
|
||||
"nim_ios" & bitsPostfix & ".dylib"
|
||||
elif defined(macosx):
|
||||
"nim_mac.dylib"
|
||||
elif defined(android):
|
||||
"libnim_android.so"
|
||||
elif defined(linux):
|
||||
"nim_linux" & bitsPostfix & ".so"
|
||||
else: nil
|
||||
if libFile.isNil:
|
||||
raise newException(OSError, "Unsupported platform")
|
||||
|
||||
exec "nimble build -y"
|
||||
const dir = "../_dlls/"
|
||||
const target = dir & libFile
|
||||
mkDir(dir)
|
||||
when defined(windows):
|
||||
rmFile(target)
|
||||
mvFile(bin[0] & ".exe", target)
|
||||
else:
|
||||
mvFile(bin[0], target)
|
||||
requires "godot >= 0.7.1 & < 0.8.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue