Use isDefined

This commit is contained in:
Joey Yakimowich-Payne 2020-08-23 20:36:25 -06:00
commit 15383cfcff
2 changed files with 4 additions and 9 deletions

View file

@ -1 +0,0 @@
-d:GLEW_SetVer="2.1.0" -d:glewDL -d:glewStatic

View file

@ -9,6 +9,8 @@ const
includeDir = srcDir / "include" includeDir = srcDir / "include"
symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim" symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim"
setDefines(@["glewSetVer=2.1.0", "glewDL", "glewStatic"])
when defined(windows): when defined(windows):
when defined(amd64): when defined(amd64):
const flags = &"--libdir={buildDir} --includedir={includeDir} --host=x86_64-w64-mingw32" const flags = &"--libdir={buildDir} --includedir={includeDir} --host=x86_64-w64-mingw32"
@ -27,7 +29,7 @@ getHeader(
"glew.h", "glew.h",
dlurl = "https://github.com/nigels-com/glew/releases/download/glew-$1/glew-$1.zip", dlurl = "https://github.com/nigels-com/glew/releases/download/glew-$1/glew-$1.zip",
outdir = srcDir, outdir = srcDir,
altNames = "libGLEW", altNames = "libGLEW,glew,libglew",
conFlags = flags, conFlags = flags,
buildTypes = [btAutoConf] buildTypes = [btAutoConf]
) )
@ -36,20 +38,14 @@ cIncludeDir(includeDir)
static: static:
discard discard
# gitPull("https://github.com/lib/project", outdir=srcDir, plist="""
# src/*.h
# src/*.c
# """, checkout = "1f9c8864fc556a1be4d4bf1d6bfe20cde25734b4")
# cSkipSymbol @[] # cSkipSymbol @[]
# cDebug() # cDebug()
# cDisableCaching() # cDisableCaching()
# let contents = readFile(srcDir/"src"/"dynapi"/"SDL_dynapi_procs.h")
# writeFile(srcDir/"src"/"dynapi"/"SDL_dynapi_procs.c", contents
cPluginPath(symbolPluginPath) cPluginPath(symbolPluginPath)
when defined(glewStatic): when isDefined(glewStatic):
cImport(glewPath, recurse = true, flags = "-f=ast2 -H -E__,_ -F__,_") cImport(glewPath, recurse = true, flags = "-f=ast2 -H -E__,_ -F__,_")
else: else:
cImport(glewPath, recurse = true, dynlib = "glewLPath", flags = "-f=ast2 -H -E__,_ -F__,_") cImport(glewPath, recurse = true, dynlib = "glewLPath", flags = "-f=ast2 -H -E__,_ -F__,_")