Mostly fixed unix builds

This commit is contained in:
Joey Yakimowich-Payne 2020-05-10 10:47:16 -06:00
commit a29c775cb3
6 changed files with 35 additions and 30 deletions

View file

@ -16,11 +16,13 @@ else:
when defined(windows):
when defined(amd64):
const flags = &"--libdir={buildDir} --includedir={includeDir} --host=x86_64-w64-mingw32"
const flags = &"--libdir={buildDir} --includedir={includeDir} --host=x86_64-w64-mingw32 CFLAGS=\"-fPIC\""
else:
const flags = &"--libdir={buildDir} --includedir={includeDir} --host=i686-w64-mingw32"
const flags = &"--libdir={buildDir} --includedir={includeDir} --host=i686-w64-mingw32 CFLAGS=\"-fPIC\""
elif defined(macosx):
const flags = &"--libdir={buildDir} --includedir={includeDir} CFLAGS=\"-fPIC\""
else:
const flags = &"--libdir={buildDir} --includedir={includeDir}"
const flags = &"CFLAGS=\"-fPIC\""
getHeader(
"SDL.h",
@ -200,7 +202,7 @@ static:
# else:
# putEnv("PATH", buildDir & ":" & pathenv)
let cflags = getEnv("CFLAGS")
putEnv("CFLAGS", &"-I{includeDir} {cflags}")
putEnv("CFLAGS", &"-I{includeDir} -fPIC {cflags}")
when defined(linux):
putEnv("LDFLAGS", &"-L{buildDir} -L{buildDir.unixizePath} {conf} -Wl,--no-as-needed -lsndio -ldl") # & " " & buildDir/"libSDL2main.a")
else:
@ -215,7 +217,10 @@ static:
# putEnv("DYLD_LIBRARY_PATH", &"{buildDir}:{buildDir.unixizePath}:{dyldpath}")
# putEnv("SDL2_PATH", srcDir)
{.passC: "-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -fPIC".}
when defined(macosx):
{.passC: "-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -fPIC".}
else:
{.passC: "-fPIC".}
when defined(SDL_Static):
cImport(srcDir/"include"/"SDL.h", recurse = true, flags = "-f=ast2 -DDOXYGEN_SHOULD_IGNORE_THIS -E__,_ -F__,_")

View file

@ -11,11 +11,11 @@ const
when defined(windows):
when defined(amd64):
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir}"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
getHeader(
"SDL2_gfxPrimitives.h",

View file

@ -4,7 +4,6 @@ import nimterop/[cimport, build]
const
baseDir = SDLCacheDir
sdlIncludeDir = baseDir / "sdl2" / "include"
srcDir = baseDir / "sdl2_image"
buildDir = srcDir / ".libs"
symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim"
@ -16,13 +15,16 @@ else:
when defined(windows):
when defined(amd64):
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir}"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
{.passC: "-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -fPIC".}
when defined(macosx):
{.passC: "-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -fPIC".}
else:
{.passC: "-fPIC -I{SDLIncludeDir}".}
getHeader(
"SDL_image.h",
@ -46,7 +48,7 @@ cOverride:
ClearError* = ""
cPluginPath(symbolPluginPath)
cIncludeDir(sdlIncludeDir)
cIncludeDir(SDLIncludeDir)
when defined(SDL_image_Static):
cImport(srcDir/"SDL_image.h", recurse = false, flags = &"-f=ast2")

View file

@ -4,7 +4,6 @@ import nimterop/[cimport, build]
const
baseDir = SDLCacheDir
sdlIncludeDir = baseDir / "sdl2" / "include"
srcDir = baseDir / "sdl2_mixer"
buildDir = srcDir / "build" / ".libs"
symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim"
@ -16,11 +15,11 @@ else:
when defined(windows):
when defined(amd64):
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir}"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
getHeader(
"SDL_mixer.h",
@ -46,6 +45,6 @@ cOverride:
cPluginPath(symbolPluginPath)
when defined(SDL_Mixer_Static):
cImport(srcDir/"SDL_mixer.h", recurse = false, flags = &"-I={sdlIncludeDir} -f=ast2")
cImport(srcDir/"SDL_mixer.h", recurse = false, flags = &"-I={SDLIncludeDir} -f=ast2")
else:
cImport(srcDir/"SDL_mixer.h", recurse = false, dynlib = "SDL_mixer_LPath", flags = &"-I={sdlIncludeDir} -f=ast2")
cImport(srcDir/"SDL_mixer.h", recurse = false, dynlib = "SDL_mixer_LPath", flags = &"-I={SDLIncludeDir} -f=ast2")

View file

@ -4,7 +4,6 @@ import nimterop/[cimport, build]
const
baseDir = SDLCacheDir
sdlIncludeDir = baseDir / "sdl2" / "include"
srcDir = baseDir / "sdl2_net"
buildDir = srcDir / ".libs"
symbolPluginPath = currentSourcePath.parentDir() / "cleansymbols.nim"
@ -16,11 +15,11 @@ else:
when defined(windows):
when defined(amd64):
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir}"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
getHeader(
"SDL_net.h",
@ -44,8 +43,8 @@ cOverride:
cPluginPath(symbolPluginPath)
when defined(SDL_net_Static):
cImport(srcDir / "SDL_net.h", recurse = false, flags = &"-I={sdlIncludeDir} -f=ast2")
cImport(srcDir / "SDLnetsys.h", recurse = false, flags = &"-I={sdlIncludeDir} -f=ast2")
cImport(srcDir / "SDL_net.h", recurse = false, flags = &"-I={SDLIncludeDir} -f=ast2")
cImport(srcDir / "SDLnetsys.h", recurse = false, flags = &"-I={SDLIncludeDir} -f=ast2")
else:
cImport(srcDir / "SDL_net.h", recurse = false, dynlib = "SDL_net_LPath", flags = &"-I={sdlIncludeDir} -f=ast2")
cImport(srcDir / "SDLnetsys.h", recurse = false, flags = &"-I={sdlIncludeDir} -f=ast2")
cImport(srcDir / "SDLnetsys.h", recurse = false, flags = &"-I={SDLIncludeDir} -f=ast2")

View file

@ -17,11 +17,11 @@ else:
when defined(windows):
when defined(amd64):
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=x86_64-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} --host=i686-w64-mingw32 CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
else:
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir}"
const flags = &"--libdir={SDLBuildDir} --includedir={SDLIncludeDir} CFLAGS=\"-fPIC -I{SDLIncludeDir}\""
getHeader(