From 472f90454647ce3f9bb44d307b75004fc0bd4226 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Wed, 9 Sep 2020 19:59:30 -0600 Subject: [PATCH] Use nimFile --- .gitignore | 1 + src/glew/glew.nim | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8e82015..d26fc25 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ nimcache/ nimblecache/ htmldocs/ build +generated/ *.out .DS_Store diff --git a/src/glew/glew.nim b/src/glew/glew.nim index dd1d3bf..93f1639 100644 --- a/src/glew/glew.nim +++ b/src/glew/glew.nim @@ -1,3 +1,4 @@ +import macros import os, strutils, strformat import nimterop/[cimport, build, globals] @@ -7,6 +8,8 @@ const srcDir = baseDir / "glew" buildDir = srcDir / "lib" includeDir = srcDir / "include" + currentPath = getProjectPath().parentDir().sanitizePath + generatedPath = (currentPath / "generated" / "glew").replace("\\", "/") symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim" setDefines(@["glewSetVer=2.1.0", "glewDL", "glewStatic"]) @@ -46,6 +49,6 @@ static: cPluginPath(symbolPluginPath) 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: - 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")