Fix windows building except for sdl2_image
This commit is contained in:
parent
90c4554c7e
commit
e027beba4e
4 changed files with 20 additions and 20 deletions
|
|
@ -181,8 +181,8 @@ proc findStaticMainlib(): string =
|
||||||
return findFile(pathRegex, buildDir, regex = true)
|
return findFile(pathRegex, buildDir, regex = true)
|
||||||
|
|
||||||
const SDLDyLibPath* = findDynlib()
|
const SDLDyLibPath* = findDynlib()
|
||||||
const SDLMainLib* = buildDir / findStaticMainlib()
|
const SDLMainLib* = findStaticMainlib()
|
||||||
const SDLStaticLib* = buildDir / findStaticlib()
|
const SDLStaticLib* = findStaticlib()
|
||||||
const SDL2ConfigPath* = srcDir / "sdl2-config"
|
const SDL2ConfigPath* = srcDir / "sdl2-config"
|
||||||
const SDLSrcDir* = srcDir
|
const SDLSrcDir* = srcDir
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,18 @@ import nimterop/[build, cimport]
|
||||||
|
|
||||||
const
|
const
|
||||||
baseDir = SDLCacheDir
|
baseDir = SDLCacheDir
|
||||||
sdlDir = baseDir / "sdl2"
|
sdlDir = (baseDir / "sdl2").sanitizePath
|
||||||
sdlIncludeDir = sdlDir / "include"
|
sdlIncludeDir = (sdlDir / "include").sanitizePath
|
||||||
srcDir = baseDir / "sdl2_gpu"
|
srcDir = (baseDir / "sdl2_gpu").sanitizePath
|
||||||
currentPath = currentSourcePath().parentDir().parentDir()
|
currentPath = currentSourcePath().parentDir().parentDir().sanitizePath
|
||||||
cmakeModPath = currentPath / "cmake" / "sdl2"
|
cmakeModPath = (currentPath / "cmake" / "sdl2").replace("\\", "/")
|
||||||
symbolPluginPath = currentPath / "sdl2" / "cleansymbols.nim"
|
symbolPluginPath = (currentPath / "sdl2" / "cleansymbols.nim").sanitizePath
|
||||||
|
|
||||||
getHeader(
|
getHeader(
|
||||||
"SDL_gpu.h",
|
"SDL_gpu.h",
|
||||||
giturl = "https://github.com/grimfang4/sdl-gpu",
|
giturl = "https://github.com/grimfang4/sdl-gpu",
|
||||||
outdir = srcDir,
|
outdir = srcDir,
|
||||||
altNames = "SDL2_gpu",
|
altNames = "SDL2_gpu,SDL2_gpu_s",
|
||||||
cmakeFlags = &"-DCMAKE_C_FLAGS=-I{sdlIncludeDir} -DCMAKE_MODULE_PATH={cmakeModPath} -DSDL2_LIBRARY={SDLDyLibPath} " &
|
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"
|
&"-DSDL2MAIN_LIBRARY={SDLMainLib} -DSDL2_PATH={sdlDir} -DSDL2_INCLUDE_DIR={sdlIncludeDir} -DSDL_gpu_BUILD_DEMOS=OFF"
|
||||||
)
|
)
|
||||||
|
|
@ -123,6 +123,6 @@ const
|
||||||
cPluginPath(symbolPluginPath)
|
cPluginPath(symbolPluginPath)
|
||||||
|
|
||||||
when defined(SDL_gpu_Static):
|
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:
|
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")
|
||||||
|
|
@ -4,12 +4,12 @@ import nimterop/[cimport, build]
|
||||||
|
|
||||||
const
|
const
|
||||||
baseDir = SDLCacheDir
|
baseDir = SDLCacheDir
|
||||||
sdlDir = baseDir / "sdl2"
|
sdlDir = (baseDir / "sdl2").sanitizePath
|
||||||
sdlIncludeDir = sdlDir / "include"
|
sdlIncludeDir = (sdlDir / "include").sanitizePath
|
||||||
srcDir = baseDir / "sdl2_ttf"
|
srcDir = (baseDir / "sdl2_ttf").sanitizePath
|
||||||
currentPath = currentSourcePath().parentDir().parentDir()
|
currentPath = currentSourcePath().parentDir().parentDir().sanitizePath
|
||||||
cmakeModPath = (currentPath / "cmake" / "sdl2").replace("\\", "/")
|
cmakeModPath = (currentPath / "cmake" / "sdl2").replace("\\", "/")
|
||||||
symbolPluginPath = currentPath / "sdl2" / "cleansymbols.nim"
|
symbolPluginPath = (currentPath / "sdl2" / "cleansymbols.nim").sanitizePath
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
const dlurl = "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-$1.zip"
|
const dlurl = "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-$1.zip"
|
||||||
|
|
@ -21,8 +21,8 @@ getHeader(
|
||||||
dlurl = dlurl,
|
dlurl = dlurl,
|
||||||
outdir = srcDir,
|
outdir = srcDir,
|
||||||
altNames = "SDL2_ttf",
|
altNames = "SDL2_ttf",
|
||||||
cmakeFlags = &"-DCMAKE_C_FLAGS=-I{sdlIncludeDir.sanitizePath} -DCMAKE_MODULE_PATH={cmakeModPath} " &
|
cmakeFlags = &"-DCMAKE_C_FLAGS=-I{sdlIncludeDir} -DCMAKE_MODULE_PATH={cmakeModPath} " &
|
||||||
&"-DSDL2MAIN_LIBRARY={SDLMainLib.sanitizePath} -DSDL2_LIBRARY={SDLDyLibPath.sanitizePath} -DSDL2_PATH={sdlDir.sanitizePath}"
|
&"-DSDL2MAIN_LIBRARY={SDLMainLib} -DSDL2_LIBRARY={SDLDyLibPath} -DSDL2_PATH={sdlDir}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# static:
|
# static:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue