From c6b469cf91bca852fe4bb0fe35c4f3e572dc625d Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Sun, 12 Apr 2020 21:06:32 -0600 Subject: [PATCH] Make modules self contained; don't include sdl_gpu because it has duplicate symbols as sdl2.nim --- src/sdl2.nim | 2 -- src/sdl2/sdl2.nim | 6 +----- src/sdl2/sdl2_gfx.nim | 2 -- src/sdl2/sdl2_gpu.nim | 15 +++------------ src/sdl2/sdl2_image.nim | 2 -- src/sdl2/sdl2_mixer.nim | 2 -- src/sdl2/sdl2_net.nim | 2 -- src/sdl2/sdl2_ttf.nim | 2 -- 8 files changed, 4 insertions(+), 29 deletions(-) diff --git a/src/sdl2.nim b/src/sdl2.nim index 400a943..783a234 100644 --- a/src/sdl2.nim +++ b/src/sdl2.nim @@ -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 diff --git a/src/sdl2/sdl2.nim b/src/sdl2/sdl2.nim index 39f9b7c..68fdd41 100644 --- a/src/sdl2/sdl2.nim +++ b/src/sdl2/sdl2.nim @@ -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 diff --git a/src/sdl2/sdl2_gfx.nim b/src/sdl2/sdl2_gfx.nim index 6862ac0..9c3cdfd 100644 --- a/src/sdl2/sdl2_gfx.nim +++ b/src/sdl2/sdl2_gfx.nim @@ -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" diff --git a/src/sdl2/sdl2_gpu.nim b/src/sdl2/sdl2_gpu.nim index 572a30c..8d2c093 100644 --- a/src/sdl2/sdl2_gpu.nim +++ b/src/sdl2/sdl2_gpu.nim @@ -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 diff --git a/src/sdl2/sdl2_image.nim b/src/sdl2/sdl2_image.nim index 59e44f5..40956d7 100644 --- a/src/sdl2/sdl2_image.nim +++ b/src/sdl2/sdl2_image.nim @@ -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" diff --git a/src/sdl2/sdl2_mixer.nim b/src/sdl2/sdl2_mixer.nim index d0931ab..b2a8c2e 100644 --- a/src/sdl2/sdl2_mixer.nim +++ b/src/sdl2/sdl2_mixer.nim @@ -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" diff --git a/src/sdl2/sdl2_net.nim b/src/sdl2/sdl2_net.nim index 0e956df..602e67d 100644 --- a/src/sdl2/sdl2_net.nim +++ b/src/sdl2/sdl2_net.nim @@ -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" diff --git a/src/sdl2/sdl2_ttf.nim b/src/sdl2/sdl2_ttf.nim index 78e679d..67ea99c 100644 --- a/src/sdl2/sdl2_ttf.nim +++ b/src/sdl2/sdl2_ttf.nim @@ -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"