From 19f09a8ebcf2818a5864abb6a289d111cf8fcc31 Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Thu, 11 Jan 2018 16:59:02 +0700 Subject: [PATCH] Update to godot-nim v0.7.1 --- nakefile.nim | 15 ++++++++++++++- nimlib.gdnlib | 2 ++ src/stub.nimble | 30 +----------------------------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/nakefile.nim b/nakefile.nim index 93b6c64..1a6bf03 100644 --- a/nakefile.nim +++ b/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") diff --git a/nimlib.gdnlib b/nimlib.gdnlib index 483a17e..271214f 100644 --- a/nimlib.gdnlib +++ b/nimlib.gdnlib @@ -16,3 +16,5 @@ load_once=true symbol_prefix="godot_" [dependencies] + +Windows=PoolStringArray() \ No newline at end of file diff --git a/src/stub.nimble b/src/stub.nimble index c70213b..d344b14 100644 --- a/src/stub.nimble +++ b/src/stub.nimble @@ -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"