Add windows support

This commit is contained in:
Joey Yakimowich-Payne 2018-07-15 15:54:01 +09:00
commit 919ff32b1b
5 changed files with 45 additions and 57 deletions

View file

@ -1,4 +0,0 @@
switch("passC", "-I" & thisDir() & "/src/libnx/wrapper/nx/include")
switch("passL", "-specs="&thisDir()&"/src/libnx/wrapper/nx/switch.specs -L"&thisDir()&"/src/libnx/wrapper/nx/lib -lnx")
#switch("passC", "-I$DEVKITPRO/libnx/include")
#switch("passL", "-specs=$DEVKITPRO/libnx/switch.specs -L$DEVKITPRO/libnx/lib -lnx")

View file

@ -1,6 +1,6 @@
# Package
version = "0.1.7"
version = "0.1.8"
author = "Joey Payne"
description = "Nintendo Switch library libnx for Nim."
license = "The Unlicense"

View file

@ -22,12 +22,46 @@ filter=lock
"${output}/nim.cfg"
"${output}/config.nims"
[svc.h]
search = "PACKED"
replace = ""
search.noreturn = "NORETURN"
replace.noreturn = ""
defines=true
[result.h]
defines = true
[hid.h]
defines = true
search.static_assert = "static_assert"
replace.static_assert = "// static_assert"
search.touch = "touchPosition"
replace.touch = "TouchPosition"
[ipc.h]
defines = true
[romfs_dev.h]
search = "romfs_"
replace = "Romfs_"
[gfx.h]
defines = true
[ioctl.h]
defines = true
search = "_NV_"
replace = "UNV_"
search.nv = "__nv_"
replace.nv = "DUnv_"
[n.wildcard]
wildcard.1 = "console.h"
rename = "$replace(console=con)"
search = "_Bool"
replace = "bool"
rename = "$replace(console=cons)"
wildcard.2 = "*.h"
@ -68,10 +102,7 @@ replace.cdecl = "cdecl"
[n.prepare]
git = "https://github.com/switchbrew/libnx"
execute = """
cd ${output}
make
"""
#execute = """cd ${output}; make;"""
[n.post]
reset=true
@ -81,56 +112,21 @@ create = """
--path:"../"
--path:"../../"
"""
noprocess=true
[src/libnx/wrapper/config.nims]
create = """
switch("passC", "-I" & thisDir() & "/nx/include")
switch("passL", "-specs=" & thisDir() & "/nx/switch.specs -L" & thisDir() & "/nx/lib -lnx")
"""
[result.h]
defines = true
[hid.h]
defines = true
search.static_assert = "static_assert"
replace.static_assert = "// static_assert"
search.touch = "touchPosition"
replace.touch = "TouchPosition"
[ipc.h]
defines = true
[romfs_dev.h]
search = "romfs_"
replace = "Romfs_"
[gfx.h]
defines = true
[ioctl.h]
defines = true
search = "_NV_"
replace = "UNV_"
search.nv = "__nv_"
replace.nv = "DUnv_"
[svc.h]
search = "PACKED"
replace = ""
search.noreturn = "NORETURN"
replace.noreturn = ""
defines=true
pipe = "vim -es +'g/^static inline.*{/norm f{d%r;' -es +%print -es +q! $file"
noprocess=true
[switch.h]
preprocess = true
defines = true
recurse = true
[types.nim]
search.o = " uint8*"
prepend.o = """
@ -313,7 +309,7 @@ prepend.o = """
import libnx/ext/integer128
"""
[con.nim]
[cons.nim]
search.o = "type\n"
prepend.o = """

View file

@ -1,4 +0,0 @@
switch("passC", "-I" & thisDir() & "/wrapper/nx/include")
switch("passL", "-specs=" & thisDir() & "/wrapper/nx/switch.specs -L" & thisDir() & "/wrapper/nx/lib -lnx")
#switch("passC", "-I$DEVKITPRO/libnx/include")
#switch("passL", "-specs=$DEVKITPRO/libnx/switch.specs -L$DEVKITPRO/libnx/lib -lnx")

View file

@ -1,4 +1,4 @@
import libnx/wrapper/con
import libnx/wrapper/cons
import libnx/utils
import macros, strutils