From e027beba4e13aee31bc8872492e2b20bf6e2c6f3 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Wed, 29 Apr 2020 18:36:24 -0600 Subject: [PATCH] Fix windows building except for sdl2_image --- src/sdl2/sdl2.nim | 4 ++-- src/sdl2/sdl2_gpu.nim | 18 +++++++++--------- src/sdl2/sdl2_image.nim | 4 ++-- src/sdl2/sdl2_ttf.nim | 14 +++++++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/sdl2/sdl2.nim b/src/sdl2/sdl2.nim index 3288788..bdd5ed7 100644 --- a/src/sdl2/sdl2.nim +++ b/src/sdl2/sdl2.nim @@ -181,8 +181,8 @@ proc findStaticMainlib(): string = return findFile(pathRegex, buildDir, regex = true) const SDLDyLibPath* = findDynlib() -const SDLMainLib* = buildDir / findStaticMainlib() -const SDLStaticLib* = buildDir / findStaticlib() +const SDLMainLib* = findStaticMainlib() +const SDLStaticLib* = findStaticlib() const SDL2ConfigPath* = srcDir / "sdl2-config" const SDLSrcDir* = srcDir diff --git a/src/sdl2/sdl2_gpu.nim b/src/sdl2/sdl2_gpu.nim index 73bc132..88dbc99 100644 --- a/src/sdl2/sdl2_gpu.nim +++ b/src/sdl2/sdl2_gpu.nim @@ -4,18 +4,18 @@ import nimterop/[build, cimport] const baseDir = SDLCacheDir - sdlDir = baseDir / "sdl2" - sdlIncludeDir = sdlDir / "include" - srcDir = baseDir / "sdl2_gpu" - currentPath = currentSourcePath().parentDir().parentDir() - cmakeModPath = currentPath / "cmake" / "sdl2" - symbolPluginPath = currentPath / "sdl2" / "cleansymbols.nim" + sdlDir = (baseDir / "sdl2").sanitizePath + sdlIncludeDir = (sdlDir / "include").sanitizePath + srcDir = (baseDir / "sdl2_gpu").sanitizePath + currentPath = currentSourcePath().parentDir().parentDir().sanitizePath + cmakeModPath = (currentPath / "cmake" / "sdl2").replace("\\", "/") + symbolPluginPath = (currentPath / "sdl2" / "cleansymbols.nim").sanitizePath getHeader( "SDL_gpu.h", giturl = "https://github.com/grimfang4/sdl-gpu", outdir = srcDir, - altNames = "SDL2_gpu", + altNames = "SDL2_gpu,SDL2_gpu_s", cmakeFlags = &"-DCMAKE_C_FLAGS=-I{sdlIncludeDir} -DCMAKE_MODULE_PATH={cmakeModPath} -DSDL2_LIBRARY={SDLDyLibPath} " & &"-DSDL2MAIN_LIBRARY={SDLMainLib} -DSDL2_PATH={sdlDir} -DSDL2_INCLUDE_DIR={sdlIncludeDir} -DSDL_gpu_BUILD_DEMOS=OFF" ) @@ -123,6 +123,6 @@ const cPluginPath(symbolPluginPath) when defined(SDL_gpu_Static): - cImport(SDL_gpuPath, recurse = false, flags = &"-I={sdlIncludeDir} -f=ast2") + cImport(srcDir/"include"/"SDL_gpu.h", recurse = false, flags = &"-I={sdlIncludeDir} -f=ast2") else: - cImport(SDL_gpuPath, recurse = false, dynlib = "SDL_gpuLPath", flags = &"-I={sdlIncludeDir} -f=ast2") \ No newline at end of file + cImport(srcDir/"include"/"SDL_gpu.h", recurse = false, dynlib = "SDL_gpuLPath", flags = &"-I={sdlIncludeDir} -f=ast2") \ No newline at end of file diff --git a/src/sdl2/sdl2_image.nim b/src/sdl2/sdl2_image.nim index 8b65e12..09409d8 100644 --- a/src/sdl2/sdl2_image.nim +++ b/src/sdl2/sdl2_image.nim @@ -21,8 +21,8 @@ getHeader( ) # static: - # cDebug() - # cDisableCaching() +# cDebug() +# cDisableCaching() cOverride: const diff --git a/src/sdl2/sdl2_ttf.nim b/src/sdl2/sdl2_ttf.nim index d9521f5..d1d7796 100644 --- a/src/sdl2/sdl2_ttf.nim +++ b/src/sdl2/sdl2_ttf.nim @@ -4,12 +4,12 @@ import nimterop/[cimport, build] const baseDir = SDLCacheDir - sdlDir = baseDir / "sdl2" - sdlIncludeDir = sdlDir / "include" - srcDir = baseDir / "sdl2_ttf" - currentPath = currentSourcePath().parentDir().parentDir() + sdlDir = (baseDir / "sdl2").sanitizePath + sdlIncludeDir = (sdlDir / "include").sanitizePath + srcDir = (baseDir / "sdl2_ttf").sanitizePath + currentPath = currentSourcePath().parentDir().parentDir().sanitizePath cmakeModPath = (currentPath / "cmake" / "sdl2").replace("\\", "/") - symbolPluginPath = currentPath / "sdl2" / "cleansymbols.nim" + symbolPluginPath = (currentPath / "sdl2" / "cleansymbols.nim").sanitizePath when defined(windows): const dlurl = "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-$1.zip" @@ -21,8 +21,8 @@ getHeader( dlurl = dlurl, outdir = srcDir, altNames = "SDL2_ttf", - cmakeFlags = &"-DCMAKE_C_FLAGS=-I{sdlIncludeDir.sanitizePath} -DCMAKE_MODULE_PATH={cmakeModPath} " & - &"-DSDL2MAIN_LIBRARY={SDLMainLib.sanitizePath} -DSDL2_LIBRARY={SDLDyLibPath.sanitizePath} -DSDL2_PATH={sdlDir.sanitizePath}" + cmakeFlags = &"-DCMAKE_C_FLAGS=-I{sdlIncludeDir} -DCMAKE_MODULE_PATH={cmakeModPath} " & + &"-DSDL2MAIN_LIBRARY={SDLMainLib} -DSDL2_LIBRARY={SDLDyLibPath} -DSDL2_PATH={sdlDir}" ) # static: