Make modules self contained; don't include sdl_gpu because it has duplicate symbols as sdl2.nim

This commit is contained in:
Joey Yakimowich-Payne 2020-04-12 21:06:32 -06:00
commit c6b469cf91
8 changed files with 4 additions and 29 deletions

View file

@ -1,5 +1,4 @@
import sdl2/sdl2
import sdl2/sdl2_gpu
import sdl2/sdl2_image
import sdl2/sdl2_mixer
import sdl2/sdl2_net
@ -7,7 +6,6 @@ import sdl2/sdl2_ttf
import sdl2/sdl2_gfx
export sdl2
export sdl2_gpu
export sdl2_image
export sdl2_mixer
export sdl2_net

View file

@ -1,4 +1,4 @@
import os
import os, strutils
import nimterop/[cimport, build]
const
@ -44,10 +44,6 @@ cOverride:
of CONTROLLER_BINDTYPE_NONE:
discard
# This should work, but also overrides some types
# Nimterop bug? @genotrance, comment these out
# and uncomment the checks in onSymbol for it to kind of work
# (it compiles but overrides nim types)
Uint64* = uint64
Uint32* = uint32
Uint16* = uint16

View file

@ -2,8 +2,6 @@ import os, strutils, strformat
import sdl2
import nimterop/[cimport, build]
export sdl2
const
baseDir = currentSourcePath.parentDir().parentDir().parentDir()
buildDir = baseDir / "build"

View file

@ -2,8 +2,6 @@ import os, strformat, strutils
import sdl2
import nimterop/[build, cimport]
export sdl2
const
baseDir = currentSourcePath.parentDir().parentDir().parentDir()
buildDir = baseDir / "build"
@ -22,16 +20,9 @@ getHeader(
&"-DSDL2MAIN_LIBRARY={SDLMainLib} -DSDL2_PATH={sdlDir} -DSDL2_INCLUDE_DIR={sdlIncludeDir} -DSDL_gpu_BUILD_DEMOS=OFF"
)
static:
# cDebug()
# cDisableCaching()
# This shouldn't be needed, but for some reason is
let contents = readFile(srcDir/"include/SDL_gpu.h")
let newContents = contents.replace("""typedef struct GPU_Renderer GPU_Renderer;
typedef struct GPU_Target GPU_Target;""", "")
writeFile(srcDir/"include/SDL_gpu.h", newContents)
# static:
# cDebug()
# cDisableCaching()
cOverride:
type

View file

@ -2,8 +2,6 @@ import os, strutils, strformat
import sdl2
import nimterop/[cimport, build]
export sdl2
const
baseDir = currentSourcePath.parentDir().parentDir().parentDir()
buildDir = baseDir / "build"

View file

@ -2,8 +2,6 @@ import os, strutils, strformat
import sdl2
import nimterop/[cimport, build]
export sdl2
const
baseDir = currentSourcePath.parentDir().parentDir().parentDir()
buildDir = baseDir / "build"

View file

@ -2,8 +2,6 @@ import os, strutils, strformat
import sdl2
import nimterop/[cimport, build]
export sdl2
const
baseDir = currentSourcePath.parentDir().parentDir().parentDir()
buildDir = baseDir / "build"

View file

@ -2,8 +2,6 @@ import os, strutils, strformat
import sdl2
import nimterop/[cimport, build]
export sdl2
const
baseDir = currentSourcePath.parentDir().parentDir().parentDir()
buildDir = baseDir / "build"