Fix windows building except for sdl2_image

This commit is contained in:
Joey Yakimowich-Payne 2020-04-29 18:36:24 -06:00
commit e027beba4e
4 changed files with 20 additions and 20 deletions

View file

@ -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

View file

@ -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")
cImport(srcDir/"include"/"SDL_gpu.h", recurse = false, dynlib = "SDL_gpuLPath", flags = &"-I={sdlIncludeDir} -f=ast2")

View file

@ -21,8 +21,8 @@ getHeader(
)
# static:
# cDebug()
# cDisableCaching()
# cDebug()
# cDisableCaching()
cOverride:
const

View file

@ -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: