Use nimFile

This commit is contained in:
Joey Yakimowich-Payne 2020-09-09 19:59:30 -06:00
commit 472f904546
2 changed files with 6 additions and 2 deletions

1
.gitignore vendored
View file

@ -6,6 +6,7 @@ nimcache/
nimblecache/ nimblecache/
htmldocs/ htmldocs/
build build
generated/
*.out *.out
.DS_Store .DS_Store

View file

@ -1,3 +1,4 @@
import macros
import os, strutils, strformat import os, strutils, strformat
import nimterop/[cimport, build, globals] import nimterop/[cimport, build, globals]
@ -7,6 +8,8 @@ const
srcDir = baseDir / "glew" srcDir = baseDir / "glew"
buildDir = srcDir / "lib" buildDir = srcDir / "lib"
includeDir = srcDir / "include" includeDir = srcDir / "include"
currentPath = getProjectPath().parentDir().sanitizePath
generatedPath = (currentPath / "generated" / "glew").replace("\\", "/")
symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim" symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim"
setDefines(@["glewSetVer=2.1.0", "glewDL", "glewStatic"]) setDefines(@["glewSetVer=2.1.0", "glewDL", "glewStatic"])
@ -46,6 +49,6 @@ static:
cPluginPath(symbolPluginPath) cPluginPath(symbolPluginPath)
when isDefined(glewStatic): when isDefined(glewStatic):
cImport(glewPath, recurse = true, flags = "-f=ast2 -H -E__,_ -F__,_") cImport(glewPath, recurse = true, flags = "-f=ast2 -H -E__,_ -F__,_", nimFile = generatedPath / "glew.nim")
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__,_", nimFile = generatedPath / "glew.nim")