Support windows
This commit is contained in:
parent
bf983abb67
commit
c9eb978ec9
1 changed files with 33 additions and 8 deletions
|
|
@ -10,7 +10,15 @@ const
|
|||
currentPath = getProjectPath().parentDir().sanitizePath
|
||||
generatedPath = (currentPath / "generated" / "glfw").replace("\\", "/")
|
||||
symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim"
|
||||
defs = """
|
||||
|
||||
when defined(windows):
|
||||
const defs = """
|
||||
glfw3SetVer=3.3.2
|
||||
glfw3DL
|
||||
glfw3Static
|
||||
"""
|
||||
else:
|
||||
const defs = """
|
||||
glfw3SetVer=05dd2fa
|
||||
glfw3Git
|
||||
glfw3Static
|
||||
|
|
@ -18,9 +26,15 @@ const
|
|||
|
||||
setDefines(defs.splitLines())
|
||||
|
||||
when defined(amd64):
|
||||
const dlUrl = "https://github.com/glfw/glfw/releases/download/$1/glfw-$1.bin.WIN64.zip"
|
||||
else:
|
||||
const dlUrl = "https://github.com/glfw/glfw/releases/download/$1/glfw-$1.bin.WIN32.zip"
|
||||
|
||||
getHeader(
|
||||
"glfw3.h",
|
||||
giturl = "https://github.com/glfw/glfw",
|
||||
dlUrl = dlUrl,
|
||||
outdir = srcDir,
|
||||
altNames = "glfw,glfw3",
|
||||
)
|
||||
|
|
@ -34,14 +48,23 @@ static:
|
|||
# cOverride:
|
||||
# discard
|
||||
|
||||
cIncludeDir(srcDir/"include"/"GLFW")
|
||||
when defined(windows):
|
||||
when defined(amd64):
|
||||
const inclDir = srcDir / "glfw-3.3.2.bin.WIN64" / "include" / "GLFW"
|
||||
else:
|
||||
const inclDir = srcDir / "glfw-3.3.2.bin.WIN32" / "include" / "GLFW"
|
||||
else:
|
||||
const inclDir = srcDir / "include" / "GLFW"
|
||||
|
||||
cIncludeDir(inclDir)
|
||||
cPluginPath(symbolPluginPath)
|
||||
|
||||
{.passL: "-pthread".}
|
||||
|
||||
when isDefined(glfw3Static):
|
||||
cImport(srcDir/"include"/"GLFW"/"glfw3.h", recurse = true, flags = "-f=ast2 -E__,_ -F__,_ -H", nimFile = generatedPath / "glfw.nim")
|
||||
cImport(inclDir/"glfw3.h", recurse = true, flags = "-f=ast2 -E__,_ -F__,_ -H", nimFile = generatedPath / "glfw.nim")
|
||||
else:
|
||||
cImport(srcDir/"include"/"GLFW"/"glfw3.h", recurse = true, dynlib = "glfw3LPath", flags = "-f=ast2 -E__,_ -F__,_ -H", nimFile = generatedPath / "glfw.nim")
|
||||
cImport(inclDir/"glfw3.h", recurse = true, dynlib = "glfw3LPath", flags = "-f=ast2 -E__,_ -F__,_ -H", nimFile = generatedPath / "glfw.nim")
|
||||
|
||||
const
|
||||
KEY_LAST* = KEY_MENU
|
||||
|
|
@ -56,7 +79,9 @@ const
|
|||
GAMEPAD_BUTTON_SQUARE* = GAMEPAD_BUTTON_X
|
||||
GAMEPAD_BUTTON_TRIANGLE* = GAMEPAD_BUTTON_Y
|
||||
GAMEPAD_AXIS_LAST* = GAMEPAD_AXIS_RIGHT_TRIGGER
|
||||
OPENGL_DEBUG_CONTEXT* = CONTEXT_DEBUG
|
||||
HRESIZE_CURSOR* = RESIZE_EW_CURSOR
|
||||
VRESIZE_CURSOR* = RESIZE_NS_CURSOR
|
||||
HAND_CURSOR* = POINTING_HAND_CURSOR
|
||||
when not defined(windows):
|
||||
const
|
||||
OPENGL_DEBUG_CONTEXT* = CONTEXT_DEBUG
|
||||
HRESIZE_CURSOR* = RESIZE_EW_CURSOR
|
||||
VRESIZE_CURSOR* = RESIZE_NS_CURSOR
|
||||
HAND_CURSOR* = POINTING_HAND_CURSOR
|
||||
Loading…
Add table
Add a link
Reference in a new issue